mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudWatch: Improve method name, performance optimization (#28632)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
4ec60c7187
commit
00508295d1
@ -53,7 +53,7 @@ func (e *cloudWatchExecutor) transformRequestQueriesToCloudWatchQueries(requestQ
|
|||||||
return cloudwatchQueries, nil
|
return cloudwatchQueries, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *cloudWatchExecutor) transformQueryResponseToQueryResult(cloudwatchResponses []*cloudwatchResponse) map[string]*tsdb.QueryResult {
|
func (e *cloudWatchExecutor) transformQueryResponsesToQueryResult(cloudwatchResponses []*cloudwatchResponse) map[string]*tsdb.QueryResult {
|
||||||
responsesByRefID := make(map[string][]*cloudwatchResponse)
|
responsesByRefID := make(map[string][]*cloudwatchResponse)
|
||||||
refIDs := sort.StringSlice{}
|
refIDs := sort.StringSlice{}
|
||||||
for _, res := range cloudwatchResponses {
|
for _, res := range cloudwatchResponses {
|
||||||
|
@ -46,7 +46,7 @@ func (e *cloudWatchExecutor) parseResponse(metricDataOutputs []*cloudwatch.GetMe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cloudWatchResponses := make([]*cloudwatchResponse, 0)
|
cloudWatchResponses := make([]*cloudwatchResponse, 0, len(mdrs))
|
||||||
for id, lr := range mdrs {
|
for id, lr := range mdrs {
|
||||||
query := queries[id]
|
query := queries[id]
|
||||||
frames, partialData, err := parseMetricResults(lr, labels[id], query)
|
frames, partialData, err := parseMetricResults(lr, labels[id], query)
|
||||||
|
@ -97,7 +97,7 @@ func (e *cloudWatchExecutor) executeTimeSeriesQuery(ctx context.Context, queryCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
cloudwatchResponses = append(cloudwatchResponses, responses...)
|
cloudwatchResponses = append(cloudwatchResponses, responses...)
|
||||||
res := e.transformQueryResponseToQueryResult(cloudwatchResponses)
|
res := e.transformQueryResponsesToQueryResult(cloudwatchResponses)
|
||||||
for _, queryRes := range res {
|
for _, queryRes := range res {
|
||||||
resultChan <- queryRes
|
resultChan <- queryRes
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user