(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem, val *MonMessageTrend)
| 216 | } |
| 217 | |
| 218 | func (i *imlMonitorStatisticsCacheService) SetMessageTrend(ctx context.Context, partitionId string, start, end time.Time, wheres []MonWhereItem, val *MonMessageTrend) error { |
| 219 | key := fmt.Sprintf("monitor:message_trend:%s:%d_%d:%s", partitionId, start.Unix(), end.Unix(), formatWhereKey(wheres)) |
| 220 | |
| 221 | bytes, err := json.Marshal(val) |
| 222 | if err != nil { |
| 223 | log.Errorf("SetMessageTrend json.Marshal key=%s val=%v err=%s", key, val, err.Error()) |
| 224 | return err |
| 225 | } |
| 226 | |
| 227 | return i.commonCache.Set(ctx, key, bytes, 5*time.Minute) |
| 228 | } |
| 229 | |
| 230 | func formatWhereKey(wheres []MonWhereItem) string { |
| 231 |
nothing calls this directly
no test coverage detected