mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
fix monitor bug
This commit is contained in:
@@ -29,6 +29,8 @@ func FmtIntFromInterface(val interface{}) int64 {
|
||||
return int64(ret)
|
||||
case int:
|
||||
return int64(ret)
|
||||
case float64:
|
||||
return int64(ret)
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ func (e *executor) aggregateSummary(ctx context.Context, start time.Time, end ti
|
||||
a.Avg = int64(v.(float64))
|
||||
}
|
||||
if v, ok := maxRes[field+"_max"]; ok {
|
||||
a.Min = v.(int64)
|
||||
a.Max = v.(int64)
|
||||
}
|
||||
if v, ok := minRes[field+"_min"]; ok {
|
||||
a.Min = v.(int64)
|
||||
|
||||
@@ -159,8 +159,7 @@ func (f *fluxQuery) CommonTendency(ctx context.Context, queryApi api.QueryAPI, s
|
||||
resultMap[field] = append(resultMap[field], common.FmtIntFromInterface(res[field]))
|
||||
}
|
||||
t, _ := res["_time"].(time.Time)
|
||||
|
||||
dates = append(dates, t)
|
||||
dates = append(dates, t.In(time.Local))
|
||||
}
|
||||
|
||||
return dates, resultMap, nil
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
or
|
||||
r._field == "timing" or r._field == "request" or r._field == "response" or r._field
|
||||
==
|
||||
"retry",
|
||||
"retry"
|
||||
or r._field == "total_token" or r._field == "input_token" or r._field == "output_token",
|
||||
)
|
||||
|> group(
|
||||
columns: [
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
or
|
||||
r._field == "timing" or r._field == "request" or r._field == "response" or r._field
|
||||
==
|
||||
"retry",
|
||||
"retry"
|
||||
or r._field == "total_token" or r._field == "input_token" or r._field == "output_token",
|
||||
)
|
||||
|> group(
|
||||
columns: [
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
or
|
||||
r._field == "timing" or r._field == "request" or r._field == "response" or r._field
|
||||
==
|
||||
"retry",
|
||||
"retry"
|
||||
or r._field == "total_token" or r._field == "input_token" or r._field == "output_token",
|
||||
)
|
||||
|> group(
|
||||
columns: [
|
||||
|
||||
Reference in New Issue
Block a user