From 3a81f75fb3062aa0708cf7a6ca07e0f1f575e88e Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 2 Aug 2024 16:25:59 +0800 Subject: [PATCH] fix cpu usage in resource-container-monitor --- .../resources-container-monitor/container/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go b/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go index 9d96a3251b8..049ccaca1c2 100644 --- a/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go +++ b/internal/apps/msp/apm/service/components/resources-container-monitor/container/provider.go @@ -60,7 +60,7 @@ func toQueryParams(instanceId string) map[string]*structpb.Value { } func (p *provider) getCpuLineGraph(ctx context.Context, startTime, endTime int64, instanceId string) ([]*model.LineGraphMetaData, error) { - statement := fmt.Sprintf("SELECT avg(cpu_usage_percent::field),tostring('usage rate') " + + statement := fmt.Sprintf("SELECT max(cpu_usage_percent::field),tostring('usage rate') " + "FROM docker_container_summary " + "WHERE pod_uid::tag=$pod_uid " + "GROUP BY time()")