mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 21:05:54 +08:00
fix: ordering of ts and table panel (#3163)
* fix: ordering of ts and table panel * chore: refactor
This commit is contained in:
parent
50142321f7
commit
49afc2549f
@ -4161,7 +4161,7 @@ func readRowsForTimeSeriesResult(rows driver.Rows, vars []interface{}, columnNam
|
|||||||
// ("order", "/fetch/{Id}")
|
// ("order", "/fetch/{Id}")
|
||||||
// ("order", "/order")
|
// ("order", "/order")
|
||||||
seriesToPoints := make(map[string][]v3.Point)
|
seriesToPoints := make(map[string][]v3.Point)
|
||||||
|
var keys []string
|
||||||
// seriesToAttrs is a mapping of key to a map of attribute key to attribute value
|
// seriesToAttrs is a mapping of key to a map of attribute key to attribute value
|
||||||
// for each series. This is used to populate the series' attributes
|
// for each series. This is used to populate the series' attributes
|
||||||
// For instance, for the above example, the seriesToAttrs will be
|
// For instance, for the above example, the seriesToAttrs will be
|
||||||
@ -4182,12 +4182,15 @@ func readRowsForTimeSeriesResult(rows driver.Rows, vars []interface{}, columnNam
|
|||||||
groupBy, groupAttributes, metricPoint := readRow(vars, columnNames)
|
groupBy, groupAttributes, metricPoint := readRow(vars, columnNames)
|
||||||
sort.Strings(groupBy)
|
sort.Strings(groupBy)
|
||||||
key := strings.Join(groupBy, "")
|
key := strings.Join(groupBy, "")
|
||||||
|
if _, exists := seriesToAttrs[key]; !exists {
|
||||||
|
keys = append(keys, key)
|
||||||
|
}
|
||||||
seriesToAttrs[key] = groupAttributes
|
seriesToAttrs[key] = groupAttributes
|
||||||
seriesToPoints[key] = append(seriesToPoints[key], metricPoint)
|
seriesToPoints[key] = append(seriesToPoints[key], metricPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
var seriesList []*v3.Series
|
var seriesList []*v3.Series
|
||||||
for key := range seriesToPoints {
|
for _, key := range keys {
|
||||||
points := seriesToPoints[key]
|
points := seriesToPoints[key]
|
||||||
|
|
||||||
// find the grouping sets point for the series
|
// find the grouping sets point for the series
|
||||||
|
Loading…
x
Reference in New Issue
Block a user