|
22 | 22 | "fiscalYearStartMonth": 0,
|
23 | 23 | "gnetId": null,
|
24 | 24 | "graphTooltip": 0,
|
25 |
| - "id": 11, |
26 |
| - "iteration": 1640146242595, |
| 25 | + "id": 23, |
| 26 | + "iteration": 1641288150895, |
27 | 27 | "links": [],
|
28 | 28 | "liveNow": false,
|
29 | 29 | "panels": [
|
|
55 | 55 | "title": "Cell",
|
56 | 56 | "type": "row"
|
57 | 57 | },
|
| 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 | + }, |
58 | 72 | {
|
59 | 73 | "datasource": "PostgreSQL-ckb",
|
60 | 74 | "fieldConfig": {
|
61 | 75 | "defaults": {
|
62 | 76 | "color": {
|
63 |
| - "mode": "palette-classic" |
| 77 | + "mode": "thresholds" |
64 | 78 | },
|
65 | 79 | "custom": {
|
66 |
| - "hideFrom": { |
67 |
| - "legend": false, |
68 |
| - "tooltip": false, |
69 |
| - "viz": false |
70 |
| - } |
| 80 | + "align": "auto", |
| 81 | + "displayMode": "auto" |
71 | 82 | },
|
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 | + } |
73 | 97 | },
|
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 | + ] |
75 | 124 | },
|
76 | 125 | "gridPos": {
|
77 |
| - "h": 9, |
| 126 | + "h": 8, |
78 | 127 | "w": 12,
|
79 | 128 | "x": 0,
|
80 |
| - "y": 2 |
| 129 | + "y": 3 |
81 | 130 | },
|
82 |
| - "id": 4, |
| 131 | + "id": 17, |
83 | 132 | "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": [] |
106 | 135 | },
|
| 136 | + "pluginVersion": "8.2.2", |
107 | 137 | "targets": [
|
108 | 138 | {
|
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", |
120 | 142 | "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", |
122 | 144 | "refId": "A",
|
123 | 145 | "select": [
|
124 | 146 | [
|
125 | 147 | {
|
126 | 148 | "params": [
|
127 |
| - "index" |
| 149 | + "value" |
128 | 150 | ],
|
129 | 151 | "type": "column"
|
130 |
| - }, |
131 |
| - { |
132 |
| - "params": [ |
133 |
| - "count" |
134 |
| - ], |
135 |
| - "type": "aggregate" |
136 |
| - }, |
137 |
| - { |
138 |
| - "params": [ |
139 |
| - "index" |
140 |
| - ], |
141 |
| - "type": "alias" |
142 | 152 | }
|
143 | 153 | ]
|
144 | 154 | ],
|
145 |
| - "table": "$network.cell", |
146 |
| - "timeColumn": "creating_time", |
147 |
| - "timeColumnType": "timestamp", |
| 155 | + "timeColumn": "time", |
148 | 156 | "where": [
|
149 | 157 | {
|
150 | 158 | "name": "$__timeFilter",
|
|
154 | 162 | ]
|
155 | 163 | }
|
156 | 164 | ],
|
157 |
| - "title": "Total Cells", |
158 |
| - "type": "piechart" |
| 165 | + "title": "Type Script", |
| 166 | + "transformations": [], |
| 167 | + "type": "table" |
159 | 168 | },
|
160 | 169 | {
|
161 | 170 | "datasource": "PostgreSQL-ckb",
|
162 | 171 | "fieldConfig": {
|
163 | 172 | "defaults": {
|
164 | 173 | "color": {
|
165 |
| - "mode": "palette-classic" |
| 174 | + "mode": "thresholds" |
166 | 175 | },
|
167 | 176 | "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" |
194 | 179 | },
|
195 | 180 | "mappings": [],
|
196 | 181 | "thresholds": {
|
|
207 | 192 | ]
|
208 | 193 | }
|
209 | 194 | },
|
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 | + ] |
211 | 221 | },
|
212 | 222 | "gridPos": {
|
213 |
| - "h": 9, |
| 223 | + "h": 8, |
214 | 224 | "w": 12,
|
215 | 225 | "x": 12,
|
216 |
| - "y": 2 |
| 226 | + "y": 3 |
217 | 227 | },
|
218 |
| - "id": 2, |
| 228 | + "id": 18, |
219 | 229 | "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": [] |
230 | 232 | },
|
| 233 | + "pluginVersion": "8.2.2", |
231 | 234 | "targets": [
|
232 | 235 | {
|
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", |
244 | 239 | "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", |
246 | 241 | "refId": "A",
|
247 | 242 | "select": [
|
248 | 243 | [
|
249 | 244 | {
|
250 | 245 | "params": [
|
251 |
| - "index" |
| 246 | + "value" |
252 | 247 | ],
|
253 | 248 | "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" |
273 | 249 | }
|
274 | 250 | ]
|
275 | 251 | ],
|
276 |
| - "table": "$network.cell", |
277 |
| - "timeColumn": "creating_time", |
278 |
| - "timeColumnType": "timestamp", |
| 252 | + "timeColumn": "time", |
279 | 253 | "where": [
|
280 | 254 | {
|
281 | 255 | "name": "$__timeFilter",
|
|
285 | 259 | ]
|
286 | 260 | }
|
287 | 261 | ],
|
288 |
| - "title": "Total Cells", |
289 |
| - "type": "timeseries" |
| 262 | + "title": "Lock Script", |
| 263 | + "type": "table" |
290 | 264 | }
|
291 | 265 | ],
|
292 |
| - "refresh": false, |
| 266 | + "refresh": "1d", |
293 | 267 | "schemaVersion": 31,
|
294 | 268 | "style": "dark",
|
295 | 269 | "tags": [],
|
|
298 | 272 | {
|
299 | 273 | "allValue": null,
|
300 | 274 | "current": {
|
301 |
| - "selected": false, |
302 |
| - "text": "ckb", |
303 |
| - "value": "ckb" |
| 275 | + "selected": true, |
| 276 | + "text": "ckb_testnet", |
| 277 | + "value": "ckb_testnet" |
304 | 278 | },
|
305 | 279 | "description": "CKB network name",
|
306 | 280 | "error": null,
|
|
311 | 285 | "name": "network",
|
312 | 286 | "options": [
|
313 | 287 | {
|
314 |
| - "selected": true, |
| 288 | + "selected": false, |
315 | 289 | "text": "ckb",
|
316 | 290 | "value": "ckb"
|
317 | 291 | },
|
318 | 292 | {
|
319 |
| - "selected": false, |
| 293 | + "selected": true, |
320 | 294 | "text": "ckb_testnet",
|
321 | 295 | "value": "ckb_testnet"
|
322 | 296 | }
|
323 | 297 | ],
|
324 | 298 | "query": "ckb,ckb_testnet",
|
| 299 | + "queryValue": "", |
325 | 300 | "skipUrlSync": false,
|
326 | 301 | "type": "custom"
|
327 | 302 | },
|
|
407 | 382 | "timezone": "",
|
408 | 383 | "title": "Cell",
|
409 | 384 | "uid": "zxreLM5nk",
|
410 |
| - "version": 4 |
| 385 | + "version": 7 |
411 | 386 | }
|
0 commit comments