定制 jtl/go-prometrics-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jtl/go-prometrics-client

Composer 安装命令:

composer require jtl/go-prometrics-client

包简介

PHP-Client to use the JTL GoPrometrics Service

README 文档

README

Build and Unit Testing

Usage

This library use semantic visioning. You can use composer to install jtl/go-prometrics-client in your project.

Counter

//simple counter
$counter = new Counter(new Client(), "http://127.0.0.1:9111");
$counter->counter('BEER', 'BITBURGER');

//counter with labels
$labelList = new LabelList();
$labelList->add(new Label('type', 'Pils'));
$labelList->add(new Label('alc', '4.8'));
$counter = new Counter(new Client(), "http://127.0.0.1:9111");
$counter->counter('BEER', 'BITBURGER', $labelList);

//counter with labels and help text
$counter->counter('BEER', 'BITBURGER', $labelList, 'It could help');

Histogram

//simple histogramm
$bucketList = [0.1, 0.5, 1.0, 5.0];
$histogram = new Histogram(new Client(), "http://127.0.0.1:9111");
$histogram->observe('BEER', 'BITBURGER', 0.33, $bucketList);

//histogramm with labels
$labelList = new LabelList();
$labelList->add(new Label('type', 'Pils'));
$labelList->add(new Label('alc', '4.8'));
$histogram = new Histogram(new Client(), "http://127.0.0.1:9111");
$histogram->observe('BEER', 'BITBURGER', 0.33, $bucketList , $labelList);

//histogramm with labels and help text
$histogram->observe('BEER', 'BITBURGER', 0.33, $bucketList, $labelList, 'It could help');

Gauge

//simple gauge
$gauge = new Gauge(new Client(), "http://127.0.0.1:9111");
$gauge->inc('BEER', 'BITBURGER'); // Increase by one
$gauge->dec('BEER', 'BITBURGER'); // Decrease by one

$gauge->set('BEER', 'BITBURGER', 3); // Set value to three
$gauge->incBy('BEER', 'BITBURGER', 3); // Increase by three
$gauge->decBy('BEER', 'BITBURGER', 3); // Decrease by three

//gauge with labels
$labelList = new LabelList();
$labelList->add(new Label('type', 'Pils'));
$labelList->add(new Label('alc', '4.8'));
$gauge = new Gauge(new Client(), "http://127.0.0.1:9111");
$gauge->inc('BEER', 'BITBURGER', $labelList);
$gauge->dec('BEER', 'BITBURGER', $labelList);

$gauge->set('BEER', 'BITBURGER', 3, $labelList);
$gauge->incBy('BEER', 'BITBURGER', 2, $labelList);
$gauge->decBy('BEER', 'BITBURGER', 2, $labelList);

//gauge with labels and help text
$gauge->inc('BEER', 'BITBURGER', $labelList, 'It could help');
$gauge->dec('BEER', 'BITBURGER', $labelList, 'It could help');

$gauge->set('BEER', 'BITBURGER', 3, $labelList, 'It could help');
$gauge->incBy('BEER', 'BITBURGER', 3, $labelList, 'It could help');
$gauge->decBy('BEER', 'BITBURGER', 3, $labelList, 'It could help');

统计信息

  • 总下载量: 32.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固