示例#1
0
func (endpoint *RouterEndpoint) newStats() c.Statistics {
	m := map[string]interface{}{
		"messageCount": float64(0),
		"flushCount":   float64(0),
	}
	stats, _ := c.NewStatistics(m)
	return stats
}
示例#2
0
func (p *Projector) doStatistics() interface{} {
	logging.Infof("%v doStatistics()\n", p.logPrefix)
	defer logging.Infof("%v doStatistics() returns ...\n", p.logPrefix)

	m := map[string]interface{}{
		"clusterAddr": p.clusterAddr,
		"adminport":   p.adminport,
	}
	stats, _ := c.NewStatistics(m)

	feeds, _ := c.NewStatistics(nil)
	for topic, feed := range p.topics {
		feeds.Set(topic, feed.GetStatistics())
	}
	stats.Set("feeds", feeds)
	return map[string]interface{}(stats)
}
示例#3
0
func (vr *VbucketRoutine) newStats() c.Statistics {
	m := map[string]interface{}{
		"addInsts":  float64(0), // no. of update-engine commands
		"delInsts":  float64(0), // no. of delete-engine commands
		"syncs":     float64(0), // no. of Sync message generated
		"snapshots": float64(0), // no. of Begin
		"mutations": float64(0), // no. of Upsert, Delete
	}
	stats, _ := c.NewStatistics(m)
	return stats
}
示例#4
0
文件: kvdata.go 项目: jchris/indexing
func (kvdata *KVData) newStats() c.Statistics {
	statVbuckets := make(map[string]interface{})
	m := map[string]interface{}{
		"events":   float64(0),   // no. of mutations events received
		"addInsts": float64(0),   // no. of addInstances received
		"delInsts": float64(0),   // no. of delInsts received
		"tsCount":  float64(0),   // no. of updateTs received
		"vbuckets": statVbuckets, // per vbucket statistics
	}
	stats, _ := c.NewStatistics(m)
	return stats
}
示例#5
0
// GetStatistics for adminport daemon
func (s *httpServer) GetStatistics() c.Statistics {
	s.mu.Lock()
	defer s.mu.Unlock()

	m := map[string]interface{}{
		"urlPrefix": s.urlPrefix,
		"payload":   [2]uint64{s.statsInBytes, s.statsOutBytes},
	}
	for name, ns := range s.statsMessages {
		m[name] = [3]uint64{ns[0] /*in*/, ns[1] /*out*/, ns[2] /*err*/}
	}
	stats, _ := c.NewStatistics(m)
	return stats
}