示例#1
0
func (this *Graph) LastRaw(param cmodel.GraphLastParam, resp *cmodel.GraphLastResp) error {
	// statistics
	proc.GraphLastRawCnt.Incr()

	resp.Endpoint = param.Endpoint
	resp.Counter = param.Counter
	resp.Value = GetLastRaw(param.Endpoint, param.Counter)

	return nil
}
示例#2
0
文件: graph.go 项目: peteryj/graph
func (this *Graph) Last(param cmodel.GraphLastParam, resp *cmodel.GraphLastResp) error {
	// statistics
	proc.GraphLastCnt.Incr()

	resp.Endpoint = param.Endpoint
	resp.Counter = param.Counter

	md5 := cutils.Md5(param.Endpoint + "/" + param.Counter)
	item := store.GetLastItem(md5)
	resp.Value = cmodel.NewRRDData(item.Timestamp, item.Value)
	return nil
}