Skip to content

projecteru/eru-metric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eru-Metric

GoDoc

A library for watching container metrics and send to remote.

This repo implement open-falcon methods you can write your methods by your self.

How

  • write a func to implement Send method if you want send metircs to other place.
func Send(data map[string]float64, endpoint, tag string, timestamp, step int64) error
  • set metric global setting
SetGlobalSetting(client Remote, timeout, forceTimeout time.Duration, vlanPrefix, defaultVlan string)
  • create a backend object which implemented Send interface.

  • create a metric for each container.

CreateMetric(step time.Duration, client Remote, tag, endpoint string)
  • init metric object
InitMetric(cid string, pid int)
  • update, calcuate, save and send
UpdateStats(cid string)
CalcRate(info map[string]uint64, now time.Time)
SaveLast(info map[string]uint64)
Send(rate map[string]float64)
  • exit metirc
Exit()

Example

see example.go only work under LINUX environment.

eru-metric CONTAINERID CONTAINERID ... CONTAINERID [-DEBUG] [-d docker remote addr] [-t transfer remote addr]

About

send container metric to anywhere you want

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages