(ts []*tempopb.TimeSeries)
| 1258 | } |
| 1259 | |
| 1260 | func sortTimeSeries(ts []*tempopb.TimeSeries) { |
| 1261 | sort.Slice(ts, func(i, j int) bool { |
| 1262 | if len(ts[i].Labels) != len(ts[j].Labels) { |
| 1263 | return len(ts[i].Labels) < len(ts[j].Labels) |
| 1264 | } |
| 1265 | |
| 1266 | for l := range ts[i].Labels { |
| 1267 | if ts[i].Labels[l].Key != ts[j].Labels[l].Key { |
| 1268 | return ts[i].Labels[l].Key < ts[j].Labels[l].Key |
| 1269 | } |
| 1270 | if ts[i].Labels[l].Value != ts[j].Labels[l].Value { |
| 1271 | return ts[i].Labels[l].Value.String() < ts[j].Labels[l].Value.String() |
| 1272 | } |
| 1273 | } |
| 1274 | |
| 1275 | // All equal |
| 1276 | return false |
| 1277 | }) |
| 1278 | } |
| 1279 | |
| 1280 | var floatComparer = cmp.Comparer(func(x, y float64) bool { |
| 1281 | return math.Abs(x-y) < 1e-6 |
no test coverage detected