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 }
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 }