File tree 2 files changed +6
-1
lines changed
internal/tools/monitor/core/metric/query/es-tsql/influxql
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,11 @@ var CkAggFunctions = map[string]*SQlAggFuncDefine{
210
210
}
211
211
seconds := float64 (ctx .interval * int64 (ctx .targetTimeUnit )) / float64 (tsql .Second )
212
212
nextValue := nextV [id ].(float64 )
213
+ // diffps return value should not be negative
214
+ // erda issue: https://erda.cloud/erda/dop/projects/387/issues/all?id=581160&iterationID=12783&tab=BUG&type=BUG
215
+ if nextValue < currentV {
216
+ return 0 , true
217
+ }
213
218
return (nextValue - currentV ) / seconds , true
214
219
}
215
220
}
Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ func TestAggregationHandlerFunction(t *testing.T) {
283
283
nextRow : map [string ]interface {}{
284
284
"0e4b5b1082a11703" : float64 (111 ),
285
285
},
286
- want : ( 111.0 - 222.0 ) / 60. 0 ,
286
+ want : 0 ,
287
287
},
288
288
289
289
{
You can’t perform that action at this time.
0 commit comments