2
# Copyright 2014 NEC Corporation. All rights reserved.
4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
5
# not use this file except in compliance with the License. You may obtain
6
# a copy of the License at
8
# http://www.apache.org/licenses/LICENSE-2.0
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
# License for the specific language governing permissions and limitations
19
from stevedore import extension
21
from ceilometer.central import plugin
22
from ceilometer import sample
25
@six.add_metaclass(abc.ABCMeta)
26
class _Base(plugin.CentralPollster):
28
NAMESPACE = 'network.statistics.drivers'
29
extension_manager = extension.ExtensionManager(namespace=NAMESPACE,
34
'''Return a Meter Name.'''
38
'''Return a Meter Type.'''
42
'''Return a Meter Unit.'''
44
def get_samples(self, manager, cache, resources=[]):
45
for resource in resources:
46
sample_data = self.extension_manager.map_method('get_sample_data',
50
for data in sample_data:
53
if not isinstance(data, list):
55
for (volume, resource_id,
56
resource_metadata, timestamp) in data:
65
resource_id=resource_id,
67
resource_metadata=resource_metadata