Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dropdown for adjusted NC option #63

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 48 additions & 13 deletions dashboards/blockchain/nakamoto-coefficient.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"textMode": "auto"
},
"pluginVersion": "9.3.2",
"pluginVersion": "10.0.1",
"targets": [
{
"datasource": {
Expand All @@ -82,7 +82,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt50))",
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt50${adjusted_nc}}))",
"instant": true,
"legendFormat": "__auto",
"range": false,
Expand Down Expand Up @@ -178,7 +178,7 @@
"uid": "PB06BBC9CA81C548D"
},
"editorMode": "code",
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt51))",
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt51${adjusted_nc}}))",
"legendFormat": "Nakamoto Coefficient (>=51%)",
"range": true,
"refId": "A"
Expand All @@ -189,7 +189,7 @@
"uid": "PB06BBC9CA81C548D"
},
"editorMode": "code",
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt50))",
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt50${adjusted_nc}}))",
"hide": false,
"legendFormat": "Nakamoto Coefficient (>=50%)",
"range": true,
Expand Down Expand Up @@ -244,7 +244,7 @@
},
"textMode": "auto"
},
"pluginVersion": "9.3.2",
"pluginVersion": "10.0.1",
"targets": [
{
"datasource": {
Expand All @@ -253,7 +253,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt51))",
"expr": "sum without(cluster, application, container, endpoint, instance, job, namespace, pod, service, region) (topk(1, chia_block_metrics_nakamoto_coefficient_gt51${adjusted_nc}}))",
"instant": true,
"legendFormat": "__auto",
"range": false,
Expand All @@ -275,7 +275,9 @@
},
"custom": {
"align": "auto",
"displayMode": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
Expand Down Expand Up @@ -352,7 +354,9 @@
},
"id": 7,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
Expand All @@ -362,7 +366,7 @@
"showHeader": true,
"sortBy": []
},
"pluginVersion": "9.3.2",
"pluginVersion": "10.0.1",
"targets": [
{
"dataset": "blocks",
Expand All @@ -373,7 +377,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "select \n\trow_number() over (order by count(*) desc, farmer_address asc) as number,\n\tfarmer_address as \"Farmer Address\", \n\tcount(*) as Count, \n\tcount(*)/322.56 as Percent,\n\tsum(count(*)) over (order by count(*) desc, farmer_address asc) as \"Cumulative Count\",\n\tsum(count(*)) over (order by count(*) desc, farmer_address asc) / 322.56 as \"Cumulative Percent\"\nfrom blocks \nwhere height >= ((select height from blocks order by height desc limit 1)-32256) \ngroup by farmer_address order by count DESC, farmer_address ASC limit 250;\n",
"rawSql": "select \n\trow_number() over (order by count(*) desc, farmer_address asc) as number,\n\tfarmer_address as \"Farmer Address\", \n\tcount(*) as Count, \n\tcount(*)/322.56 as Percent,\n\tsum(count(*)) over (order by count(*) desc, farmer_address asc) as \"Cumulative Count\",\n\tsum(count(*)) over (order by count(*) desc, farmer_address asc) / 322.56 as \"Cumulative Percent\"\nfrom blocks \nwhere height >= ((select height from blocks order by height desc limit 1)-32256) \nAND (\n CASE \n WHEN '$adjusted_nc' = '_adjusted{' AND farmer_address NOT IN ('xch183rqja3f2ak4f72w9enc88v0788vjp5ns3c2n2sctxpcnewzh2yqtcu2rs') THEN 1\n WHEN '$adjusted_nc' = '{' THEN 1\n ELSE 0\n END = 1\n)\ngroup by farmer_address order by count DESC, farmer_address ASC limit 250;\n",
"refId": "A",
"sql": {
"columns": [
Expand Down Expand Up @@ -404,14 +408,45 @@
"type": "table"
}
],
"refresh": false,
"schemaVersion": 37,
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"tags": [
"blockchain"
],
"templating": {
"list": []
"list": [
{
"allValue": "�",
"current": {
"selected": true,
"text": "Default",
"value": "{"
},
"description": "Adjusted NC accounts for alternate farmer/harvester implementations that redirect a portion of farmer rewards to the developer's address. The default NC view shows these dev addresses as large farmers, but since the individual farmers sign their own blocks, the Adjusted NC removes these dev addresses from the calculations.",
"hide": 0,
"includeAll": false,
"label": "Adjusted NC",
"multi": false,
"name": "adjusted_nc",
"options": [
{
"selected": true,
"text": "Default",
"value": "{"
},
{
"selected": false,
"text": "Adjusted",
"value": "_adjusted{"
}
],
"query": "Default : {,Adjusted : _adjusted{",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
}
]
},
"time": {
"from": "now-6h",
Expand All @@ -421,6 +456,6 @@
"timezone": "",
"title": "Nakamoto Coefficient",
"uid": "6S16D9AVk",
"version": 3,
"version": 9,
"weekStart": ""
}
Loading