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


Python prometheus_client.Info方法代码示例

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


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

示例1: create_metric

# 需要导入模块: import prometheus_client [as 别名]
# 或者: from prometheus_client import Info [as 别名]
def create_metric(self):
        # record app conf
        self.conf_info = Info('celery_conf_info','APP_CONF')
        self.conf_info_c = CollectorRegistry()

        # monitor worker info
        self.workers_info = Info('celery_workers_info', 'WORKER_INFO')
        self.workers_info_c = CollectorRegistry()

        # monitor worker info real-time
        self.workers_state = Gauge('celery_workers_state', 'WORKER_STATE', ['worker'])
        self.workers_state_c = CollectorRegistry()
        self.workers_processed = Gauge('celery_processed_tasks_total', 'WORKER_TASKS_PROCESSED', ['worker'])
        self.workers_processed_c = CollectorRegistry()
        self.workers_active = Gauge('celery_active_tasks_total', 'WORKER_TASKS_ACTIVE', ['worker'])
        self.workers_active_c = CollectorRegistry()

        # monitor tasks info
        self.tasks_counter = Counter('celery_tasks_total', 'TASK_COUNT_INFO', ['worker','task','result'])
        self.tasks_counter_c = CollectorRegistry()
        self.tasks_runtime = Summary('celery_tasks_seconds', 'TASK_RUNTIME', ['worker', 'task'])
        self.tasks_runtime_c = CollectorRegistry()
        self.tasks_info = Info('celery_tasks_info', 'TASK_INFO')
        self.tasks_info_c = CollectorRegistry() 
开发者ID:adrianyoung,项目名称:CrawlerMonitor,代码行数:26,代码来源:monitor.py

示例2: test_prometheus_info

# 需要导入模块: import prometheus_client [as 别名]
# 或者: from prometheus_client import Info [as 别名]
def test_prometheus_info():
    @solid(required_resource_keys={'prometheus'})
    def prometheus_solid(context):
        i = Info(
            'my_build_version',
            'Description of info',
            registry=context.resources.prometheus.registry,
        )
        info_labels = {'version': '1.2.3', 'buildhost': 'foo@bar'}
        i.info(info_labels)
        metric = None
        for metric in context.resources.prometheus.registry.collect():
            if metric.name == 'my_build_version':
                break
        assert metric and metric.samples[0].labels == info_labels

    assert execute_solid(prometheus_solid, run_config=ENV, mode_def=MODE).success 
开发者ID:dagster-io,项目名称:dagster,代码行数:19,代码来源:test_resources.py

示例3: info

# 需要导入模块: import prometheus_client [as 别名]
# 或者: from prometheus_client import Info [as 别名]
def info(self, val):
        """Set info metric."""
        if self._labelname_set.intersection(val.keys()):
            raise ValueError('Overlapping labels for Info metric, metric: %s child: %s' % (
                self._labelnames, val))
        with self._lock:
            self._value = dict(val) 
开发者ID:prometheus,项目名称:client_python,代码行数:9,代码来源:metrics.py

示例4: _info

# 需要导入模块: import prometheus_client [as 别名]
# 或者: from prometheus_client import Info [as 别名]
def _info(self, var, var_help):
        return Info(var, var_help, registry=self._reg) # pylint: disable=unexpected-keyword-arg 
开发者ID:faucetsdn,项目名称:faucet,代码行数:4,代码来源:faucet_metrics.py

示例5: info

# 需要导入模块: import prometheus_client [as 别名]
# 或者: from prometheus_client import Info [as 别名]
def info(self, val):
        '''Set info metric.'''
        if self._labelname_set.intersection(val.keys()):
            raise ValueError('Overlapping labels for Info metric, metric: %s child: %s' % (
                self._labelnames, val))
        with self._lock:
            self._value = dict(val) 
开发者ID:holzschu,项目名称:Carnets,代码行数:9,代码来源:metrics.py


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