mirror of https://github.com/grafana/grafana
HeatmapNG: add log scale calculation (#49969)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>pull/50208/head
parent
219e848e73
commit
fd34700225
@ -0,0 +1,554 @@ |
||||
{ |
||||
"annotations": { |
||||
"list": [ |
||||
{ |
||||
"builtIn": 1, |
||||
"datasource": { |
||||
"type": "grafana", |
||||
"uid": "-- Grafana --" |
||||
}, |
||||
"enable": true, |
||||
"hide": true, |
||||
"iconColor": "rgba(0, 211, 255, 1)", |
||||
"name": "Annotations & Alerts", |
||||
"target": { |
||||
"limit": 100, |
||||
"matchAny": false, |
||||
"tags": [], |
||||
"type": "dashboard" |
||||
}, |
||||
"type": "dashboard" |
||||
} |
||||
] |
||||
}, |
||||
"editable": true, |
||||
"fiscalYearStartMonth": 0, |
||||
"graphTooltip": 0, |
||||
"links": [], |
||||
"liveNow": false, |
||||
"panels": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "points", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 2, |
||||
"scaleDistribution": { |
||||
"log": 2, |
||||
"type": "log" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green", |
||||
"value": null |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 14, |
||||
"w": 8, |
||||
"x": 0, |
||||
"y": 0 |
||||
}, |
||||
"id": 3, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom" |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single", |
||||
"sort": "none" |
||||
} |
||||
}, |
||||
"pluginVersion": "9.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "testdata", |
||||
"uid": "PD8C576611E62080A" |
||||
}, |
||||
"max": 500000, |
||||
"min": 0.01, |
||||
"refId": "A", |
||||
"scenarioId": "random_walk", |
||||
"seriesCount": 2, |
||||
"spread": 1000, |
||||
"startValue": 0.01 |
||||
} |
||||
], |
||||
"title": "Time series", |
||||
"type": "timeseries" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"custom": { |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
} |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 14, |
||||
"w": 8, |
||||
"x": 8, |
||||
"y": 0 |
||||
}, |
||||
"id": 6, |
||||
"options": { |
||||
"bucket": { |
||||
"layout": "auto" |
||||
}, |
||||
"calculate": true, |
||||
"calculation": { |
||||
"yBuckets": { |
||||
"scale": { |
||||
"log": 2, |
||||
"type": "log" |
||||
} |
||||
} |
||||
}, |
||||
"cellGap": 1, |
||||
"color": { |
||||
"exponent": 0.5, |
||||
"fill": "dark-orange", |
||||
"mode": "scheme", |
||||
"scale": "exponential", |
||||
"scheme": "Spectral", |
||||
"steps": 64 |
||||
}, |
||||
"exemplars": { |
||||
"color": "rgba(255,0,255,0.7)" |
||||
}, |
||||
"filterValues": { |
||||
"min": 1e-9 |
||||
}, |
||||
"legend": { |
||||
"show": true |
||||
}, |
||||
"mode": "calculate", |
||||
"tooltip": { |
||||
"show": true, |
||||
"yHistogram": false |
||||
}, |
||||
"yAxis": { |
||||
"axisPlacement": "left", |
||||
"reverse": false |
||||
}, |
||||
"yAxisLabels": "auto", |
||||
"yAxisReverse": false |
||||
}, |
||||
"pluginVersion": "9.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"panelId": 3, |
||||
"refId": "A" |
||||
} |
||||
], |
||||
"title": "log2", |
||||
"type": "heatmap-new" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"custom": { |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
} |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 14, |
||||
"w": 8, |
||||
"x": 16, |
||||
"y": 0 |
||||
}, |
||||
"id": 7, |
||||
"options": { |
||||
"bucket": { |
||||
"layout": "auto" |
||||
}, |
||||
"calculate": true, |
||||
"calculation": { |
||||
"yBuckets": { |
||||
"scale": { |
||||
"log": 2, |
||||
"type": "log" |
||||
}, |
||||
"value": "2" |
||||
} |
||||
}, |
||||
"cellGap": 1, |
||||
"color": { |
||||
"exponent": 0.5, |
||||
"fill": "dark-orange", |
||||
"mode": "scheme", |
||||
"scale": "exponential", |
||||
"scheme": "Spectral", |
||||
"steps": 64 |
||||
}, |
||||
"exemplars": { |
||||
"color": "rgba(255,0,255,0.7)" |
||||
}, |
||||
"filterValues": { |
||||
"min": 1e-9 |
||||
}, |
||||
"legend": { |
||||
"show": true |
||||
}, |
||||
"mode": "calculate", |
||||
"tooltip": { |
||||
"show": true, |
||||
"yHistogram": false |
||||
}, |
||||
"yAxis": { |
||||
"axisPlacement": "left", |
||||
"reverse": false |
||||
}, |
||||
"yAxisLabels": "auto", |
||||
"yAxisReverse": false |
||||
}, |
||||
"pluginVersion": "9.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"panelId": 3, |
||||
"refId": "A" |
||||
} |
||||
], |
||||
"title": "log2 split 2", |
||||
"type": "heatmap-new" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"custom": { |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
} |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 14, |
||||
"w": 8, |
||||
"x": 0, |
||||
"y": 14 |
||||
}, |
||||
"id": 4, |
||||
"options": { |
||||
"bucket": { |
||||
"layout": "auto" |
||||
}, |
||||
"calculate": true, |
||||
"cellGap": 1, |
||||
"color": { |
||||
"exponent": 0.5, |
||||
"fill": "dark-orange", |
||||
"mode": "scheme", |
||||
"scale": "exponential", |
||||
"scheme": "Spectral", |
||||
"steps": 64 |
||||
}, |
||||
"exemplars": { |
||||
"color": "rgba(255,0,255,0.7)" |
||||
}, |
||||
"filterValues": { |
||||
"min": 1e-9 |
||||
}, |
||||
"legend": { |
||||
"show": true |
||||
}, |
||||
"mode": "calculate", |
||||
"tooltip": { |
||||
"show": true, |
||||
"yHistogram": false |
||||
}, |
||||
"yAxis": { |
||||
"axisPlacement": "left", |
||||
"reverse": false |
||||
}, |
||||
"yAxisLabels": "auto", |
||||
"yAxisReverse": false |
||||
}, |
||||
"pluginVersion": "9.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"panelId": 3, |
||||
"refId": "A" |
||||
} |
||||
], |
||||
"title": "linear", |
||||
"type": "heatmap-new" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"custom": { |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
} |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 14, |
||||
"w": 8, |
||||
"x": 8, |
||||
"y": 14 |
||||
}, |
||||
"id": 5, |
||||
"options": { |
||||
"bucket": { |
||||
"layout": "auto" |
||||
}, |
||||
"calculate": true, |
||||
"calculation": { |
||||
"yBuckets": { |
||||
"scale": { |
||||
"log": 10, |
||||
"type": "log" |
||||
} |
||||
} |
||||
}, |
||||
"cellGap": 1, |
||||
"color": { |
||||
"exponent": 0.5, |
||||
"fill": "dark-orange", |
||||
"mode": "scheme", |
||||
"scale": "exponential", |
||||
"scheme": "Spectral", |
||||
"steps": 64 |
||||
}, |
||||
"exemplars": { |
||||
"color": "rgba(255,0,255,0.7)" |
||||
}, |
||||
"filterValues": { |
||||
"min": 1e-9 |
||||
}, |
||||
"legend": { |
||||
"show": true |
||||
}, |
||||
"mode": "calculate", |
||||
"tooltip": { |
||||
"show": true, |
||||
"yHistogram": false |
||||
}, |
||||
"yAxis": { |
||||
"axisPlacement": "left", |
||||
"reverse": false |
||||
}, |
||||
"yAxisLabels": "auto", |
||||
"yAxisReverse": false |
||||
}, |
||||
"pluginVersion": "9.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"panelId": 3, |
||||
"refId": "A" |
||||
} |
||||
], |
||||
"title": "log10", |
||||
"type": "heatmap-new" |
||||
}, |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"custom": { |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
} |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 14, |
||||
"w": 8, |
||||
"x": 16, |
||||
"y": 14 |
||||
}, |
||||
"id": 8, |
||||
"options": { |
||||
"bucket": { |
||||
"layout": "auto" |
||||
}, |
||||
"calculate": true, |
||||
"calculation": { |
||||
"yBuckets": { |
||||
"scale": { |
||||
"log": 10, |
||||
"type": "log" |
||||
}, |
||||
"value": "2" |
||||
} |
||||
}, |
||||
"cellGap": 1, |
||||
"color": { |
||||
"exponent": 0.5, |
||||
"fill": "dark-orange", |
||||
"mode": "scheme", |
||||
"scale": "exponential", |
||||
"scheme": "Spectral", |
||||
"steps": 64 |
||||
}, |
||||
"exemplars": { |
||||
"color": "rgba(255,0,255,0.7)" |
||||
}, |
||||
"filterValues": { |
||||
"min": 1e-9 |
||||
}, |
||||
"legend": { |
||||
"show": true |
||||
}, |
||||
"mode": "calculate", |
||||
"tooltip": { |
||||
"show": true, |
||||
"yHistogram": false |
||||
}, |
||||
"yAxis": { |
||||
"axisPlacement": "left", |
||||
"reverse": false |
||||
}, |
||||
"yAxisLabels": "auto", |
||||
"yAxisReverse": false |
||||
}, |
||||
"pluginVersion": "9.0.0-pre", |
||||
"targets": [ |
||||
{ |
||||
"datasource": { |
||||
"type": "datasource", |
||||
"uid": "-- Dashboard --" |
||||
}, |
||||
"panelId": 3, |
||||
"refId": "A" |
||||
} |
||||
], |
||||
"title": "log10 split 2", |
||||
"type": "heatmap-new" |
||||
} |
||||
], |
||||
"schemaVersion": 36, |
||||
"style": "dark", |
||||
"tags": ["gdev", "panel-tests", "graph-ng"], |
||||
"templating": { |
||||
"list": [] |
||||
}, |
||||
"time": { |
||||
"from": "now-6h", |
||||
"to": "now" |
||||
}, |
||||
"timepicker": {}, |
||||
"timezone": "", |
||||
"title": "Heatmap calculate (log)", |
||||
"uid": "ZXYQTA97ZZ", |
||||
"version": 4, |
||||
"weekStart": "" |
||||
} |
@ -1,18 +1,24 @@ |
||||
import { DataFrameType } from '@grafana/data'; |
||||
import { ScaleDistributionConfig } from '@grafana/schema'; |
||||
|
||||
export enum HeatmapCalculationMode { |
||||
Size = 'size', |
||||
Size = 'size', // When exponential, this is "splitFactor"
|
||||
Count = 'count', |
||||
} |
||||
|
||||
export interface HeatmapCalculationAxisConfig { |
||||
export const enum HeatmapBucketLayout { |
||||
le = 'le', |
||||
ge = 'ge', |
||||
unknown = 'unknown', // unknown
|
||||
auto = 'auto', // becomes unknown
|
||||
} |
||||
|
||||
export interface HeatmapCalculationBucketConfig { |
||||
mode?: HeatmapCalculationMode; |
||||
value?: string; // number or interval string ie 10s
|
||||
value?: string; // number or interval string ie 10s, or log "split" divisor
|
||||
scale?: ScaleDistributionConfig; |
||||
} |
||||
|
||||
export interface HeatmapCalculationOptions { |
||||
xAxis?: HeatmapCalculationAxisConfig; |
||||
yAxis?: HeatmapCalculationAxisConfig; |
||||
xAxisField?: string; // name of the x field
|
||||
encoding?: DataFrameType.HeatmapBuckets | DataFrameType.HeatmapScanlines; |
||||
xBuckets?: HeatmapCalculationBucketConfig; |
||||
yBuckets?: HeatmapCalculationBucketConfig; |
||||
} |
||||
|
Loading…
Reference in new issue