(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem, value *MonInvokeCountTrend)
| 185 | } |
| 186 | |
| 187 | func (i *imlMonitorStatisticsCacheService) SetTrendCache(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem, value *MonInvokeCountTrend) error { |
| 188 | key := fmt.Sprintf("monitor:trend:%s:%d_%d:%s", partitionId, start.Unix(), end.Unix(), formatWhereKey(wheres)) |
| 189 | |
| 190 | bytes, err := json.Marshal(value) |
| 191 | if err != nil { |
| 192 | log.Errorf("SetTrendCache json.Marshal key=%s val=%v err=%s", key, value, err.Error()) |
| 193 | return err |
| 194 | } |
| 195 | |
| 196 | return i.commonCache.Set(ctx, key, bytes, 5*time.Minute) |
| 197 | } |
| 198 | |
| 199 | func (i *imlMonitorStatisticsCacheService) GetMessageTrend(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem) (*MonMessageTrend, error) { |
| 200 | key := fmt.Sprintf("monitor:message_trend:%s:%d_%d:%s", partitionId, start.Unix(), end.Unix(), formatWhereKey(wheres)) |
nothing calls this directly
no test coverage detected