當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。