Source code for

# Copyright 2014 NEC Corporation.  All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from import flow
from ceilometer import sample
from import statistics

[docs]class TestFlowPollsters(statistics._PollsterTestBase):
[docs] def test_flow_pollster(self): self._test_pollster( flow.FlowPollster, 'switch.flow', sample.TYPE_GAUGE, 'flow')
[docs] def test_flow_pollster_duration_seconds(self): self._test_pollster( flow.FlowPollsterDurationSeconds, 'switch.flow.duration_seconds', sample.TYPE_GAUGE, 's')
[docs] def test_flow_pollster_duration_nanoseconds(self): self._test_pollster( flow.FlowPollsterDurationNanoseconds, 'switch.flow.duration_nanoseconds', sample.TYPE_GAUGE, 'ns')
[docs] def test_flow_pollster_packets(self): self._test_pollster( flow.FlowPollsterPackets, 'switch.flow.packets', sample.TYPE_CUMULATIVE, 'packet')
[docs] def test_flow_pollster_bytes(self): self._test_pollster( flow.FlowPollsterBytes, 'switch.flow.bytes', sample.TYPE_CUMULATIVE, 'B')

Project Source