mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Streaming: support streaming in MetricsPanelCtrl (#17034)
* support streaming in angular panels * keep the same dashboard number
This commit is contained in:
committed by
Torkel Ödegaard
parent
68ad93f410
commit
7333f7ca17
@@ -129,7 +129,9 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
if (data.state === LoadingState.Error) {
|
||||
this.loading = false;
|
||||
this.processDataError(data.error);
|
||||
} else if (data.state === LoadingState.Done) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
|
||||
// The result should already be processed, but just in case
|
||||
@@ -142,12 +144,21 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
});
|
||||
}
|
||||
|
||||
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",
|
||||
@@ -48,6 +54,97 @@
|
||||
"id": null,
|
||||
"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": "",
|
||||
@@ -55,7 +152,7 @@
|
||||
"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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user