当前位置: 首页>>代码示例>>Python>>正文


Python Metrology.counter方法代码示例

本文整理汇总了Python中metrology.Metrology.counter方法的典型用法代码示例。如果您正苦于以下问题:Python Metrology.counter方法的具体用法?Python Metrology.counter怎么用?Python Metrology.counter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在metrology.Metrology的用法示例。


在下文中一共展示了Metrology.counter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def setUp(self):
        self.reporter = LibratoReporter("<email>", "<token>")

        Metrology.meter('meter').mark()
        Metrology.counter('counter').increment()
        Metrology.timer('timer').update(1.5)
        Metrology.utilization_timer('utimer').update(1.5)
开发者ID:damiendube,项目名称:metrology,代码行数:9,代码来源:test_librato.py

示例2: setUp

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def setUp(self):
        self.reporter = GraphiteReporter('localhost', 3333)

        Metrology.meter('meter').mark()
        Metrology.counter('counter').increment()
        Metrology.timer('timer').update(1.5)
        Metrology.utilization_timer('utimer').update(1.5)
开发者ID:arnaudlimbourg,项目名称:metrology,代码行数:9,代码来源:test_graphite.py

示例3: setUp

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def setUp(self):
        self.reporter = GangliaReporter("Group Name", "localhost", 8649)

        Metrology.meter('meter').mark()
        Metrology.counter('counter').increment()
        Metrology.timer('timer').update(5)
        Metrology.utilization_timer('utimer').update(5)
开发者ID:cyberdelia,项目名称:metrology,代码行数:9,代码来源:test_ganglia.py

示例4: setUp

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def setUp(self):
        self.output = StringIO()
        logging.basicConfig(stream=self.output, level=logging.INFO)

        self.reporter = LoggerReporter()

        Metrology.meter('meter').mark()
        Metrology.counter('counter').increment()
        Metrology.timer('timer').update(1.5)
        Metrology.utilization_timer('utimer').update(1.5)
开发者ID:Motoma,项目名称:metrology,代码行数:12,代码来源:test_logger.py

示例5: test_send_batch

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def test_send_batch(self, mock):
        self.reporter = GraphiteReporter('localhost', 3333, batch_size=2)

        Metrology.meter('meter').mark()
        Metrology.counter('counter').increment()
        Metrology.timer('timer').update(5)
        Metrology.utilization_timer('utimer').update(5)
        Metrology.histogram('histogram').update(5)
        self.reporter.write()
        self.assertTrue(mock.send.assert_called())
        self.assertEqual(25, len(mock.sendall.call_args_list))
        self.reporter.stop()
开发者ID:kevineder,项目名称:metrology,代码行数:14,代码来源:test_graphite.py

示例6: test_send_batch

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def test_send_batch(self, mock):
        self.reporter = GraphiteReporter("localhost", 3334, pickle=True, batch_size=2)

        Metrology.meter("meter").mark()
        Metrology.counter("counter").increment()
        Metrology.timer("timer").update(5)
        Metrology.utilization_timer("utimer").update(5)
        Metrology.histogram("histogram").update(5)
        self.reporter.write()
        self.assertTrue(mock.sendall.assert_called())
        self.assertEqual(25, len(mock.sendall.call_args_list))
        self.reporter.stop()
开发者ID:zkplatlab,项目名称:metrology,代码行数:14,代码来源:test_graphite_pickle.py

示例7: __init__

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
    def __init__(self, single=False ):
        """
        Initalizer

        @param single: collect from a single device?
        @type single: boolean
        """
        PBDaemon.__init__(self)
        # FIXME: cleanup --force option #2660
        self.options.force = True
        self.start = None
        self.startat = None
        self.rrdStats = DaemonStats()
        self.single = single
        if self.options.device:
            self.single = True
        self.modelerCycleInterval = self.options.cycletime
        # get the minutes and convert to fraction of a day
        self.collage = float( self.options.collage ) / 1440.0
        self.pendingNewClients = False
        self.clients = []
        self.finished = []
        self.devicegen = None
        self.counters = collections.Counter()
        self.configFilter = None
        self.configLoaded = False

        # Make sendEvent() available to plugins
        zope.component.provideUtility(self, IEventService)

        # Delay start for between 10 and 60 seconds when run as a daemon.
        self.started = False
        self.startDelay = 0
        self.immediate = 1
        if self.options.daemon or self.options.cycle:
            if self.options.now:
                self.log.debug('option "now" specified, starting immediately.')
            else:
                # self.startDelay = randint(10, 60) * 60
                self.startDelay = randint(10, 60) * 1
                self.immediate = 0
                self.log.info('option "now" not specified, waiting %s seconds to start.' %
                              self.startDelay)
        else:
            self.log.debug("Run in foreground, starting immediately.")


        # ZEN-26637
        self.collectorLoopIteration = 0
        self.mainLoopGotDeviceList = False

        self._modeledDevicesMetric = Metrology.meter("zenmodeler.modeledDevices")
        self._failuresMetric = Metrology.counter("zenmodeler.failures")
开发者ID:zenoss,项目名称:zenoss-prodbin,代码行数:55,代码来源:zenmodeler.py

示例8: test_counter

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
 def test_counter(self):
     self.assertTrue(Metrology.counter('test') is not None)
开发者ID:cyberdelia,项目名称:metrology,代码行数:4,代码来源:test_metrology.py

示例9: test_get

# 需要导入模块: from metrology import Metrology [as 别名]
# 或者: from metrology.Metrology import counter [as 别名]
 def test_get(self):
     Metrology.counter('test')
     self.assertTrue(Metrology.get('test') is not None)
开发者ID:cyberdelia,项目名称:metrology,代码行数:5,代码来源:test_metrology.py


注:本文中的metrology.Metrology.counter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。