mirror of
https://github.com/grafana/grafana.git
synced 2025-09-29 02:34:02 +08:00
SSE: DSNode to update result with names to make each value identifiable by labels (only Graphite and TestData) (#71246)
* introduce a function checkIfSeriesNeedToBeFixed to scan all value fields in the response and provide a function that updates Series so they can be uniquely identifiable. Only Graphite and TestData are checked. * update `convertDataFramesToResults` to run this function and provide it to WideToMany * update WideToMany to run the fix function if it is not nil
This commit is contained in:
@ -26,7 +26,7 @@ import (
|
||||
func TestService(t *testing.T) {
|
||||
dsDF := data.NewFrame("test",
|
||||
data.NewField("time", nil, []time.Time{time.Unix(1, 0)}),
|
||||
data.NewField("value", nil, []*float64{fp(2)}))
|
||||
data.NewField("value", data.Labels{"test": "label"}, []*float64{fp(2)}))
|
||||
|
||||
me := &mockEndpoint{
|
||||
Frames: []*data.Frame{dsDF},
|
||||
@ -78,7 +78,7 @@ func TestService(t *testing.T) {
|
||||
|
||||
bDF := data.NewFrame("",
|
||||
data.NewField("Time", nil, []time.Time{time.Unix(1, 0)}),
|
||||
data.NewField("B", nil, []*float64{fp(4)}))
|
||||
data.NewField("B", data.Labels{"test": "label"}, []*float64{fp(4)}))
|
||||
bDF.RefID = "B"
|
||||
bDF.SetMeta(&data.FrameMeta{
|
||||
Type: data.FrameTypeTimeSeriesMulti,
|
||||
|
Reference in New Issue
Block a user