Commit 7333f7ca by Ryan McKinley Committed by Torkel Ödegaard

Streaming: support streaming in MetricsPanelCtrl (#17034)

* support streaming in angular panels

* keep the same dashboard number
parent 68ad93f4
......@@ -129,25 +129,36 @@ class MetricsPanelCtrl extends PanelCtrl {
if (data.state === LoadingState.Error) {
this.loading = false;
this.processDataError(data.error);
} else if (data.state === LoadingState.Done) {
this.loading = false;
return;
}
// The result should already be processed, but just in case
if (!data.legacy) {
data.legacy = data.series.map(v => {
if (isSeriesData(v)) {
return toLegacyResponseData(v);
}
return v;
});
}
this.loading = false;
// Make the results look like they came directly from a <6.2 datasource request
// NOTE: any object other than 'data' is no longer supported supported
this.handleQueryResult({
data: data.legacy,
// The result should already be processed, but just in case
if (!data.legacy) {
data.legacy = data.series.map(v => {
if (isSeriesData(v)) {
return toLegacyResponseData(v);
}
return v;
});
}
if (data.request) {
const { range, timeInfo } = data.request;
if (range) {
this.range = range;
}
if (timeInfo) {
this.timeInfo = timeInfo;
}
}
// Make the results look like they came directly from a <6.2 datasource request
// NOTE: any object other than 'data' is no longer supported supported
this.handleQueryResult({
data: data.legacy,
});
},
};
......
......@@ -14,7 +14,13 @@
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.2.0-pre"
"version": "6.3.0-pre"
},
{
"type": "panel",
"id": "graph",
"name": "Graph",
"version": ""
},
{
"type": "panel",
......@@ -49,13 +55,104 @@
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"fill": 1,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 0
},
"id": 4,
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"refId": "A",
"scenarioId": "streaming_client",
"stream": {
"noise": 2.2,
"speed": 100,
"spread": 3.5,
"type": "signal"
},
"stringInput": ""
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Angular Graph",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 2,
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"datasource": "${DS_TESTDATA_DB}",
"description": "",
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 0
"y": 7
},
"id": 2,
"links": [],
......@@ -110,5 +207,5 @@
"timezone": "",
"title": "Simple Streaming Example",
"uid": "TXSTREZ",
"version": 2
"version": 3
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment