diff --git a/nasdaq/comparison.compose.yml b/nasdaq/comparison.compose.yml index 47db460..a34fb2f 100644 --- a/nasdaq/comparison.compose.yml +++ b/nasdaq/comparison.compose.yml @@ -35,7 +35,7 @@ services: timeout: 5s retries: 10 grafana: - image: grafana/grafana:12.0.0 + image: grafana/grafana:13.1.0-25410206825 restart: unless-stopped environment: GRAFANA_USER: ${GRAFANA_USER} diff --git a/nasdaq/compose.yml b/nasdaq/compose.yml index 1e98786..fdd42e9 100644 --- a/nasdaq/compose.yml +++ b/nasdaq/compose.yml @@ -22,7 +22,7 @@ services: timeout: 1s retries: 10 grafana: - image: grafana/grafana:12.0.0 + image: grafana/grafana:13.1.0-25410206825 container_name: grafana restart: unless-stopped environment: diff --git a/nasdaq/demo.sh b/nasdaq/demo.sh index e20d880..f25fd9b 100755 --- a/nasdaq/demo.sh +++ b/nasdaq/demo.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail usage() { cat <<'EOF' -Usage: ./demo.sh [--comparison|-c] +Usage: ./demo.sh [--comparison|-c] Normal mode starts CedarDB, Nasdaq client, Grafana and the AI chat for the demo. Comparison mode adds PostgreSQL to the deployment to compare the performance of the two DBs. @@ -12,6 +12,7 @@ Commands: start Start the demo stack stop Stop the demo stack clean Stop the demo stack and remove volumes + pull Pull the latest images for the demo stack Options: -c, --comparison Use comparison.compose.yml @@ -31,9 +32,9 @@ while (($# > 0)); do usage exit 0 ;; - start|stop|clean) + start|stop|clean|pull) if [[ -n "$command" ]]; then - echo "Only one command is allowed: start, stop, or clean." >&2 + echo "Only one command is allowed: start, stop, clean, or pull." >&2 usage >&2 exit 1 fi @@ -49,7 +50,7 @@ while (($# > 0)); do done if [[ -z "$command" ]]; then - echo "Missing command: start, stop, or clean." >&2 + echo "Missing command: start, stop, clean, or pull." >&2 usage >&2 exit 1 fi @@ -75,7 +76,7 @@ case "$command" in export GRAFANA_USER="postgres" export GRAFANA_USER_PWD="${ADMIN_PWD}" fi - docker compose "${compose_args[@]}" up -d --build --force-recreate + docker compose "${compose_args[@]}" up -d --build --force-recreate --remove-orphans ;; stop) docker compose "${compose_args[@]}" down @@ -83,4 +84,7 @@ case "$command" in clean) docker compose "${compose_args[@]}" down -v ;; + pull) + docker compose "${compose_args[@]}" pull --ignore-buildable + ;; esac diff --git a/nasdaq/grafana/dashboards/NASDAQ-1732292249298.json b/nasdaq/grafana/dashboards/NASDAQ-1732292249298.json index a1fbac4..2c8ec77 100644 --- a/nasdaq/grafana/dashboards/NASDAQ-1732292249298.json +++ b/nasdaq/grafana/dashboards/NASDAQ-1732292249298.json @@ -1,1194 +1,1514 @@ { - "__inputs": [ - { - "name": "DS_CEDAR", - "label": "cedar", - "description": "", - "type": "datasource", - "pluginId": "grafana-postgresql-datasource", - "pluginName": "PostgreSQL" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "panel", - "id": "barchart", - "name": "Bar chart", - "version": "" - }, - { - "type": "panel", - "id": "candlestick", - "name": "Candlestick", - "version": "" - }, - { - "type": "panel", - "id": "gauge", - "name": "Gauge", - "version": "" - }, - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.3.1" - }, - { - "type": "datasource", - "id": "grafana-postgresql-datasource", - "name": "PostgreSQL", - "version": "1.0.0" + "apiVersion": "dashboard.grafana.app/v2", + "kind": "Dashboard", + "metadata": { + "name": "edll9t2tw29dsc", + "namespace": "default", + "uid": "2483d659-e75f-4446-a846-960e947f0f6f", + "resourceVersion": "1778062105869019", + "generation": 1, + "creationTimestamp": "2026-05-06T10:01:04Z", + "labels": { + "grafana.app/deprecatedInternalID": "2827630157094912" }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - }, - { - "type": "panel", - "id": "trend", - "name": "Trend", - "version": "" + "annotations": { + "grafana.app/createdBy": "access-policy:service", + "grafana.app/folder": "", + "grafana.app/managedBy": "classic-file-provisioning", + "grafana.app/managerAllowsEdits": "true", + "grafana.app/managerId": "cedar", + "grafana.app/saved-from-ui": "Grafana v13.1.0-25410206825 (1a416ef1)", + "grafana.app/sourceChecksum": "187b990afde845b5e22df74183cb0215", + "grafana.app/sourcePath": "/etc/grafana/provisioning/dashboards/NASDAQ-1732292249298.json", + "grafana.app/sourceTimestamp": "1777977161000", + "grafana.app/updatedBy": "anonymous:0", + "grafana.app/updatedTimestamp": "2026-05-06T10:08:25Z" } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": null, - "links": [], - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepBefore", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "spec": { + "annotations": [ + { + "kind": "AnnotationQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana", + "version": "v0", + "datasource": { + "name": "-- Grafana --" }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "spec": {} }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "price" - }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "builtIn": true + } + } + ], + "cursorSync": "Off", + "editable": true, + "elements": { + "panel-1": { + "kind": "Panel", + "spec": { + "id": 1, + "title": "Executed Orders", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select s.name, count(*) from executions e, stocks s \r\nwhere e.stockId = s.stockId \r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\ngroup by s.name order by count desc limit 10;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ] + } }, - { - "matcher": { - "id": "byName", - "options": "sum" - }, - "properties": [ - { - "id": "decimals", - "value": 0 + "vizConfig": { + "kind": "VizConfig", + "group": "barchart", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "barRadius": 0, + "barWidth": 0.72, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": false + }, + "orientation": "horizontal", + "showValue": "never", + "stacking": "none", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "fieldConfig": { + "defaults": { + "unit": "short", + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": 0, + "color": "green" + } + ] + }, + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "line" + } + }, + "fieldMinMax": false + }, + "overrides": [] } - ] + } } - ] - }, - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 0 - }, - "hideTimeOverride": true, - "id": 21, - "interval": "100ms", - "maxPerRow": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "mode": "single", - "sort": "none" } }, - "pluginVersion": "11.3.1", - "repeat": "stock", - "repeatDirection": "h", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "with orderdepth as ( \r\n select price, side, sum(quantity) as quantity\r\n from orderbook o, stocks s \r\n where o.stockId = s.stockId\r\n and s.name in (${stock})\r\n group by price, side\r\n),\r\ncumulative_sell as (\r\n select price, side as metric, sum(quantity) over (order by price asc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'SELL'\r\n),\r\ncumulative_buy as (\r\n select price, side as metric, sum(quantity) over (order by price desc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'BUY'\r\n),\r\ncumulative as (\r\n select * from cumulative_sell where sum > 0 and price < ${width} * (select min(price) from cumulative_sell)\r\n union all\r\n select * from cumulative_buy where sum > 0 and price > 1::numeric/${width} * (select max(price) from cumulative_buy)\r\n)\r\nselect * from cumulative order by price asc;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" + "panel-10": { + "kind": "Panel", + "spec": { + "id": 10, + "title": "Canceled", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as canceled\r\nfrom cancellations c \r\nwhere c.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ], - "groupBy": [ - { - "property": { - "type": "string" + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false }, - "type": "groupBy" + "endpointMarker": "point", + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto", + "sparkline": false, + "textMode": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 10000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": true + }, + "overrides": [] } - ], - "limit": 50 + } } } - ], - "timeShift": "${timeOffset}s", - "title": "Order book depth for ${stock}", - "type": "trend" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "panel-13": { + "kind": "Panel", + "spec": { + "id": 13, + "title": "100 biggest trades in current time range", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select EXTRACT(EPOCH FROM current_date + (e.timestamp/(1000*1000) * interval '1 millisecond')) as time, s.name, o.side, e.quantity, coalesce(e.price, o.price) as price, e.quantity * coalesce(e.price, o.price) as volume \r\nfrom executions e, stocks s, orders o \r\nwhere e.orderid = o.orderid and o.stockid = s.stockid\r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\norder by volume desc\r\nlimit 100;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true + } } }, - "decimals": 4, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null + "vizConfig": { + "kind": "VizConfig", + "group": "table", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "cellHeight": "sm", + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "volume" + } + ] }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "volume" - }, - "properties": [ - { - "id": "decimals" + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "BUY": { + "text": "BUY", + "color": "green", + "index": 1 + }, + "SELL": { + "text": "SELL", + "color": "red", + "index": 0 + } + } + } + ], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 50, + "color": "#EAB839" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "fixed" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "footer": { + "reducers": [] + }, + "inspect": false + }, + "fieldMinMax": true + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "price" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + }, + { + "id": "decimals", + "value": 4 + }, + { + "id": "custom.width", + "value": 91 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "side" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + }, + { + "id": "custom.width", + "value": 73 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "basic", + "type": "gauge", + "valueDisplayMode": "color" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "time" + }, + "properties": [ + { + "id": "custom.width", + "value": 165 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 90 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "quantity" + }, + "properties": [ + { + "id": "custom.width", + "value": 75 + } + ] + } + ] } - ] + } } - ] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 6 - }, - "hideTimeOverride": true, - "id": 32, - "interval": "1s", - "maxPerRow": 6, - "options": { - "candleStyle": "candles", - "colorStrategy": "open-close", - "colors": { - "down": "red", - "up": "green" - }, - "includeAllFields": false, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "mode": "candles+volume", - "tooltip": { - "mode": "multi", - "sort": "none" } }, - "pluginVersion": "11.3.1", - "repeat": "stock", - "repeatDirection": "h", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "with limits as (\r\n select 34200000000000::bigint as start, -- from 9:30 AM, start of trading day\r\n (${__to:date:seconds} - extract(epoch from current_date))::bigint * 1000 * 1000 * 1000 as end, -- to current point in time\r\n ${bins}::bigint * 1000 * 1000 as step\r\n), bins as (\r\n -- we always generate the bins from the start of the trading day so they are stable\r\n select generate_series(l.start ,l.end, l.step) as time\r\n from limits l \r\n),\r\nprices as (\r\n --for any order of a given stock executed within the relevant time span, find the price\r\n select \r\n e.timestamp as time, s.name as metric, \r\n -- if the execution itself has a price, it takes precedence\r\n max(coalesce(e.price, o.price)) as value,\r\n max(coalesce(e.price, o.price) * e.quantity) as volume\r\nfrom executions e, stocks s, orders o, limits l\r\n where e.orderid = o.orderid\r\nand o.stockid = s.stockid \r\nand s.name in (${stock})\r\n and e.timestamp >= l.start\r\n and e.timestamp < l.end\r\n group by e.timestamp, s.name\r\n),\r\nbinned as (\r\n select \r\nextract(epoch from current_date + (b.time/(1000*1000) * interval '1 millisecond')) as time,\r\np.metric, \r\nfirst_value(p.value) over w as open,\r\nlast_value(p.value) over w as close,\r\nmax(p.value) over w as high,\r\nmin(p.value) over w as low,\r\nsum(p.volume) over w as volume,\r\nrow_number() over w as rn\r\n from prices p, bins b, limits l\r\n --assign each event into its bin\r\n where p.time >= b.time and p.time < b.time + l.step\r\n --for each bin, find the candlestick parameters with a window function\r\n window w as (partition by b.time, p.metric order by p.time asc rows between unbounded preceding and unbounded following)\r\n)\r\nselect metric, time, open, close, high, low, volume \r\nfrom binned b\r\nwhere rn = 1\r\norder by time asc;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" + "panel-17": { + "kind": "Panel", + "spec": { + "id": 17, + "title": "Updated", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is not null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ], - "groupBy": [ - { - "property": { - "type": "string" + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "type": "groupBy" + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto", + "sparkline": false, + "textMode": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 5000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false + }, + "overrides": [] } - ], - "limit": 50 + } } } - ], - "timeShift": "${timeOffset}s", - "title": "${stock}", - "type": "candlestick" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "fixed" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false + "panel-21": { + "kind": "Panel", + "spec": { + "id": 21, + "title": "Order book depth for ${stock}", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "with orderdepth as ( \r\n select price, side, sum(quantity) as quantity\r\n from orderbook o, stocks s \r\n where o.stockId = s.stockId\r\n and s.name in ('${stock}')\r\n group by price, side\r\n),\r\ncumulative_sell as (\r\n select price, side as metric, sum(quantity) over (order by price asc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'SELL'\r\n),\r\ncumulative_buy as (\r\n select price, side as metric, sum(quantity) over (order by price desc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'BUY'\r\n),\r\ncumulative as (\r\n select * from cumulative_sell where sum > 0 and price < ${width} * (select min(price) from cumulative_sell)\r\n union all\r\n select * from cumulative_buy where sum > 0 and price > 1::numeric/${width} * (select max(price) from cumulative_buy)\r\n)\r\nselect * from cumulative order by price asc;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "100ms", + "hideTimeOverride": true + } + } }, - "fieldMinMax": true, - "mappings": [ - { + "vizConfig": { + "kind": "VizConfig", + "group": "trend", + "version": "13.1.0-25410206825", + "spec": { "options": { - "BUY": { - "color": "green", - "index": 1, - "text": "BUY" + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false }, - "SELL": { - "color": "red", - "index": 0, - "text": "SELL" + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" } }, - "type": "value" - } - ], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "red", - "value": 80 + "fieldConfig": { + "defaults": { + "unit": "none", + "decimals": 2, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "stepBefore", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "price" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "sum" + }, + "properties": [ + { + "id": "decimals", + "value": 0 + } + ] + } + ] } - ] + } } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "price" - }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" - }, - { - "id": "decimals", - "value": 4 - }, - { - "id": "custom.width", - "value": 91 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "volume" - }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "side" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" + } + }, + "panel-32": { + "kind": "Panel", + "spec": { + "id": 32, + "title": "${stock}", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "time_series", + "rawQuery": true, + "rawSql": "with limits as (\r\n select 34200000000000::bigint as start, -- from 9:30 AM, start of trading day\r\n (${__to:date:seconds} - extract(epoch from current_date))::bigint * 1000 * 1000 * 1000 as end, -- to current point in time\r\n ${bins}::bigint * 1000 * 1000 as step\r\n), bins as (\r\n -- we always generate the bins from the start of the trading day so they are stable\r\n select generate_series(l.start ,l.end, l.step) as time\r\n from limits l \r\n),\r\nprices as (\r\n --for any order of a given stock executed within the relevant time span, find the price\r\n select \r\n e.timestamp as time, s.name as metric, \r\n -- if the execution itself has a price, it takes precedence\r\n max(coalesce(e.price, o.price)) as value,\r\n max(coalesce(e.price, o.price) * e.quantity) as volume\r\nfrom executions e, stocks s, orders o, limits l\r\n where e.orderid = o.orderid\r\nand o.stockid = s.stockid \r\nand s.name in ('${stock}')\r\n and e.timestamp >= l.start\r\n and e.timestamp < l.end\r\n group by e.timestamp, s.name\r\n),\r\nbinned as (\r\n select \r\nextract(epoch from current_date + (b.time/(1000*1000) * interval '1 millisecond')) as time,\r\np.metric, \r\nfirst_value(p.value) over w as open,\r\nlast_value(p.value) over w as close,\r\nmax(p.value) over w as high,\r\nmin(p.value) over w as low,\r\nsum(p.volume) over w as volume,\r\nrow_number() over w as rn\r\n from prices p, bins b, limits l\r\n --assign each event into its bin\r\n where p.time >= b.time and p.time < b.time + l.step\r\n --for each bin, find the candlestick parameters with a window function\r\n window w as (partition by b.time, p.metric order by p.time asc rows between unbounded preceding and unbounded following)\r\n)\r\nselect metric, time, open, close, high, low, volume \r\nfrom binned b\r\nwhere rn = 1\r\norder by time asc;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } } - }, - { - "id": "custom.width", - "value": 73 + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "1s", + "hideTimeOverride": true } - ] + } }, - { - "matcher": { - "id": "byName", - "options": "volume" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "basic", - "type": "gauge", - "valueDisplayMode": "color" + "vizConfig": { + "kind": "VizConfig", + "group": "candlestick", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "annotations": { + "clustering": -1, + "multiLane": false + }, + "candleStyle": "candles", + "colorStrategy": "open-close", + "colors": { + "down": "red", + "up": "green" + }, + "includeAllFields": false, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "mode": "candles+volume", + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "none" } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "time" - }, - "properties": [ - { - "id": "custom.width", - "value": 165 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 90 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "quantity" - }, - "properties": [ - { - "id": "custom.width", - "value": 75 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 9, - "x": 0, - "y": 13 - }, - "hideTimeOverride": true, - "id": 13, - "interval": "200ms", - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": ["sum"], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": false, - "displayName": "volume" - } - ] - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "select EXTRACT(EPOCH FROM current_date + (e.timestamp/(1000*1000) * interval '1 millisecond')) as time, s.name, o.side, e.quantity, coalesce(e.price, o.price) as price, e.quantity * coalesce(e.price, o.price) as volume \r\nfrom executions e, stocks s, orders o \r\nwhere e.orderid = o.orderid and o.stockid = s.stockid\r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\norder by volume desc\r\nlimit 100;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + }, + "fieldConfig": { + "defaults": { + "unit": "currencyUSD", + "decimals": 4, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "fieldMinMax": false }, - "type": "groupBy" + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "decimals" + } + ] + } + ] } - ], - "limit": 50 + } } } - ], - "timeShift": "${timeOffset}s", - "title": "100 biggest trades in current time range", - "type": "table" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": false, - "mappings": [], - "max": 10000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 + "panel-8": { + "kind": "Panel", + "spec": { + "id": 8, + "title": "New", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 9, - "y": 13 - }, - "hideTimeOverride": true, - "id": 8, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "timeShift": "${timeOffset}s", - "title": "New", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "endpointMarker": "point", + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto", + "sparkline": false, + "textMode": "auto" }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 12, - "y": 13 - }, - "hideTimeOverride": true, - "id": 9, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as executed\r\nfrom executions e \r\nwhere e.timestamp > (select max(e2.timestamp) from executions e2) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 10000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "timeShift": "${timeOffset}s", - "title": "Executed", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "fillOpacity": 80, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null + "panel-9": { + "kind": "Panel", + "spec": { + "id": 9, + "title": "Executed", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as executed\r\nfrom executions e \r\nwhere e.timestamp > (select max(e2.timestamp) from executions e2) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 9, - "x": 15, - "y": 13 - }, - "hideTimeOverride": true, - "id": 1, - "interval": "200ms", - "options": { - "barRadius": 0, - "barWidth": 0.72, - "fullHighlight": false, - "groupWidth": 0.7, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "right", - "showLegend": false - }, - "orientation": "horizontal", - "showValue": "never", - "stacking": "none", - "tooltip": { - "mode": "single", - "sort": "none" - }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select s.name, count(*) from executions e, stocks s \r\nwhere e.stockId = s.stockId \r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\ngroup by s.name order by count desc limit 10;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "13.1.0-25410206825", + "spec": { + "options": { + "barShape": "flat", + "barWidthFactor": 0.5, + "effects": { + "barGlow": false, + "centerGlow": false, + "gradient": false + }, + "endpointMarker": "point", + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "segmentCount": 1, + "segmentSpacing": 0.3, + "shape": "gauge", + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto", + "sparkline": false, + "textMode": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 1000, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": 0, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "timeShift": "${timeOffset}s", - "title": "Executed Orders", - "type": "barchart" + } }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": true, - "mappings": [], - "max": 10000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 0, + "width": 24, + "height": 6, + "element": { + "kind": "ElementReference", + "name": "panel-21" }, - { - "color": "red", - "value": 80 + "repeat": { + "mode": "variable", + "value": "stock", + "direction": "h", + "maxPerRow": 6 } - ] + } }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 9, - "y": 18 - }, - "hideTimeOverride": true, - "id": 10, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 6, + "width": 24, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-32" + }, + "repeat": { + "mode": "variable", + "value": "stock", + "direction": "h", + "maxPerRow": 6 + } + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as canceled\r\nfrom cancellations c \r\nwhere c.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 13, + "width": 9, + "height": 10, + "element": { + "kind": "ElementReference", + "name": "panel-13" } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 9, + "y": 13, + "width": 3, + "height": 5, + "element": { + "kind": "ElementReference", + "name": "panel-8" } - ], - "limit": 50 - } - } - ], - "timeShift": "${timeOffset}s", - "title": "Canceled", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" + } }, - "fieldMinMax": false, - "mappings": [], - "max": 5000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 + { + "kind": "GridLayoutItem", + "spec": { + "x": 12, + "y": 13, + "width": 3, + "height": 5, + "element": { + "kind": "ElementReference", + "name": "panel-9" } - ] + } }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 12, - "y": 18 - }, - "hideTimeOverride": true, - "id": 17, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.3.1", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" + { + "kind": "GridLayoutItem", + "spec": { + "x": 15, + "y": 13, + "width": 9, + "height": 10, + "element": { + "kind": "ElementReference", + "name": "panel-1" + } + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is not null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" + { + "kind": "GridLayoutItem", + "spec": { + "x": 9, + "y": 18, + "width": 3, + "height": 5, + "element": { + "kind": "ElementReference", + "name": "panel-10" } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 12, + "y": 18, + "width": 3, + "height": 5, + "element": { + "kind": "ElementReference", + "name": "panel-17" } - ], - "limit": 50 + } } - } - ], - "timeShift": "${timeOffset}s", - "title": "Updated", - "type": "gauge" - } - ], - "refresh": "auto", - "schemaVersion": 40, - "tags": [], - "templating": { - "list": [ - { - "allowCustomValue": false, - "current": { - "text": "cedar", - "value": "fdl2zuq913klcb" - }, - "label": "DB", - "name": "selected_data_source", - "options": [], - "query": "grafana-postgresql-datasource", - "refresh": 1, - "regex": "", - "type": "datasource" - }, + ] + } + }, + "links": [], + "liveNow": false, + "preload": false, + "tags": [], + "timeSettings": { + "timezone": "utc", + "from": "now-15m", + "to": "now", + "autoRefresh": "auto", + "autoRefreshIntervals": ["500ms", "1s", "5s", "10s", "30s", "1m"], + "hideTimepicker": false, + "fiscalYearStartMonth": 0 + }, + "title": "NASDAQ", + "variables": [ { - "current": { - "text": ["AAPL", "FB", "TSLA"], - "value": ["AAPL", "FB", "TSLA"] - }, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "definition": "select name from stocks", - "description": "The stock name you want to follow (e.g., AAPL)", - "includeAll": false, - "label": "Stock", - "multi": true, - "name": "stock", - "options": [], - "query": "select name from stocks", - "refresh": 1, - "regex": "", - "type": "query" + "kind": "DatasourceVariable", + "spec": { + "name": "selected_data_source", + "pluginId": "grafana-postgresql-datasource", + "refresh": "onDashboardLoad", + "regex": "", + "current": { + "text": "cedar", + "value": "fdl2zuq913klcb" + }, + "options": [], + "multi": false, + "includeAll": false, + "label": "DB", + "hide": "dontHide", + "skipUrlSync": false, + "allowCustomValue": false + } }, { - "current": { - "text": "10000", - "value": "10000" - }, - "includeAll": false, - "name": "bins", - "options": [ - { - "selected": false, - "text": "1s", - "value": "1000" - }, - { - "selected": false, - "text": "2s", - "value": "2000" + "kind": "QueryVariable", + "spec": { + "name": "stock", + "current": { + "text": ["AAPL", "FB", "TSLA"], + "value": ["AAPL", "FB", "TSLA"] }, - { - "selected": false, - "text": "5s", - "value": "5000" + "label": "Stock", + "hide": "dontHide", + "refresh": "onDashboardLoad", + "skipUrlSync": false, + "description": "The stock name you want to follow (e.g., AAPL)", + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "__legacyStringValue": "select name from stocks" + } }, - { - "selected": true, - "text": "10s", + "regex": "", + "regexApplyTo": "value", + "sort": "disabled", + "definition": "select name from stocks", + "options": [], + "multi": true, + "includeAll": false, + "allowCustomValue": true + } + }, + { + "kind": "CustomVariable", + "spec": { + "name": "bins", + "query": "1s : 1000,2s : 2000,5s : 5000,10s : 10000,30s : 20000,1min : 60000,5min : 300000,10min : 600000", + "current": { + "text": "10000", "value": "10000" }, - { - "selected": false, - "text": "30s", - "value": "20000" - }, - { - "selected": false, - "text": "1min", - "value": "60000" - }, - { - "selected": false, - "text": "5min", - "value": "300000" - }, - { - "selected": false, - "text": "10min", - "value": "600000" - } - ], - "query": "1s : 1000,2s : 2000,5s : 5000,10s : 10000,30s : 20000,1min : 60000,5min : 300000,10min : 600000", - "type": "custom" + "options": [ + { + "selected": false, + "text": "1s", + "value": "1000" + }, + { + "selected": false, + "text": "2s", + "value": "2000" + }, + { + "selected": false, + "text": "5s", + "value": "5000" + }, + { + "selected": true, + "text": "10s", + "value": "10000" + }, + { + "selected": false, + "text": "30s", + "value": "20000" + }, + { + "selected": false, + "text": "1min", + "value": "60000" + }, + { + "selected": false, + "text": "5min", + "value": "300000" + }, + { + "selected": false, + "text": "10min", + "value": "600000" + } + ], + "multi": false, + "includeAll": false, + "hide": "dontHide", + "skipUrlSync": false, + "allowCustomValue": true, + "valuesFormat": "csv" + } }, { - "current": { - "text": "1.05", - "value": "1.05" - }, - "description": "2 <=> from 0.5x to 2x.", - "label": "Order book width", - "name": "width", - "options": [ - { - "selected": true, + "kind": "TextVariable", + "spec": { + "name": "width", + "current": { "text": "1.05", "value": "1.05" - } - ], - "query": "1.05", - "type": "textbox" + }, + "query": "1.05", + "label": "Order book width", + "hide": "dontHide", + "skipUrlSync": false, + "description": "2 <=> from 0.5x to 2x." + } }, { - "current": {}, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "${selected_data_source}" - }, - "definition": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o", - "includeAll": false, - "name": "timeOffset", - "options": [], - "query": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o", - "refresh": 1, - "regex": "", - "type": "query" + "kind": "QueryVariable", + "spec": { + "name": "timeOffset", + "current": { + "text": "", + "value": "" + }, + "hide": "dontHide", + "refresh": "onDashboardLoad", + "skipUrlSync": false, + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "${selected_data_source}" + }, + "spec": { + "__legacyStringValue": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o" + } + }, + "regex": "", + "regexApplyTo": "value", + "sort": "disabled", + "definition": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o", + "options": [], + "multi": false, + "includeAll": false, + "allowCustomValue": true + } } ] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": ["500ms", "1s", "5s", "10s", "30s", "1m"] - }, - "timezone": "utc", - "title": "NASDAQ", - "uid": "edll9t2tw29dsc", - "version": 13, - "weekStart": "" + } } diff --git a/nasdaq/grafana/dashboards/NASDAQ-Comparison-1775576026099.json b/nasdaq/grafana/dashboards/NASDAQ-Comparison-1775576026099.json index f31232c..06c0d45 100644 --- a/nasdaq/grafana/dashboards/NASDAQ-Comparison-1775576026099.json +++ b/nasdaq/grafana/dashboards/NASDAQ-Comparison-1775576026099.json @@ -1,2675 +1,3483 @@ { - "annotations": { - "list": [ + "apiVersion": "dashboard.grafana.app/v2", + "kind": "Dashboard", + "metadata": { + "name": "fbcc367d-c96a-4cb4-9efb-5a229527c4b9", + "namespace": "default", + "uid": "5e843020-c9ce-489f-878b-8d4a12c0a14d", + "resourceVersion": "1778061664071013", + "generation": 1, + "creationTimestamp": "2026-05-06T10:01:04Z", + "labels": { + "grafana.app/deprecatedInternalID": "2827629846716416" + }, + "annotations": { + "grafana.app/createdBy": "access-policy:service", + "grafana.app/managedBy": "classic-file-provisioning", + "grafana.app/managerAllowsEdits": "true", + "grafana.app/managerId": "cedar", + "grafana.app/sourceChecksum": "0de8cf761918ea41cb60c64ad2cc2f82", + "grafana.app/sourcePath": "/etc/grafana/provisioning/dashboards/NASDAQ-Comparison-1775576026099.json", + "grafana.app/sourceTimestamp": "1777978179000", + "grafana.app/folder": "" + } + }, + "spec": { + "annotations": [ { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" + "kind": "AnnotationQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana", + "version": "v0", + "datasource": { + "name": "-- Grafana --" + }, + "spec": {} + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "builtIn": true, + "legacyOptions": { + "type": "dashboard" + } + } } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 2, - "links": [], - "panels": [ - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 38, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "fixed" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "fieldMinMax": true, - "mappings": [ + ], + "cursorSync": "Off", + "editable": true, + "elements": { + "panel-10": { + "kind": "Panel", + "spec": { + "id": 10, + "title": "Cancellations", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ { - "options": { - "BUY": { - "color": "green", - "index": 1, - "text": "BUY" - }, - "SELL": { - "color": "red", - "index": 0, - "text": "SELL" - } - }, - "type": "value" + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as canceled\r\nfrom cancellations c \r\nwhere c.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } } ], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "red", - "value": 80 - } - ] + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "price" + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 10000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "id": "decimals", - "value": 4 + "color": { + "mode": "continuous-GrYlRd" }, - { - "id": "custom.width", - "value": 91 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "volume" + "fieldMinMax": true }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" + "overrides": [] + } + } + } + } + }, + "panel-17": { + "kind": "Panel", + "spec": { + "id": 17, + "title": "Updated Orders", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is not null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false } - ] - }, - { - "matcher": { - "id": "byName", - "options": "side" + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true + } + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 5000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "id": "custom.width", - "value": 73 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "volume" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "basic", - "type": "gauge", - "valueDisplayMode": "color" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "time" - }, - "properties": [ - { - "id": "custom.width", - "value": 165 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 90 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "quantity" + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false }, - "properties": [ - { - "id": "custom.width", - "value": 75 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 2 - }, - "hideTimeOverride": true, - "id": 39, - "interval": "200ms", - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": ["sum"], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "volume" - } - ] - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "select EXTRACT(EPOCH FROM current_date + (e.timestamp/(1000*1000) * interval '1 millisecond')) as time, s.name, o.side, e.quantity, coalesce(e.price, o.price) as price, e.quantity * coalesce(e.price, o.price) as volume \r\nfrom executions e, stocks s, orders o \r\nwhere e.orderid = o.orderid and o.stockid = s.stockid\r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\norder by volume desc\r\nlimit 100;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 + "overrides": [] } } - ], - "timeShift": "${timeOffset}s", - "title": "100 biggest trades in current time range", - "type": "table" + } } - ], - "title": "Largest Orders - CedarDB 🌲", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 1 }, - "id": 40, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "fixed" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "fieldMinMax": true, - "mappings": [ + "panel-23": { + "kind": "Panel", + "spec": { + "id": 23, + "title": "New Orders", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ { - "options": { - "BUY": { - "color": "green", - "index": 1, - "text": "BUY" - }, - "SELL": { - "color": "red", - "index": 0, - "text": "SELL" - } - }, - "type": "value" + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } } ], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "red", - "value": 80 - } - ] + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "price" + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 10000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "id": "decimals", - "value": 4 + "color": { + "mode": "continuous-GrYlRd" }, - { - "id": "custom.width", - "value": 91 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "volume" + "fieldMinMax": false }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" + "overrides": [] + } + } + } + } + }, + "panel-24": { + "kind": "Panel", + "spec": { + "id": 24, + "title": "Updated Orders", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is not null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false } - ] - }, - { - "matcher": { - "id": "byName", - "options": "side" + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true + } + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-text" - } + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 5000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "id": "custom.width", - "value": 73 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "volume" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "mode": "basic", - "type": "gauge", - "valueDisplayMode": "color" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "time" - }, - "properties": [ - { - "id": "custom.width", - "value": 165 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 90 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "quantity" + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false }, - "properties": [ - { - "id": "custom.width", - "value": 75 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 151 - }, - "hideTimeOverride": true, - "id": 41, - "interval": "200ms", - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": ["sum"], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "volume" + "overrides": [] } - ] - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "select EXTRACT(EPOCH FROM current_date + (e.timestamp/(1000*1000) * interval '1 millisecond')) as time, s.name, o.side, e.quantity, coalesce(e.price, o.price) as price, e.quantity * coalesce(e.price, o.price) as volume \r\nfrom executions e, stocks s, orders o \r\nwhere e.orderid = o.orderid and o.stockid = s.stockid\r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\norder by volume desc\r\nlimit 100;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + } + } + } + }, + "panel-25": { + "kind": "Panel", + "spec": { + "id": 25, + "title": "Executions", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as executed\r\nfrom executions e \r\nwhere e.timestamp > (select max(e2.timestamp) from executions e2) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } } - ], - "timeShift": "${timeOffset}s", - "title": "100 biggest trades in current time range", - "type": "table" - } - ], - "title": "Largest Orders - Postgres 🐘", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 2 - }, - "id": 34, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepBefore", - "lineStyle": { - "fill": "solid" + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 1000, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "color": "red", - "value": 80 + "color": { + "mode": "continuous-GrYlRd" } - ] - }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "price" }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "sum" - }, - "properties": [ - { - "id": "decimals", - "value": 0 - } - ] + "overrides": [] } - ] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 57 - }, - "hideTimeOverride": true, - "id": 36, - "interval": "100ms", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" } - }, - "pluginVersion": "12.0.0", - "repeat": "stock", - "repeatDirection": "h", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "with orderdepth as ( \r\n select price, side, sum(quantity) as quantity\r\n from orderbook o, stocks s \r\n where o.stockId = s.stockId\r\n and s.name in (${stock})\r\n group by price, side\r\n),\r\ncumulative_sell as (\r\n select price, side as metric, sum(quantity) over (order by price asc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'SELL'\r\n),\r\ncumulative_buy as (\r\n select price, side as metric, sum(quantity) over (order by price desc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'BUY'\r\n),\r\ncumulative as (\r\n select * from cumulative_sell where sum > 0 and price < ${width} * (select min(price) from cumulative_sell)\r\n union all\r\n select * from cumulative_buy where sum > 0 and price > 1::numeric/${width} * (select max(price) from cumulative_buy)\r\n)\r\nselect * from cumulative order by price asc;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + } + } + }, + "panel-26": { + "kind": "Panel", + "spec": { + "id": 26, + "title": "Cancellations", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as canceled\r\nfrom cancellations c \r\nwhere c.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } } - ], - "timeShift": "${timeOffset}s", - "title": "Order book depth for ${stock}", - "type": "trend" - } - ], - "title": "Orderbook - CedarDB 🌲", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 3 - }, - "id": 35, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepBefore", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 10000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "price" - }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "sum" + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": true }, - "properties": [ - { - "id": "decimals", - "value": 0 - } - ] + "overrides": [] } - ] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 225 - }, - "hideTimeOverride": true, - "id": 37, - "interval": "100ms", - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" } - }, - "pluginVersion": "12.0.0", - "repeat": "stock", - "repeatDirection": "h", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "hide": false, - "rawQuery": true, - "rawSql": "with orderdepth as ( \r\n select price, side, sum(quantity) as quantity\r\n from orderbook o, stocks s \r\n where o.stockId = s.stockId\r\n and s.name in (${stock})\r\n group by price, side\r\n),\r\ncumulative_sell as (\r\n select price, side as metric, sum(quantity) over (order by price asc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'SELL'\r\n),\r\ncumulative_buy as (\r\n select price, side as metric, sum(quantity) over (order by price desc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'BUY'\r\n),\r\ncumulative as (\r\n select * from cumulative_sell where sum > 0 and price < ${width} * (select min(price) from cumulative_sell)\r\n union all\r\n select * from cumulative_buy where sum > 0 and price > 1::numeric/${width} * (select max(price) from cumulative_buy)\r\n)\r\nselect * from cumulative order by price asc;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + } + } + }, + "panel-27": { + "kind": "Panel", + "spec": { + "id": 27, + "title": "Latest Event ", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT to_char(to_timestamp(max(t) / 1e9), 'HH:MI:SS') as latest_time from (\n SELECT max(\"timestamp\") as t FROM orders\n UNION\n SELECT max(\"timestamp\") as t FROM executions\n UNION\n SELECT max(\"timestamp\") as t FROM cancellations \n)\n", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 + } + ], + "transformations": [], + "queryOptions": {} + } + }, + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^latest_time$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] } } - ], - "timeShift": "${timeOffset}s", - "title": "Order book depth for ${stock}", - "type": "trend" + } } - ], - "title": "Orderbook - Postgres 🐘", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 4 }, - "id": 29, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, + "panel-28": { + "kind": "Panel", + "spec": { + "id": 28, + "title": "Latest Event", "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": false, - "mappings": [], - "max": 10000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 0, - "y": 5 - }, - "hideTimeOverride": true, - "id": 23, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT to_char(to_timestamp(max(t) / 1e9), 'HH:MI:SS') as latest_time from (\n SELECT max(\"timestamp\") as t FROM orders\n UNION\n SELECT max(\"timestamp\") as t FROM executions\n UNION\n SELECT max(\"timestamp\") as t FROM cancellations \n)\n", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 - } + } + ], + "transformations": [], + "queryOptions": {} } - ], - "timeShift": "${timeOffset}s", - "title": "New Orders", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": false, - "mappings": [], - "max": 5000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^latest_time$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "color": "red", - "value": 80 + "color": { + "mode": "thresholds" } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 3, - "y": 5 - }, - "hideTimeOverride": true, - "id": 24, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is not null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + }, + "overrides": [] + } + } + } + } + }, + "panel-36": { + "kind": "Panel", + "spec": { + "id": 36, + "title": "Order book depth for ${stock}", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "with orderdepth as ( \r\n select price, side, sum(quantity) as quantity\r\n from orderbook o, stocks s \r\n where o.stockId = s.stockId\r\n and s.name in ('${stock}')\r\n group by price, side\r\n),\r\ncumulative_sell as (\r\n select price, side as metric, sum(quantity) over (order by price asc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'SELL'\r\n),\r\ncumulative_buy as (\r\n select price, side as metric, sum(quantity) over (order by price desc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'BUY'\r\n),\r\ncumulative as (\r\n select * from cumulative_sell where sum > 0 and price < ${width} * (select min(price) from cumulative_sell)\r\n union all\r\n select * from cumulative_buy where sum > 0 and price > 1::numeric/${width} * (select max(price) from cumulative_buy)\r\n)\r\nselect * from cumulative order by price asc;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "100ms", + "hideTimeOverride": true } } - ], - "timeShift": "${timeOffset}s", - "title": "Updated Orders", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" + "vizConfig": { + "kind": "VizConfig", + "group": "trend", + "version": "12.0.0", + "spec": { + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "fieldConfig": { + "defaults": { + "unit": "none", + "decimals": 2, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 6, - "y": 5 - }, - "hideTimeOverride": true, - "id": 25, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as executed\r\nfrom executions e \r\nwhere e.timestamp > (select max(e2.timestamp) from executions e2) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "stepBefore", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "type": "groupBy" + "thresholdsStyle": { + "mode": "off" + } } - ], - "limit": 50 - } - } - ], - "timeShift": "${timeOffset}s", - "title": "Executions", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": true, - "mappings": [], - "max": 10000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ + }, + "overrides": [ { - "color": "green" + "matcher": { + "id": "byName", + "options": "price" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] }, { - "color": "red", - "value": 80 + "matcher": { + "id": "byName", + "options": "sum" + }, + "properties": [ + { + "id": "decimals", + "value": 0 + } + ] } ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 9, - "y": 5 - }, - "hideTimeOverride": true, - "id": 26, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as canceled\r\nfrom cancellations c \r\nwhere c.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + } + } + } + } + }, + "panel-37": { + "kind": "Panel", + "spec": { + "id": 37, + "title": "Order book depth for ${stock}", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "with orderdepth as ( \r\n select price, side, sum(quantity) as quantity\r\n from orderbook o, stocks s \r\n where o.stockId = s.stockId\r\n and s.name in ('${stock}')\r\n group by price, side\r\n),\r\ncumulative_sell as (\r\n select price, side as metric, sum(quantity) over (order by price asc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'SELL'\r\n),\r\ncumulative_buy as (\r\n select price, side as metric, sum(quantity) over (order by price desc) as sum\r\n from orderdepth\r\n where quantity > 0\r\n and side = 'BUY'\r\n),\r\ncumulative as (\r\n select * from cumulative_sell where sum > 0 and price < ${width} * (select min(price) from cumulative_sell)\r\n union all\r\n select * from cumulative_buy where sum > 0 and price > 1::numeric/${width} * (select max(price) from cumulative_buy)\r\n)\r\nselect * from cumulative order by price asc;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "100ms", + "hideTimeOverride": true } } - ], - "timeShift": "${timeOffset}s", - "title": "Cancellations", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "vizConfig": { + "kind": "VizConfig", + "group": "trend", + "version": "12.0.0", + "spec": { + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" + "fieldConfig": { + "defaults": { + "unit": "none", + "decimals": 2, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] }, - { - "color": "red", - "value": 80 + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "stepBefore", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 5 - }, - "id": 28, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^latest_time$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT to_char(to_timestamp(max(t) / 1e9), 'HH:MI:SS') as latest_time from (\n SELECT max(\"timestamp\") as t FROM orders\n UNION\n SELECT max(\"timestamp\") as t FROM executions\n UNION\n SELECT max(\"timestamp\") as t FROM cancellations \n)\n", - "refId": "A", - "sql": { - "columns": [ + }, + "overrides": [ { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ + "matcher": { + "id": "byName", + "options": "price" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + }, { - "property": { - "type": "string" + "matcher": { + "id": "byName", + "options": "sum" }, - "type": "groupBy" + "properties": [ + { + "id": "decimals", + "value": 0 + } + ] } - ], - "limit": 50 + ] } } - ], - "title": "Latest Event", - "type": "stat" + } } - ], - "title": "Exchange Activity - CedarDB 🌲", - "type": "row" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 5 }, - "id": 22, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, + "panel-39": { + "kind": "Panel", + "spec": { + "id": 39, + "title": "100 biggest trades in current time range", "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": false, - "mappings": [], - "max": 10000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 0, - "y": 6 - }, - "hideTimeOverride": true, - "id": 8, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select EXTRACT(EPOCH FROM current_date + (e.timestamp/(1000*1000) * interval '1 millisecond')) as time, s.name, o.side, e.quantity, coalesce(e.price, o.price) as price, e.quantity * coalesce(e.price, o.price) as volume \r\nfrom executions e, stocks s, orders o \r\nwhere e.orderid = o.orderid and o.stockid = s.stockid\r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\norder by volume desc\r\nlimit 100;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } }, - "type": "groupBy" + "refId": "A", + "hidden": false } - ], - "limit": 50 + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } } - ], - "timeShift": "${timeOffset}s", - "title": "New Orders", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": false, - "mappings": [], - "max": 5000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, + "vizConfig": { + "kind": "VizConfig", + "group": "table", + "version": "12.0.0", + "spec": { + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": ["sum"], + "show": false + }, + "showHeader": true, + "sortBy": [ { - "color": "red", - "value": 80 + "desc": true, + "displayName": "volume" } ] }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 3, - "y": 6 - }, - "hideTimeOverride": true, - "id": 17, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is not null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "BUY": { + "text": "BUY", + "color": "green", + "index": 1 + }, + "SELL": { + "text": "SELL", + "color": "red", + "index": 0 + } + } + } + ], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 50, + "color": "#EAB839" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "fixed" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "fieldMinMax": true + }, + "overrides": [ { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ + "matcher": { + "id": "byName", + "options": "price" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + }, + { + "id": "decimals", + "value": 4 + }, + { + "id": "custom.width", + "value": 91 + } + ] + }, { - "property": { - "type": "string" + "matcher": { + "id": "byName", + "options": "volume" }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "timeShift": "${timeOffset}s", - "title": "Updated Orders", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + }, { - "color": "green" + "matcher": { + "id": "byName", + "options": "side" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + }, + { + "id": "custom.width", + "value": 73 + } + ] }, { - "color": "red", - "value": 80 - } - ] - }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 6, - "y": 6 - }, - "hideTimeOverride": true, - "id": 9, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as executed\r\nfrom executions e \r\nwhere e.timestamp > (select max(e2.timestamp) from executions e2) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "basic", + "type": "gauge", + "valueDisplayMode": "color" + } + } + ] + }, { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ + "matcher": { + "id": "byName", + "options": "time" + }, + "properties": [ + { + "id": "custom.width", + "value": 165 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 90 + } + ] + }, { - "property": { - "type": "string" + "matcher": { + "id": "byName", + "options": "quantity" }, - "type": "groupBy" + "properties": [ + { + "id": "custom.width", + "value": 75 + } + ] } - ], - "limit": 50 + ] + } + } + } + } + }, + "panel-41": { + "kind": "Panel", + "spec": { + "id": 41, + "title": "100 biggest trades in current time range", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select EXTRACT(EPOCH FROM current_date + (e.timestamp/(1000*1000) * interval '1 millisecond')) as time, s.name, o.side, e.quantity, coalesce(e.price, o.price) as price, e.quantity * coalesce(e.price, o.price) as volume \r\nfrom executions e, stocks s, orders o \r\nwhere e.orderid = o.orderid and o.stockid = s.stockid\r\nand e.timestamp >= (${__from:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\nand e.timestamp < (${__to:date:seconds} - extract(epoch from current_date)) * 1000 * 1000 * 1000\r\norder by volume desc\r\nlimit 100;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } } - ], - "timeShift": "${timeOffset}s", - "title": "Executions", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "fieldMinMax": true, - "mappings": [], - "max": 10000, - "min": 0, - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green" - }, + "vizConfig": { + "kind": "VizConfig", + "group": "table", + "version": "12.0.0", + "spec": { + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": ["sum"], + "show": false + }, + "showHeader": true, + "sortBy": [ { - "color": "red", - "value": 80 + "desc": true, + "displayName": "volume" } ] }, - "unit": "eps" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 9, - "y": 6 - }, - "hideTimeOverride": true, - "id": 10, - "interval": "200ms", - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select count(*) / 1 as canceled\r\nfrom cancellations c \r\nwhere c.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", - "refId": "A", - "sql": { - "columns": [ + "fieldConfig": { + "defaults": { + "mappings": [ + { + "type": "value", + "options": { + "BUY": { + "text": "BUY", + "color": "green", + "index": 1 + }, + "SELL": { + "text": "SELL", + "color": "red", + "index": 0 + } + } + } + ], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 50, + "color": "#EAB839" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "fixed" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "fieldMinMax": true + }, + "overrides": [ { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ + "matcher": { + "id": "byName", + "options": "price" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + }, + { + "id": "decimals", + "value": 4 + }, + { + "id": "custom.width", + "value": 91 + } + ] + }, { - "property": { - "type": "string" + "matcher": { + "id": "byName", + "options": "volume" }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "timeShift": "${timeOffset}s", - "title": "Cancellations", - "type": "gauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + }, { - "color": "green" + "matcher": { + "id": "byName", + "options": "side" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "color-text" + } + }, + { + "id": "custom.width", + "value": 73 + } + ] }, { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 6 - }, - "id": 27, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^latest_time$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT to_char(to_timestamp(max(t) / 1e9), 'HH:MI:SS') as latest_time from (\n SELECT max(\"timestamp\") as t FROM orders\n UNION\n SELECT max(\"timestamp\") as t FROM executions\n UNION\n SELECT max(\"timestamp\") as t FROM cancellations \n)\n", - "refId": "A", - "sql": { - "columns": [ + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "mode": "basic", + "type": "gauge", + "valueDisplayMode": "color" + } + } + ] + }, { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ + "matcher": { + "id": "byName", + "options": "time" + }, + "properties": [ + { + "id": "custom.width", + "value": 165 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "custom.width", + "value": 90 + } + ] + }, { - "property": { - "type": "string" + "matcher": { + "id": "byName", + "options": "quantity" }, - "type": "groupBy" + "properties": [ + { + "id": "custom.width", + "value": 75 + } + ] } - ], - "limit": 50 + ] } } - ], - "title": "Latest Event ", - "type": "stat" - } - ], - "title": "Exchange Activity - Postgres 🐘", - "type": "row" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 7 - }, - "id": 48, - "panels": [], - "title": "Database Statistics - CedarDB 🌲", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 8 - }, - "id": 42, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^xact_commit$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 } } - ], - "title": "# Commits", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 8 }, - "id": 44, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^xact_rollback$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" + "panel-42": { + "kind": "Panel", + "spec": { + "id": 42, + "title": "# Commits", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^xact_commit$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Rollbacks", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 8, - "y": 8 - }, - "id": 45, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^tup_inserted$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" + "panel-44": { + "kind": "Panel", + "spec": { + "id": 44, + "title": "# Rollbacks", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^xact_rollback$/", + "values": false }, - "type": "groupBy" + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Tuple Inserts", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 13, - "y": 8 }, - "id": 46, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^tup_updated$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" + "panel-45": { + "kind": "Panel", + "spec": { + "id": 45, + "title": "# Tuple Inserts", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^tup_inserted$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Tuple Updates", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] }, - "gridPos": { - "h": 3, - "w": 5, - "x": 18, - "y": 8 - }, - "id": 47, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^tup_deleted$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" + "panel-46": { + "kind": "Panel", + "spec": { + "id": 46, + "title": "# Tuple Updates", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^tup_updated$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Tuple Deletes", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 11 }, - "id": 43, - "panels": [], - "title": "Database Statistics - Postgres 🐘", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "panel-47": { + "kind": "Panel", + "spec": { + "id": 47, + "title": "# Tuple Deletes", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^tup_deleted$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] } - ] + } } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 12 - }, - "id": 49, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^xact_commit$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true + } }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" + "panel-49": { + "kind": "Panel", + "spec": { + "id": 49, + "title": "# Commits", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^xact_commit$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Commits", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "panel-50": { + "kind": "Panel", + "spec": { + "id": 50, + "title": "# Rollbacks", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^xact_rollback$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] } - ] + } } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 12 - }, - "id": 50, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^xact_rollback$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true + } }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" + "panel-51": { + "kind": "Panel", + "spec": { + "id": 51, + "title": "# Tuple Inserts", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^tup_inserted$/", + "values": false }, - "type": "groupBy" + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Rollbacks", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "panel-52": { + "kind": "Panel", + "spec": { + "id": 52, + "title": "# Tuple Updates", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^tup_updated$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } + }, + "overrides": [] } - ] + } } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 8, - "y": 12 - }, - "id": 51, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^tup_inserted$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true + } }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" + "panel-53": { + "kind": "Panel", + "spec": { + "id": 53, + "title": "# Tuple Deletes", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": {} + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "stat", + "version": "12.0.0", + "spec": { + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "/^tup_deleted$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "fieldConfig": { + "defaults": { + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "thresholds" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Tuple Inserts", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 + "panel-8": { + "kind": "Panel", + "spec": { + "id": 8, + "title": "New Orders", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as new\r\nfrom orders o \r\nwhere prevOrder is null\r\nand o.timestamp > (select max(e.timestamp) from executions e) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 13, - "y": 12 - }, - "id": 52, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^tup_updated$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false }, - "type": "groupBy" + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 10000, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false + }, + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Tuple Updates", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 + "panel-9": { + "kind": "Panel", + "spec": { + "id": 9, + "title": "Executions", + "description": "", + "links": [], + "data": { + "kind": "QueryGroup", + "spec": { + "queries": [ + { + "kind": "PanelQuery", + "spec": { + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcc" + }, + "spec": { + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "select count(*) / 1 as executed\r\nfrom executions e \r\nwhere e.timestamp > (select max(e2.timestamp) from executions e2) - 1::bigint * 1000 * 1000 * 1000;", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + }, + "refId": "A", + "hidden": false + } + } + ], + "transformations": [], + "queryOptions": { + "timeShift": "${timeOffset}s", + "interval": "200ms", + "hideTimeOverride": true } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 5, - "x": 18, - "y": 12 - }, - "id": 53, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "/^tup_deleted$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "12.0.0", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcc" + } }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT *\nFROM pg_stat_database\nWHERE datname = 'postgres'", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" + "vizConfig": { + "kind": "VizConfig", + "group": "gauge", + "version": "12.0.0", + "spec": { + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": ["lastNotNull"], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "fieldConfig": { + "defaults": { + "unit": "eps", + "min": 0, + "max": 1000, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "value": null, + "color": "green" + }, + { + "value": 80, + "color": "red" + } + ] + }, + "color": { + "mode": "continuous-GrYlRd" + } }, - "type": "groupBy" + "overrides": [] } - ], - "limit": 50 + } } } - ], - "title": "# Tuple Deletes", - "type": "stat" - } - ], - "preload": false, - "refresh": "200ms", - "schemaVersion": 41, - "tags": [], - "templating": { - "list": [ - { - "current": { - "text": ["AAPL", "FB", "TSLA"], - "value": ["AAPL", "FB", "TSLA"] - }, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "definition": "select name from stocks", - "description": "The stock name you want to follow (e.g., AAPL)", - "includeAll": false, - "label": "Stock", - "multi": true, - "name": "stock", - "options": [], - "query": "select name from stocks", - "refresh": 1, - "regex": "", - "type": "query" - }, - { - "current": { - "text": "10000", - "value": "10000" - }, - "includeAll": false, - "name": "bins", - "options": [ + } + }, + "layout": { + "kind": "RowsLayout", + "spec": { + "rows": [ { - "selected": false, - "text": "1s", - "value": "1000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Largest Orders - CedarDB 🌲", + "collapse": true, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 1, + "width": 12, + "height": 8, + "element": { + "kind": "ElementReference", + "name": "panel-39" + } + } + } + ] + } + } + } }, { - "selected": false, - "text": "2s", - "value": "2000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Largest Orders - Postgres 🐘", + "collapse": true, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 149, + "width": 12, + "height": 8, + "element": { + "kind": "ElementReference", + "name": "panel-41" + } + } + } + ] + } + } + } }, { - "selected": false, - "text": "5s", - "value": "5000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Orderbook - CedarDB 🌲", + "collapse": true, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 54, + "width": 24, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-36" + }, + "repeat": { + "mode": "variable", + "value": "stock", + "direction": "h" + } + } + } + ] + } + } + } }, { - "selected": true, - "text": "10s", - "value": "10000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Orderbook - Postgres 🐘", + "collapse": true, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 221, + "width": 24, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-37" + }, + "repeat": { + "mode": "variable", + "value": "stock", + "direction": "h" + } + } + } + ] + } + } + } }, { - "selected": false, - "text": "30s", - "value": "20000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Exchange Activity - CedarDB 🌲", + "collapse": true, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-23" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 3, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-24" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 6, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-25" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 9, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-26" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 12, + "y": 0, + "width": 6, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-28" + } + } + } + ] + } + } + } }, { - "selected": false, - "text": "1min", - "value": "60000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Exchange Activity - Postgres 🐘", + "collapse": true, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-8" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 3, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-17" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 6, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-9" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 9, + "y": 0, + "width": 3, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-10" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 12, + "y": 0, + "width": 6, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-27" + } + } + } + ] + } + } + } }, { - "selected": false, - "text": "5min", - "value": "300000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Database Statistics - CedarDB 🌲", + "collapse": false, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 0, + "width": 4, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-42" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 4, + "y": 0, + "width": 4, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-44" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 8, + "y": 0, + "width": 5, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-45" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 13, + "y": 0, + "width": 5, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-46" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 18, + "y": 0, + "width": 5, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-47" + } + } + } + ] + } + } + } }, { - "selected": false, - "text": "10min", - "value": "600000" + "kind": "RowsLayoutRow", + "spec": { + "title": "Database Statistics - Postgres 🐘", + "collapse": false, + "layout": { + "kind": "GridLayout", + "spec": { + "items": [ + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 0, + "width": 4, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-49" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 4, + "y": 0, + "width": 4, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-50" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 8, + "y": 0, + "width": 5, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-51" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 13, + "y": 0, + "width": 5, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-52" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 18, + "y": 0, + "width": 5, + "height": 3, + "element": { + "kind": "ElementReference", + "name": "panel-53" + } + } + } + ] + } + } + } } - ], - "query": "1s : 1000,2s : 2000,5s : 5000,10s : 10000,30s : 20000,1min : 60000,5min : 300000,10min : 600000", - "type": "custom" + ] + } + }, + "links": [], + "liveNow": false, + "preload": false, + "tags": [], + "timeSettings": { + "timezone": "utc", + "from": "now-15m", + "to": "now", + "autoRefresh": "200ms", + "autoRefreshIntervals": [ + "200ms", + "500ms", + "1s", + "5s", + "10s", + "30s", + "1m" + ], + "hideTimepicker": false, + "fiscalYearStartMonth": 0 + }, + "title": "NASDAQ-Comparison", + "variables": [ + { + "kind": "QueryVariable", + "spec": { + "name": "stock", + "current": { + "text": ["AAPL", "FB", "TSLA"], + "value": ["AAPL", "FB", "TSLA"] + }, + "label": "Stock", + "hide": "dontHide", + "refresh": "onDashboardLoad", + "skipUrlSync": false, + "description": "The stock name you want to follow (e.g., AAPL)", + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "__legacyStringValue": "select name from stocks" + } + }, + "regex": "", + "sort": "disabled", + "definition": "select name from stocks", + "options": [], + "multi": true, + "includeAll": false, + "allowCustomValue": true + } }, { - "current": { - "text": "1.05", - "value": "1.05" - }, - "description": "2 <=> from 0.5x to 2x.", - "label": "Order book width", - "name": "width", - "options": [ - { - "selected": true, + "kind": "CustomVariable", + "spec": { + "name": "bins", + "query": "1s : 1000,2s : 2000,5s : 5000,10s : 10000,30s : 20000,1min : 60000,5min : 300000,10min : 600000", + "current": { + "text": "10000", + "value": "10000" + }, + "options": [ + { + "selected": false, + "text": "1s", + "value": "1000" + }, + { + "selected": false, + "text": "2s", + "value": "2000" + }, + { + "selected": false, + "text": "5s", + "value": "5000" + }, + { + "selected": true, + "text": "10s", + "value": "10000" + }, + { + "selected": false, + "text": "30s", + "value": "20000" + }, + { + "selected": false, + "text": "1min", + "value": "60000" + }, + { + "selected": false, + "text": "5min", + "value": "300000" + }, + { + "selected": false, + "text": "10min", + "value": "600000" + } + ], + "multi": false, + "includeAll": false, + "hide": "dontHide", + "skipUrlSync": false, + "allowCustomValue": true + } + }, + { + "kind": "TextVariable", + "spec": { + "name": "width", + "current": { "text": "1.05", "value": "1.05" - } - ], - "query": "1.05", - "type": "textbox" + }, + "query": "1.05", + "label": "Order book width", + "hide": "dontHide", + "skipUrlSync": false, + "description": "2 <=> from 0.5x to 2x." + } }, { - "current": { - "text": "14718", - "value": "14718" - }, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "fdl2zuq913klcb" - }, - "definition": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o", - "includeAll": false, - "name": "timeOffset", - "options": [], - "query": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o", - "refresh": 1, - "regex": "", - "type": "query" + "kind": "QueryVariable", + "spec": { + "name": "timeOffset", + "current": { + "text": "14718", + "value": "14718" + }, + "hide": "dontHide", + "refresh": "onDashboardLoad", + "skipUrlSync": false, + "query": { + "kind": "DataQuery", + "group": "grafana-postgresql-datasource", + "version": "v0", + "datasource": { + "name": "fdl2zuq913klcb" + }, + "spec": { + "__legacyStringValue": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o" + } + }, + "regex": "", + "sort": "disabled", + "definition": "select (extract(EPOCH from current_timestamp) - extract(EPOCH from current_date + ( max(timestamp)/(1000*1000) * interval '1 millisecond')))::integer as delay from orders o", + "options": [], + "multi": false, + "includeAll": false, + "allowCustomValue": true + } } ] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": ["200ms", "500ms", "1s", "5s", "10s", "30s", "1m"] - }, - "timezone": "utc", - "title": "NASDAQ-Comparison", - "uid": "fbcc367d-c96a-4cb4-9efb-5a229527c4b9", - "version": 1 + } }