~ubuntu-branches/ubuntu/vivid/ceilometer/vivid

« back to all changes in this revision

Viewing changes to ceilometer/tests/hardware/pollsters/test_cpu.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-03-06 14:44:28 UTC
  • mto: (28.1.1 utopic-proposed) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: package-import@ubuntu.com-20140306144428-rvphsh4igwyulzf0
Tags: upstream-2014.1~b3
Import upstream version 2014.1~b3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
#
 
3
# Copyright © 2013 Intel Corp
 
4
#
 
5
# Authors: Lianhao Lu <lianhao.lu@intel.com>
 
6
#
 
7
# Licensed under the Apache License, Version 2.0 (the "License"); you may
 
8
# not use this file except in compliance with the License. You may obtain
 
9
# a copy of the License at
 
10
#
 
11
#      http://www.apache.org/licenses/LICENSE-2.0
 
12
#
 
13
# Unless required by applicable law or agreed to in writing, software
 
14
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
15
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
16
# License for the specific language governing permissions and limitations
 
17
# under the License.
 
18
 
 
19
from ceilometer.hardware.pollsters import cpu
 
20
from ceilometer import sample
 
21
from ceilometer.tests.hardware.pollsters import base
 
22
 
 
23
 
 
24
class TestCPUPollsters(base.TestPollsterBase):
 
25
    def test_1min(self):
 
26
        self._check_get_samples(cpu.CPUUtil1MinPollster, 'cpu.util.1min',
 
27
                                0.99, sample.TYPE_GAUGE)
 
28
 
 
29
    def test_5min(self):
 
30
        self._check_get_samples(cpu.CPUUtil5MinPollster, 'cpu.util.5min',
 
31
                                0.77, sample.TYPE_GAUGE)
 
32
 
 
33
    def test_15min(self):
 
34
        self._check_get_samples(cpu.CPUUtil15MinPollster, 'cpu.util.15min',
 
35
                                0.55, sample.TYPE_GAUGE)