1
# -*- encoding: utf-8 -*-
3
# Copyright © 2013 ZHAW SoE
4
# Copyright © 2014 Intel Corp.
6
# Authors: Lucas Graf <graflu0@students.zhaw.ch>
7
# Toni Zehnder <zehndton@students.zhaw.ch>
8
# Lianhao Lu <lianhao.lu@intel.com>
10
# Licensed under the Apache License, Version 2.0 (the "License"); you may
11
# not use this file except in compliance with the License. You may obtain
12
# a copy of the License at
14
# http://www.apache.org/licenses/LICENSE-2.0
16
# Unless required by applicable law or agreed to in writing, software
17
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
19
# License for the specific language governing permissions and limitations
22
from ceilometer.hardware import plugin
23
from ceilometer.hardware.pollsters import util
24
from ceilometer import sample
27
class _Base(plugin.HardwarePollster):
30
INSPECT_METHOD = 'inspect_disk'
33
class DiskTotalPollster(_Base):
36
def generate_one_sample(host, c_data):
38
return util.make_sample_from_host(host,
39
name='disk.size.total',
40
type=sample.TYPE_GAUGE,
47
class DiskUsedPollster(_Base):
50
def generate_one_sample(host, c_data):
52
return util.make_sample_from_host(host,
53
name='disk.size.used',
54
type=sample.TYPE_GAUGE,