From 44ec48c6da17e6398ea2595bedc4fd74c344c61f Mon Sep 17 00:00:00 2001 From: Heiru Wu Date: Mon, 18 Sep 2023 14:07:42 +0800 Subject: [PATCH] chore(metric): fix mistype record value --- pkg/repository/influx.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/repository/influx.go b/pkg/repository/influx.go index dbd214c..1d927bb 100644 --- a/pkg/repository/influx.go +++ b/pkg/repository/influx.go @@ -381,11 +381,11 @@ func (i *influxDB) QueryPipelineTriggerTableRecords(ctx context.Context, owner s if v, match := result.Record().ValueByKey(constant.PipelineReleaseUID).(string); match { tableRecord.PipelineReleaseUid = v } - if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_COMPLETED.String()).(int32); match { - tableRecord.TriggerCountCompleted = v + if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_COMPLETED.String()).(int64); match { + tableRecord.TriggerCountCompleted = int32(v) } - if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_ERRORED.String()).(int32); match { - tableRecord.TriggerCountErrored = v + if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_ERRORED.String()).(int64); match { + tableRecord.TriggerCountErrored = int32(v) } records = append(records, tableRecord) @@ -545,8 +545,8 @@ func (i *influxDB) QueryPipelineTriggerChartRecords(ctx context.Context, owner s if v, match := result.Record().ValueByKey("_time").(time.Time); match { chartRecord.TimeBuckets = append(chartRecord.TimeBuckets, timestamppb.New(v)) } - if v, match := result.Record().ValueByKey(constant.TriggerTime).(int32); match { - chartRecord.TriggerCounts = append(chartRecord.TriggerCounts, v) + if v, match := result.Record().ValueByKey(constant.TriggerTime).(int64); match { + chartRecord.TriggerCounts = append(chartRecord.TriggerCounts, int32(v)) } if v, match := result.Record().ValueByKey(constant.ComputeTimeDuration).(float64); match { chartRecord.ComputeTimeDuration = append(chartRecord.ComputeTimeDuration, float32(v)) @@ -785,11 +785,11 @@ func (i *influxDB) QueryConnectorExecuteTableRecords(ctx context.Context, owner if v, match := result.Record().ValueByKey(constant.ConnectorUID).(string); match { tableRecord.ConnectorUid = v } - if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_COMPLETED.String()).(int32); match { - tableRecord.ExecuteCountCompleted = v + if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_COMPLETED.String()).(int64); match { + tableRecord.ExecuteCountCompleted = int32(v) } - if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_ERRORED.String()).(int32); match { - tableRecord.ExecuteCountErrored = v + if v, match := result.Record().ValueByKey(mgmtPB.Status_STATUS_ERRORED.String()).(int64); match { + tableRecord.ExecuteCountErrored = int32(v) } records = append(records, tableRecord) @@ -946,8 +946,8 @@ func (i *influxDB) QueryConnectorExecuteChartRecords(ctx context.Context, owner if v, match := result.Record().ValueByKey("_time").(time.Time); match { chartRecord.TimeBuckets = append(chartRecord.TimeBuckets, timestamppb.New(v)) } - if v, match := result.Record().ValueByKey(constant.Executetime).(int32); match { - chartRecord.ExecuteCounts = append(chartRecord.ExecuteCounts, v) + if v, match := result.Record().ValueByKey(constant.Executetime).(int64); match { + chartRecord.ExecuteCounts = append(chartRecord.ExecuteCounts, int32(v)) } if v, match := result.Record().ValueByKey(constant.ComputeTimeDuration).(float64); match { chartRecord.ComputeTimeDuration = append(chartRecord.ComputeTimeDuration, float32(v))