コード例 #1
0
ファイル: counters.go プロジェクト: Huangyan9188/statsdaemon
// processCounters computes the outbound metrics for counters and puts them in the buffer
func (c *Counters) Process(buffer *bytes.Buffer, now int64, interval int) int64 {
	var num int64
	for key, val := range c.values {
		val := val / float64(interval)
		fmt.Fprintf(buffer, "%s %f %d\n", m20.DeriveCount(key, c.prefixRates), val, now)
		num++
	}
	return num
}
コード例 #2
0
ファイル: counters.go プロジェクト: deepglint/statsdaemon
// processCounters computes the outbound metrics for counters and puts them in the buffer
func (c *Counters) Process(buffer *bytes.Buffer, now int64, interval int) int64 {
	var num int64
	for key, val := range c.values {
		// The value is amortized to the interval, the default value of which is 10s, evenly.
		val := val / float64(interval)
		fmt.Fprintf(buffer, "%s %f %d\n", m20.DeriveCount(key, c.prefixRates), val, now)
		num++
	}
	return num
}