easybill/serverdensity_udp_metric_client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

easybill/serverdensity_udp_metric_client

Composer 安装命令:

composer require easybill/serverdensity_udp_metric_client

包简介

Client for UDP-Agent https://github.com/easybill/serverdensity-udp-agent

README 文档

README

Installing

This project is build on each release for Linux & Mac x86, aarch64. You can download these pre-build binaries from the releases tab.

Other Platforms

For other platforms you need to compile this lib yourself:

  1. Install Rust and Cargo
  2. Clone this repository
  3. Run cargo b --release --bin=openmetrics_udpserver
  4. The executable is located in target/release/openmetrics_udpserver

Sending Metrics

The UDP-Server will collect sent metrics and make them available through a http endpoint using the openmetrics-text encoding. Sent values for the metric types Min, Average & Peak are just single values (if a value is received twice before collection, the old value gets overridden). The Sum metric type will sum up all received values until a collection happens - then the counter is reset to 0.

From performance perspective you could send thousands of messages per second.

PHP

We provide a small php client

composer require easybill/serverdensity_udp_metric_client
<?php

$client = new ServerdensityUDPAgent();
$client->sendSum('[METRIC_GROUP].[METRIC]', 1);

Data Format

The data format that must be used to send data to the server must be as follows:

  1. u16: representation of the metric type (see table below)
  2. i32: the data count
  3. the utf-8 encoded name of the metric

All numbers must be encoded using big endian byte order.

Metric Types:

Type ID
Sum 42
Average 43
Peak 44
Min 45

Installing + Supervisor

# replace the download link for the required platform
wget https://github.com/easybill/openmetrics-udp-agent/releases/latest/download/openmetrics_udpserver_linux_x86_64
chmod +x sopenmetrics_udpserver
mv openmetrics_udpserver /usr/local/bin/

now you can test if the server starts:

./openmetrics_udpserver

open /etc/supervisor/conf.d/openmetrics_udpserver.conf and add:

[program:openmetrics_udpserver]
command=openmetrics_udpserver
user=sd-agent
process_name=%(program_name)s
numprocs=1
directory=/tmp
autostart=true
autorestart=true
startsecs=0
startretries=10
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s_error.log
stopsignal=QUIT

Check the update of the new process

supervisorctl status openmetrics_udpserver

Updating the udp server

wget https://github.com/easybill/openmetrics-udp-agent/releases/latest/download/openmetrics_udpserver_linux_x86_64
chmod +x openmetrics_udpserver
supervisorctl stop openmetrics_udpserver
rm /usr/local/bin/openmetrics_udpserver
mv openmetrics_udpserver /usr/local/bin/
supervisorctl start openmetrics_udpserver
supervisorctl status openmetrics_udpserver

easybill/serverdensity_udp_metric_client 适用场景与选型建议

easybill/serverdensity_udp_metric_client 是一款 基于 Rust 开发的 Composer 扩展包,目前已累计 76.21k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2017 年 10 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 easybill/serverdensity_udp_metric_client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 easybill/serverdensity_udp_metric_client 我们能提供哪些服务?
定制开发 / 二次开发

基于 easybill/serverdensity_udp_metric_client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 8
  • Forks: 0
  • 开发语言: Rust

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-25