Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 61bab20

Browse files
authored
chore: update dashboard (#75)
1 parent 864aa92 commit 61bab20

File tree

1 file changed

+125
-150
lines changed
  • docker/grafana/etc/grafana/provisioning/dashboards/CKB

1 file changed

+125
-150
lines changed

docker/grafana/etc/grafana/provisioning/dashboards/CKB/cell.json

Lines changed: 125 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"fiscalYearStartMonth": 0,
2323
"gnetId": null,
2424
"graphTooltip": 0,
25-
"id": 11,
26-
"iteration": 1640146242595,
25+
"id": 23,
26+
"iteration": 1641288150895,
2727
"links": [],
2828
"liveNow": false,
2929
"panels": [
@@ -55,96 +55,104 @@
5555
"title": "Cell",
5656
"type": "row"
5757
},
58+
{
59+
"collapsed": false,
60+
"datasource": null,
61+
"gridPos": {
62+
"h": 1,
63+
"w": 24,
64+
"x": 0,
65+
"y": 2
66+
},
67+
"id": 16,
68+
"panels": [],
69+
"title": "hash_type != \"type\"",
70+
"type": "row"
71+
},
5872
{
5973
"datasource": "PostgreSQL-ckb",
6074
"fieldConfig": {
6175
"defaults": {
6276
"color": {
63-
"mode": "palette-classic"
77+
"mode": "thresholds"
6478
},
6579
"custom": {
66-
"hideFrom": {
67-
"legend": false,
68-
"tooltip": false,
69-
"viz": false
70-
}
80+
"align": "auto",
81+
"displayMode": "auto"
7182
},
72-
"mappings": []
83+
"mappings": [],
84+
"thresholds": {
85+
"mode": "absolute",
86+
"steps": [
87+
{
88+
"color": "green",
89+
"value": null
90+
},
91+
{
92+
"color": "red",
93+
"value": 80
94+
}
95+
]
96+
}
7397
},
74-
"overrides": []
98+
"overrides": [
99+
{
100+
"matcher": {
101+
"id": "byName",
102+
"options": "type.code_hash"
103+
},
104+
"properties": [
105+
{
106+
"id": "custom.width",
107+
"value": 421
108+
}
109+
]
110+
},
111+
{
112+
"matcher": {
113+
"id": "byName",
114+
"options": "type.hash_type"
115+
},
116+
"properties": [
117+
{
118+
"id": "custom.width",
119+
"value": 111
120+
}
121+
]
122+
}
123+
]
75124
},
76125
"gridPos": {
77-
"h": 9,
126+
"h": 8,
78127
"w": 12,
79128
"x": 0,
80-
"y": 2
129+
"y": 3
81130
},
82-
"id": 4,
131+
"id": 17,
83132
"options": {
84-
"displayLabels": [
85-
"value"
86-
],
87-
"legend": {
88-
"displayMode": "table",
89-
"placement": "bottom",
90-
"values": [
91-
"percent",
92-
"value"
93-
]
94-
},
95-
"pieType": "pie",
96-
"reduceOptions": {
97-
"calcs": [
98-
"sum"
99-
],
100-
"fields": "",
101-
"values": false
102-
},
103-
"tooltip": {
104-
"mode": "single"
105-
}
133+
"showHeader": true,
134+
"sortBy": []
106135
},
136+
"pluginVersion": "8.2.2",
107137
"targets": [
108138
{
109-
"format": "time_series",
110-
"group": [
111-
{
112-
"params": [
113-
"$__interval",
114-
"none"
115-
],
116-
"type": "time"
117-
}
118-
],
119-
"metricColumn": "lock_code_hash",
139+
"format": "table",
140+
"group": [],
141+
"metricColumn": "none",
120142
"rawQuery": true,
121-
"rawSql": "SELECT\n $__timeGroupAlias(creating_time,$__interval),\n concat('_', lock_code_hash) AS metric,\n count(index) AS \"index\"\nFROM $network.cell\nWHERE\n $__timeFilter(creating_time) AND consuming_time IS NULL\nGROUP BY 1,2\nORDER BY 1,2",
143+
"rawSql": "WITH non_type_cells AS (\n SELECT * FROM $network.created_cell WHERE type_hash_type != 1 AND type_hash_type != 255\n)\nSELECT concat('_', type_code_hash) AS code_hash, type_hash_type AS hash_type, COUNT(*)\nFROM non_type_cells t1\nLEFT JOIN $network.spent_cell t2\nUSING (tx_hash, index)\nWHERE t2.tx_hash IS NULL\nGROUP BY type_code_hash, type_hash_type;\n\n",
122144
"refId": "A",
123145
"select": [
124146
[
125147
{
126148
"params": [
127-
"index"
149+
"value"
128150
],
129151
"type": "column"
130-
},
131-
{
132-
"params": [
133-
"count"
134-
],
135-
"type": "aggregate"
136-
},
137-
{
138-
"params": [
139-
"index"
140-
],
141-
"type": "alias"
142152
}
143153
]
144154
],
145-
"table": "$network.cell",
146-
"timeColumn": "creating_time",
147-
"timeColumnType": "timestamp",
155+
"timeColumn": "time",
148156
"where": [
149157
{
150158
"name": "$__timeFilter",
@@ -154,43 +162,20 @@
154162
]
155163
}
156164
],
157-
"title": "Total Cells",
158-
"type": "piechart"
165+
"title": "Type Script",
166+
"transformations": [],
167+
"type": "table"
159168
},
160169
{
161170
"datasource": "PostgreSQL-ckb",
162171
"fieldConfig": {
163172
"defaults": {
164173
"color": {
165-
"mode": "palette-classic"
174+
"mode": "thresholds"
166175
},
167176
"custom": {
168-
"axisLabel": "",
169-
"axisPlacement": "auto",
170-
"barAlignment": 0,
171-
"drawStyle": "line",
172-
"fillOpacity": 0,
173-
"gradientMode": "none",
174-
"hideFrom": {
175-
"legend": false,
176-
"tooltip": false,
177-
"viz": false
178-
},
179-
"lineInterpolation": "linear",
180-
"lineWidth": 1,
181-
"pointSize": 5,
182-
"scaleDistribution": {
183-
"type": "linear"
184-
},
185-
"showPoints": "auto",
186-
"spanNulls": false,
187-
"stacking": {
188-
"group": "A",
189-
"mode": "none"
190-
},
191-
"thresholdsStyle": {
192-
"mode": "off"
193-
}
177+
"align": "auto",
178+
"displayMode": "auto"
194179
},
195180
"mappings": [],
196181
"thresholds": {
@@ -207,75 +192,64 @@
207192
]
208193
}
209194
},
210-
"overrides": []
195+
"overrides": [
196+
{
197+
"matcher": {
198+
"id": "byName",
199+
"options": "type.code_hash"
200+
},
201+
"properties": [
202+
{
203+
"id": "custom.width",
204+
"value": 421
205+
}
206+
]
207+
},
208+
{
209+
"matcher": {
210+
"id": "byName",
211+
"options": "type.hash_type"
212+
},
213+
"properties": [
214+
{
215+
"id": "custom.width",
216+
"value": 111
217+
}
218+
]
219+
}
220+
]
211221
},
212222
"gridPos": {
213-
"h": 9,
223+
"h": 8,
214224
"w": 12,
215225
"x": 12,
216-
"y": 2
226+
"y": 3
217227
},
218-
"id": 2,
228+
"id": 18,
219229
"options": {
220-
"legend": {
221-
"calcs": [
222-
"mean"
223-
],
224-
"displayMode": "table",
225-
"placement": "bottom"
226-
},
227-
"tooltip": {
228-
"mode": "single"
229-
}
230+
"showHeader": true,
231+
"sortBy": []
230232
},
233+
"pluginVersion": "8.2.2",
231234
"targets": [
232235
{
233-
"format": "time_series",
234-
"group": [
235-
{
236-
"params": [
237-
"$__interval",
238-
"none"
239-
],
240-
"type": "time"
241-
}
242-
],
243-
"metricColumn": "lock_code_hash",
236+
"format": "table",
237+
"group": [],
238+
"metricColumn": "none",
244239
"rawQuery": true,
245-
"rawSql": "SELECT\n $__timeGroupAlias(creating_time,$__interval),\n lock_code_hash AS metric,\n avg(count(index)) OVER (PARTITION BY lock_code_hash ORDER BY $__timeGroup(creating_time,$__interval) ROWS 5 PRECEDING) AS \"index\"\nFROM $network.cell\nWHERE\n $__timeFilter(creating_time) AND consuming_time IS NULL\nGROUP BY 1,2\nORDER BY 1,2",
240+
"rawSql": "WITH non_type_cells AS (\n SELECT * FROM $network.created_cell WHERE lock_hash_type != 1 AND lock_hash_type != 255\n)\nSELECT concat('_', lock_code_hash) AS code_hash, lock_hash_type AS hash_type, COUNT(*)\nFROM non_type_cells t1\nLEFT JOIN $network.spent_cell t2\nUSING (tx_hash, index)\nWHERE t2.tx_hash IS NULL\nGROUP BY lock_code_hash, lock_hash_type;\n",
246241
"refId": "A",
247242
"select": [
248243
[
249244
{
250245
"params": [
251-
"index"
246+
"value"
252247
],
253248
"type": "column"
254-
},
255-
{
256-
"params": [
257-
"count"
258-
],
259-
"type": "aggregate"
260-
},
261-
{
262-
"params": [
263-
"avg",
264-
"5"
265-
],
266-
"type": "moving_window"
267-
},
268-
{
269-
"params": [
270-
"index"
271-
],
272-
"type": "alias"
273249
}
274250
]
275251
],
276-
"table": "$network.cell",
277-
"timeColumn": "creating_time",
278-
"timeColumnType": "timestamp",
252+
"timeColumn": "time",
279253
"where": [
280254
{
281255
"name": "$__timeFilter",
@@ -285,11 +259,11 @@
285259
]
286260
}
287261
],
288-
"title": "Total Cells",
289-
"type": "timeseries"
262+
"title": "Lock Script",
263+
"type": "table"
290264
}
291265
],
292-
"refresh": false,
266+
"refresh": "1d",
293267
"schemaVersion": 31,
294268
"style": "dark",
295269
"tags": [],
@@ -298,9 +272,9 @@
298272
{
299273
"allValue": null,
300274
"current": {
301-
"selected": false,
302-
"text": "ckb",
303-
"value": "ckb"
275+
"selected": true,
276+
"text": "ckb_testnet",
277+
"value": "ckb_testnet"
304278
},
305279
"description": "CKB network name",
306280
"error": null,
@@ -311,17 +285,18 @@
311285
"name": "network",
312286
"options": [
313287
{
314-
"selected": true,
288+
"selected": false,
315289
"text": "ckb",
316290
"value": "ckb"
317291
},
318292
{
319-
"selected": false,
293+
"selected": true,
320294
"text": "ckb_testnet",
321295
"value": "ckb_testnet"
322296
}
323297
],
324298
"query": "ckb,ckb_testnet",
299+
"queryValue": "",
325300
"skipUrlSync": false,
326301
"type": "custom"
327302
},
@@ -407,5 +382,5 @@
407382
"timezone": "",
408383
"title": "Cell",
409384
"uid": "zxreLM5nk",
410-
"version": 4
385+
"version": 7
411386
}

0 commit comments

Comments
 (0)