统计数据收集代理 Telegraf

码农软件 · 软件分类 · 其他开发相关 · 2019-10-20 09:42:21

软件介绍

Telegraf 是一个用 Go 编写的代理程序,可收集系统和服务的统计数据,并写入到 InfluxDB 数据库。

Telegraf 具有内存占用小的特点,通过插件系统开发人员可轻松添加支持其他服务的扩展。

目前已有的插件包括:

  • System (memory, CPU, network, etc.)

  • Docker

  • MySQL

  • PostgreSQL

  • Redis

示例代码:

package cn.huxi.tools.util;
 // simple.go

import "github.com/influxdb/telegraf/plugins"

type Simple struct {
  Ok bool
}

func (s *Simple) Description() string {
  return "a demo plugin"
}

func (s *Simple) SampleConfig() string {
  return "ok = true # indicate if everything is fine"
}

func (s *Simple) Gather(acc plugins.Accumulator) error {
  if s.Ok {
    acc.Add("state", "pretty good", nil)
  } else {
    acc.Add("state", "not great", nil)
  }

  return nil
}

func init() {
  plugins.Add("simple", func() plugins.Plugin { &Simple{} })
}

本文地址:https://codercto.com/soft/d/17155.html

Jakarta Struts Cookbook中文版

Jakarta Struts Cookbook中文版

斯格科 / 清华大学 / 2007-7 / 56.00元

Jakarta Struts Cookbook(中文版),ISBN:9787302155638,作者:(美)斯格科一起来看看 《Jakarta Struts Cookbook中文版》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码