统计数据收集代理 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

数学模型选谈

数学模型选谈

华罗庚//王元 / 大连理工大学出版社 / 2011-5 / 25.00元

《走向数学丛书03-数学模型选谈》,本书主要介绍了关于在等高线图上计算矿藏储量与坡地面积的问题、挂轮问题、挂轮问题、优选法(单、多因素)、黄金数与数值积分和统筹方法等数学模型问题。一起来看看 《数学模型选谈》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具