diff --git a/README.md b/README.md index 67dbf9e..368b96d 100644 --- a/README.md +++ b/README.md @@ -55,22 +55,22 @@ Telegraf inputs configurations are stored in [telegraf](telegraf) directory. You command: ``` -docker run --rm -e "MINER_ADDRESS=${MINER_ADDRESS}" \ +docker run --rm -e "MINER_ADDRESS=${MINER_ADDRESS}" -e "COIN=${COIN}" \ -v "${PWD}/docker/telegraf.conf:/etc/telegraf/telegraf.conf:ro" -v "${PWD}/telegraf:/etc/telegraf/telegraf.d:ro" \ - telegraf:1.18.2 telegraf -test -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d + telegraf:1.19.2 telegraf -test -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d ``` Example: ``` -2021-02-02T14:39:57Z I! Starting Telegraf 1.15.4 -> currencies,from=ETH,host=docker,to=EUR value=1171.49 1612276798000000000 -> currencies,from=ETH,host=docker,to=USD value=1411.03 1612276798000000000 -> flexpool_balance,host=docker,miner=0x3e2251567f87E4B6a3927158AF9c678ECa87a337 result=69375170480923064 1612276798000000000 -> flexpool_workers,host=docker,miner=0x3e2251567f87E4B6a3927158AF9c678ECa87a337,name=rig1 effective_hashrate=86666666,invalid_shares=0,reported_hashrate=96304517,stale_shares=3,valid_shares=2008 1612276798000000000 -> flexpool_daily_revenue_estimation,host=docker,miner=0x3e2251567f87E4B6a3927158AF9c678ECa87a337 result=6710141993155250 1612276798000000000 -> flexpool_paid,host=docker,miner=0x3e2251567f87E4B6a3927158AF9c678ECa87a337 result=0 1612276798000000000 -> flexpool_stats,host=docker,miner=0x3e2251567f87E4B6a3927158AF9c678ECa87a337 current_effective_hashrate=86666666,current_reported_hashrate=96304517,daily_effective_hashrate=92962962.625,daily_invalid_shares=0,daily_reported_hashrate=96286435.27777778,daily_stale_shares=3,daily_valid_shares=2008 1612276798000000000 +2021-08-18T09:05:45Z I! Starting Telegraf 1.19.2 +> flexpool_pool_workers_count,coin=eth,host=docker result=43022 1629277546000000000 +> flexpool_pool_blocks,coin=eth,host=docker,miner=0x80072FDaB52a9BED1f77A4f47CE8590eCF2d69Dd difficulty=8038304869759675,luck=0.2723280636238729,mevReward=74193593913914900,number=13046195,reward=2244945505143161600,roundTime=266,staticBlockReward=2000000000000000000,txFeeReward=170751911229246620 1629248941000000000 +> flexpool_pool_blocks,coin=eth,host=docker,miner=0xc0224A1F6B7296598a09746b4106612562248F02 difficulty=8018674568139472,luck=0.9997781967425715,mevReward=0,number=13046171,reward=2093729787481399800,roundTime=969,staticBlockReward=2000000000000000000,txFeeReward=93729787481399740 1629248676000000000 +> flexpool_pool_blocks,coin=eth,host=docker,miner=0xbe6Fa3d44e4fD10fE05d8e90fD820d1f16EEd9e2 difficulty=8069770590952829,luck=0.7709800334318287,mevReward=56831219018865630,number=13046106,reward=2162018055750582000,roundTime=753,staticBlockReward=2000000000000000000,txFeeReward=105186836731716500 1629247706000000000 +> flexpool_pool_blocks,coin=eth,host=docker,miner=0xbF846283Ab2BE655844807FB9DbA086AF202a4d2 difficulty=8046149393032298,luck=1.4665340430067546,mevReward=29415246569886180,number=13046045,reward=2072298444980926500,roundTime=1425,staticBlockReward=2000000000000000000,txFeeReward=42883198411040420 1629246953000000000 +> flexpool_pool_blocks,coin=eth,host=docker,miner=0xdF44B7Dce392a0267f315c2c7711200c9620981C difficulty=8050114629713925,luck=1.66199322809835,mevReward=0,number=13045942,reward=2141479945370403800,roundTime=1612,staticBlockReward=2000000000000000000,txFeeReward=141479945370403760 1629245528000000000 +> flexpool_pool_blocks,coin=eth,host=docker,miner=0xE1E5372F00Fe6b05FD89c8110D4a29b29B916a7d difficulty=8109240971665971,luck=0.9366252682018412,mevReward=15080560933545792,number=13045830,reward=2088916235271470600,roundTime=918,staticBlockReward=2000000000000000000,txFeeReward=73835674337924700 1629243916000000000 ``` Once you are confident with your configuration, reload the container: diff --git a/docker-compose.yml b/docker-compose.yml index 4fa891a..69d2ae2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,7 @@ services: entrypoint: telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d env_file: - ./docker/environment - image: telegraf:1.18.2 + image: telegraf:1.19.2 volumes: - ./docker/telegraf.conf:/etc/telegraf/telegraf.conf - ./telegraf:/etc/telegraf/telegraf.d diff --git a/docker/environment.example b/docker/environment.example index c69c466..2e3587f 100644 --- a/docker/environment.example +++ b/docker/environment.example @@ -1,4 +1,5 @@ MINER_ADDRESS= +COIN= HIVEOS_TOKEN= ETHERSCAN_TOKEN= ETHGASSTATION_TOKEN= diff --git a/grafana/flexpool-miners.json b/grafana/flexpool-miners.json index 84bf7cf..930b194 100644 --- a/grafana/flexpool-miners.json +++ b/grafana/flexpool-miners.json @@ -59,7 +59,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1617949390461, + "iteration": 1629269857941, "links": [], "panels": [ { @@ -88,7 +88,32 @@ "custom": {}, "links": [] }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -133,7 +158,7 @@ "steppedLine": false, "targets": [ { - "alias": "revenue", + "alias": "revenue (ETH)", "groupBy": [ { "params": [ @@ -145,7 +170,7 @@ "measurement": "flexpool_miner_balance", "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(balance_increase)/1000000000000000000 FROM (select non_negative_difference(\"result\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND $timeFilter) GROUP BY time(1d) TZ('$timezone');", + "query": "SELECT sum(balance_increase)/1000000000000000000 FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND \"coin\" = 'eth' AND $timeFilter) GROUP BY time(1d) TZ('$timezone');", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -201,7 +226,7 @@ ], "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(balance_increase)/1000000000000000000*$exchange_rate FROM (select non_negative_difference(\"result\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND $timeFilter) GROUP BY time(1d) TZ('$timezone');", + "query": "SELECT sum(balance_increase)/1000000000000000000*$exchange_rate FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND \"coin\" = 'eth' AND $timeFilter) GROUP BY time(1d) TZ('$timezone');", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -220,6 +245,95 @@ ] ], "tags": [] + }, + { + "alias": "revenue (XCH)", + "groupBy": [ + { + "params": [ + "1d" + ], + "type": "time" + } + ], + "measurement": "flexpool_miner_balance", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(balance_increase)/1000000000000 FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND \"coin\" = 'xch' AND $timeFilter) GROUP BY time(1d) TZ('$timezone');", + "rawQuery": true, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "result" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1d" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + " / 1000000000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + } + ] + }, + { + "alias": "revenue (fiat)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(balance_increase)/1000000000000*$exchange_rate FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND \"coin\" = 'xch' AND $timeFilter) GROUP BY time(1d) TZ('$timezone');", + "rawQuery": true, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], "thresholds": [], @@ -244,7 +358,7 @@ { "$$hashKey": "object:180", "decimals": 5, - "format": "ETH", + "format": "XCH", "label": "income", "logBase": 1, "max": null, @@ -321,7 +435,7 @@ "groupBy": [ { "params": [ - "$__interval" + "1d" ], "type": "time" }, @@ -332,17 +446,18 @@ "type": "fill" } ], + "measurement": "flexpool_pool_blocks_chart", "orderByTime": "ASC", "policy": "default", "query": "SELECT sum(blocks_increase) FROM (select non_negative_difference(\"confirmed\") AS blocks_increase FROM \"flexpool_pool_block_count\" WHERE $timeFilter) GROUP BY time(1d) TZ('$timezone');", - "rawQuery": true, + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "blockCount" ], "type": "field" }, @@ -352,7 +467,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -412,7 +533,32 @@ "custom": {}, "links": [] }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -457,7 +603,7 @@ "steppedLine": false, "targets": [ { - "alias": "revenue", + "alias": "revenue (XCH)", "groupBy": [ { "params": [ @@ -469,7 +615,7 @@ "measurement": "flexpool_miner_balance", "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(balance_increase)/1000000000000000000 FROM (select non_negative_difference(\"result\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND $timeFilter) GROUP BY time(30d) TZ('$timezone');", + "query": "SELECT sum(balance_increase)/1000000000000000000 FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND coin = 'xch' AND $timeFilter) GROUP BY time(30d) TZ('$timezone');", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -525,7 +671,7 @@ ], "orderByTime": "ASC", "policy": "default", - "query": "SELECT sum(balance_increase)/1000000000000000000*$exchange_rate FROM (select non_negative_difference(\"result\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND $timeFilter) GROUP BY time(30d) TZ('$timezone');", + "query": "SELECT sum(balance_increase)/1000000000000000000*$exchange_rate FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND coin = 'xch' AND $timeFilter) GROUP BY time(30d) TZ('$timezone');", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -544,6 +690,96 @@ ] ], "tags": [] + }, + { + "alias": "revenue (ETH)", + "groupBy": [ + { + "params": [ + "30d" + ], + "type": "time" + } + ], + "measurement": "flexpool_miner_balance", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(balance_increase)/1000000000000000000 FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND coin = 'eth' AND $timeFilter) GROUP BY time(30d) TZ('$timezone');", + "rawQuery": true, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "result" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "30d" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + " / 1000000000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + } + ] + }, + { + "alias": "revenue (fiat)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "hide": false, + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT sum(balance_increase)/1000000000000000000 *$exchange_rate FROM (select non_negative_difference(\"balance\") AS balance_increase FROM \"flexpool_miner_balance\" WHERE \"miner\" =~ /^$miner$/ AND coin = 'eth' AND $timeFilter) GROUP BY time(30d) TZ('$timezone');", + "rawQuery": true, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [] } ], "thresholds": [], @@ -569,7 +805,7 @@ { "$$hashKey": "object:180", "decimals": 5, - "format": "ETH", + "format": "XCH", "label": "income", "logBase": 1, "max": null, @@ -645,7 +881,7 @@ "groupBy": [ { "params": [ - "$__interval" + "31d" ], "type": "time" }, @@ -656,27 +892,34 @@ "type": "fill" } ], + "measurement": "flexpool_pool_blocks_chart", "orderByTime": "ASC", "policy": "default", "query": "SELECT sum(blocks_increase) FROM (select non_negative_difference(\"confirmed\") AS blocks_increase FROM \"flexpool_pool_block_count\" WHERE $timeFilter) GROUP BY time(30d) TZ('$timezone');", - "rawQuery": true, + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "blockCount" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "sum" } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -735,7 +978,32 @@ "custom": {}, "links": [] }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -781,7 +1049,7 @@ "steppedLine": false, "targets": [ { - "alias": "balance", + "alias": "balance (XCH)", "groupBy": [ { "params": [ @@ -800,20 +1068,26 @@ "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "result" + "balance" ], "type": "field" }, { "params": [], "type": "mean" + }, + { + "params": [ + "/1000000000000" + ], + "type": "math" } ] ], @@ -822,6 +1096,12 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, @@ -841,27 +1121,160 @@ "type": "fill" } ], + "measurement": "flexpool_miner_balance", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, - "refId": "B", + "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "C", "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "balance" ], "type": "field" }, { "params": [], "type": "mean" + }, + { + "params": [ + "/1000000000000*$exchange_rate" + ], + "type": "math" } ] ], - "tags": [] + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "balance (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_balance", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"value\") FROM \"measurement\" WHERE $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "balance" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "/1000000000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "balance (fiat)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_balance", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "balance" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "/1000000000000000000*$exchange_rate" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] } ], "thresholds": [], @@ -886,7 +1299,7 @@ { "$$hashKey": "object:1341", "decimals": 5, - "format": "ETH", + "format": "XCH", "label": "balance", "logBase": 1, "max": null, @@ -966,7 +1379,7 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "balance", + "alias": "balance (XCH)", "groupBy": [], "measurement": "flexpool_miner_balance", "orderByTime": "ASC", @@ -979,7 +1392,95 @@ [ { "params": [ - "result" + "balance" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "/1000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "balance (fiat)", + "groupBy": [], + "measurement": "flexpool_miner_balance", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "balance" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "/1000000000000*$exchange_rate" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "balance (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_balance", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "balance" ], "type": "field" }, @@ -1000,6 +1501,12 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] }, @@ -1011,13 +1518,13 @@ "policy": "default", "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_balance\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", "rawQuery": false, - "refId": "B", + "refId": "D", "resultFormat": "time_series", "select": [ [ { "params": [ - "result" + "balance" ], "type": "field" }, @@ -1038,6 +1545,12 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] } @@ -1053,516 +1566,45 @@ "dashLength": 10, "dashes": false, "datasource": "${DS_INFLUXDB}", - "description": "", "fieldConfig": { "defaults": { "custom": {}, "links": [] }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 25 - }, - "hiddenSeries": false, - "id": 36, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "alertThreshold": true, - "dataLinks": [] - }, - "percentage": false, - "pluginVersion": "7.3.7", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [ - { - "$$hashKey": "object:596", - "alias": "revenue (fiat)", - "lines": false, - "yaxis": 2 - } - ], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "alias": "revenue", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"result\") FROM \"flexpool_miner_daily_revenue_estimation\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": false, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "/ 1000000000000000000" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - }, - { - "alias": "revenue (fiat)", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"result\") / 1000000000000000000 * $echange_rate FROM \"flexpool_miner_daily_revenue_estimation\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": false, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "/ 1000000000000000000 * $exchange_rate" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Estimated daily revenue", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:442", - "decimals": 5, - "format": "ETH", - "label": null, - "logBase": 1, - "max": null, - "min": "0", - "show": true - }, - { - "$$hashKey": "object:443", - "decimals": 2, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "datasource": "${DS_INFLUXDB}", - "fieldConfig": { - "defaults": { - "custom": {}, - "decimals": 5, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 0.00001 - } - ] - }, - "unit": "ETH" - }, "overrides": [ { "matcher": { "id": "byRegexp", - "options": ".*fiat.*" + "options": "/XCH/" }, "properties": [ { "id": "unit", - "value": "short" - }, + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ { - "id": "decimals", - "value": 2 + "id": "unit", + "value": "ETH" } ] } ] }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 25 - }, - "hideTimeOverride": true, - "id": 70, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "7.3.7", - "targets": [ - { - "alias": "daily", - "groupBy": [], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_daily_revenue_estimation\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": false, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "/1000000000000000000" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - }, - { - "alias": "weekly", - "groupBy": [], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "/1000000000000000000*7" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - }, - { - "alias": "monthly", - "groupBy": [], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "/1000000000000000000*30" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - }, - { - "alias": "daily (fiat)", - "groupBy": [], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"value\") FROM \"measurement\" WHERE $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": false, - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "/1000000000000000000 * $exchange_rate" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - }, - { - "alias": "weekly (fiat)", - "groupBy": [], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "/1000000000000000000*7*$exchange_rate" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - }, - { - "alias": "monthly (fiat)", - "groupBy": [], - "measurement": "flexpool_miner_daily_revenue_estimation", - "orderByTime": "ASC", - "policy": "default", - "refId": "F", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "result" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - }, - { - "params": [ - "/1000000000000000000*30*$exchange_rate" - ], - "type": "math" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - } - ] - } - ], - "timeFrom": "5m", - "timeShift": null, - "title": "Estimated revenue", - "type": "stat" - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "${DS_INFLUXDB}", - "fieldConfig": { - "defaults": { - "custom": {}, - "links": [] - }, - "overrides": [] - }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 6, "x": 0, - "y": 33 + "y": 25 }, "hiddenSeries": false, "id": 40, @@ -1600,39 +1642,28 @@ "steppedLine": false, "targets": [ { - "alias": "paid", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], + "alias": "paid (XCH)", + "groupBy": [], "measurement": "flexpool_miner_paid", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "result" + "stats_totalPaid" ], "type": "field" }, { - "params": [], - "type": "mean" + "params": [ + "/1000000000000" + ], + "type": "math" } ] ], @@ -1641,6 +1672,12 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, @@ -1660,27 +1697,143 @@ "type": "fill" } ], + "measurement": "flexpool_miner_paid", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, + "rawQuery": false, "refId": "B", "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "stats_totalPaid" ], "type": "field" }, { "params": [], "type": "mean" + }, + { + "params": [ + " / 1000000000000 * $exchange_rate" + ], + "type": "math" } ] ], - "tags": [] + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "paid (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_paid", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "stats_totalPaid" + ], + "type": "field" + }, + { + "params": [ + "/1000000000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "paid (fiat)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_paid", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "stats_totalPaid" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + " / 1000000000000000000 * $exchange_rate" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] } ], "thresholds": [], @@ -1705,7 +1858,7 @@ { "$$hashKey": "object:722", "decimals": 5, - "format": "ETH", + "format": "XCH", "label": "paid", "logBase": 1, "max": null, @@ -1766,7 +1919,7 @@ "h": 8, "w": 6, "x": 6, - "y": 33 + "y": 25 }, "hideTimeOverride": true, "id": 42, @@ -1787,39 +1940,32 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "paid", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], + "alias": "paid (XCH)", + "groupBy": [], "measurement": "flexpool_miner_paid", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "result" + "stats_totalPaid" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "last" + }, + { + "params": [ + " / 1000000000000" + ], + "type": "math" } ] ], @@ -1828,46 +1974,138 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, { "alias": "paid (fiat)", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], + "groupBy": [], + "measurement": "flexpool_miner_paid", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", - "rawQuery": true, + "rawQuery": false, "refId": "B", "resultFormat": "time_series", "select": [ [ { "params": [ - "value" + "stats_totalPaid" + ], + "type": "field" + }, + { + "params": [ + " / 1000000000000*$exchange_rate" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "paid (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_paid", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000 FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "stats_totalPaid" ], "type": "field" }, { "params": [], - "type": "mean" + "type": "last" + }, + { + "params": [ + "/ 1000000000000000000" + ], + "type": "math" } ] ], - "tags": [] + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "paid (fiat)", + "groupBy": [], + "measurement": "flexpool_miner_paid", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"result\")/1000000000000000000*$exchange_rate FROM \"flexpool_miner_paid\" WHERE (\"miner\" =~ /^$miner$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "stats_totalPaid" + ], + "type": "field" + }, + { + "params": [ + " / 1000000000000000000*$exchange_rate" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] } ], "timeFrom": "5m", @@ -1901,8 +2139,20 @@ "overrides": [ { "matcher": { - "id": "byName", - "options": "amount" + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "decimals", + "value": 5 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" }, "properties": [ { @@ -1914,16 +2164,12 @@ { "matcher": { "id": "byName", - "options": "amount (fiat)" + "options": "paid (fiat)" }, "properties": [ { "id": "decimals", "value": 2 - }, - { - "id": "custom.width", - "value": null } ] }, @@ -1945,7 +2191,7 @@ "h": 8, "w": 12, "x": 12, - "y": 33 + "y": 25 }, "id": 64, "options": { @@ -1959,7 +2205,7 @@ "measurement": "flexpool_miner_payments", "orderByTime": "ASC", "policy": "default", - "query": "SELECT \"amount\"/1000000000000000000, \"amount\"/1000000000000000000*$exchange_rate as \"amount (fiat)\", \"duration\" FROM \"flexpool_miner_payments\" WHERE (\"miner\" =~ /^$miner$/) order by time desc limit 6", + "query": "SELECT \"value\" / 1000000000000 AS \"paid (XCH)\", \"value\" / 1000000000000 * $exchange_rate AS \"paid (fiat)\", \"duration\" FROM \"flexpool_miner_payments\" WHERE (\"miner\" =~ /^$miner$/ AND coin = 'xch') ORDER BY time DESC LIMIT 6", "rawQuery": true, "refId": "A", "resultFormat": "table", @@ -1967,9 +2213,100 @@ [ { "params": [ - "amount" + "value" ], "type": "field" + }, + { + "params": [ + " / 1000000000000" + ], + "type": "math" + }, + { + "params": [ + "paid" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + " / 1000000000000*$exchange_rate" + ], + "type": "math" + }, + { + "params": [ + "paid (fiat)" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + } + ] + }, + { + "groupBy": [], + "measurement": "flexpool_miner_payments", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT \"value\" / 1000000000000000000 AS \"paid (ETH)\", \"value\" / 1000000000000000000 * $exchange_rate AS \"paid (fiat)\", \"duration\" FROM \"flexpool_miner_payments\" WHERE (\"miner\" =~ /^$miner$/ AND coin = 'eth') ORDER BY time DESC LIMIT 6", + "rawQuery": true, + "refId": "B", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + " / 1000000000000" + ], + "type": "math" + }, + { + "params": [ + "paid" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "value" + ], + "type": "field" + }, + { + "params": [ + " / 1000000000000*$exchange_rate" + ], + "type": "math" + }, + { + "params": [ + "paid (fiat)" + ], + "type": "alias" } ] ], @@ -1994,7 +2331,7 @@ "h": 1, "w": 24, "x": 0, - "y": 41 + "y": 33 }, "id": 26, "panels": [], @@ -2027,7 +2364,32 @@ ] } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -2035,7 +2397,7 @@ "h": 8, "w": 12, "x": 0, - "y": 42 + "y": 34 }, "hiddenSeries": false, "id": 44, @@ -2066,7 +2428,7 @@ "steppedLine": false, "targets": [ { - "alias": "effective", + "alias": "effective (XCH)", "groupBy": [ { "params": [ @@ -2090,7 +2452,7 @@ [ { "params": [ - "current_effective_hashrate" + "currentEffectiveHashrate" ], "type": "field" }, @@ -2105,11 +2467,17 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, { - "alias": "reported", + "alias": "reported (XCH)", "groupBy": [ { "params": [ @@ -2133,7 +2501,7 @@ [ { "params": [ - "current_reported_hashrate" + "reportedHashrate" ], "type": "field" }, @@ -2148,11 +2516,17 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, { - "alias": "daily effective", + "alias": "average effective (XCH)", "groupBy": [ { "params": [ @@ -2176,7 +2550,7 @@ [ { "params": [ - "daily_effective_hashrate" + "averageEffectiveHashrate" ], "type": "field" }, @@ -2191,6 +2565,159 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "effective (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_stats", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "currentEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "reported (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_stats", + "orderByTime": "ASC", + "policy": "default", + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "reportedHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "average effective (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "previous" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_stats", + "orderByTime": "ASC", + "policy": "default", + "refId": "F", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "averageEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] } @@ -2202,7 +2729,7 @@ "title": "Hashrates", "tooltip": { "shared": true, - "sort": 0, + "sort": 2, "value_type": "individual" }, "type": "graph", @@ -2216,7 +2743,7 @@ "yaxes": [ { "$$hashKey": "object:154", - "format": "Hs", + "format": "bytes", "label": null, "logBase": 1, "max": null, @@ -2257,15 +2784,40 @@ } ] }, - "unit": "Hs" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "gridPos": { "h": 8, "w": 12, "x": 12, - "y": 42 + "y": 34 }, "hideTimeOverride": true, "id": 18, @@ -2286,7 +2838,7 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "effective", + "alias": "effective (XCH)", "groupBy": [], "measurement": "flexpool_miner_stats", "orderByTime": "ASC", @@ -2297,7 +2849,7 @@ [ { "params": [ - "current_effective_hashrate" + "currentEffectiveHashrate" ], "type": "field" }, @@ -2312,11 +2864,17 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, { - "alias": "reported", + "alias": "reported (XCH)", "groupBy": [], "measurement": "flexpool_miner_stats", "orderByTime": "ASC", @@ -2327,7 +2885,7 @@ [ { "params": [ - "current_reported_hashrate" + "reportedHashrate" ], "type": "field" }, @@ -2342,11 +2900,17 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" } ] }, { - "alias": "daily effective", + "alias": "average effective (XCH)", "groupBy": [], "measurement": "flexpool_miner_stats", "orderByTime": "ASC", @@ -2357,7 +2921,7 @@ [ { "params": [ - "daily_effective_hashrate" + "averageEffectiveHashrate" ], "type": "field" }, @@ -2372,6 +2936,120 @@ "key": "miner", "operator": "=~", "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "effective (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_stats", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "currentEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "reported (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_stats", + "orderByTime": "ASC", + "policy": "default", + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "reportedHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "average effective (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_stats", + "orderByTime": "ASC", + "policy": "default", + "refId": "F", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "averageEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] } @@ -2388,7 +3066,7 @@ "h": 1, "w": 24, "x": 0, - "y": 50 + "y": 42 }, "id": 14, "panels": [], @@ -2415,7 +3093,7 @@ "h": 8, "w": 12, "x": 0, - "y": 51 + "y": 43 }, "hiddenSeries": false, "id": 6, @@ -2442,14 +3120,17 @@ "renderer": "flot", "seriesOverrides": [ { + "$$hashKey": "object:2759", "alias": "valid", "color": "#56A64B" }, { + "$$hashKey": "object:2760", "alias": "stale", "color": "#F2CC0C" }, { + "$$hashKey": "object:2761", "alias": "invalid", "color": "#E02F44" } @@ -2483,7 +3164,7 @@ [ { "params": [ - "daily_valid_shares" + "validShares" ], "type": "field" }, @@ -2526,7 +3207,7 @@ [ { "params": [ - "daily_stale_shares" + "staleShares" ], "type": "field" }, @@ -2569,7 +3250,7 @@ [ { "params": [ - "daily_invalid_shares" + "invalidShares" ], "type": "field" }, @@ -2586,7 +3267,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Daily shares", + "title": "Shares", "tooltip": { "shared": true, "sort": 0, @@ -2602,6 +3283,7 @@ }, "yaxes": [ { + "$$hashKey": "object:2780", "format": "short", "label": null, "logBase": 1, @@ -2610,6 +3292,7 @@ "show": true }, { + "$$hashKey": "object:2781", "format": "short", "label": null, "logBase": 1, @@ -2649,7 +3332,7 @@ "h": 8, "w": 4, "x": 12, - "y": 51 + "y": 43 }, "hideTimeOverride": true, "id": 8, @@ -2681,7 +3364,7 @@ [ { "params": [ - "daily_valid_shares" + "validShares" ], "type": "field" }, @@ -2734,7 +3417,7 @@ "h": 8, "w": 4, "x": 16, - "y": 51 + "y": 43 }, "hideTimeOverride": true, "id": 10, @@ -2766,7 +3449,7 @@ [ { "params": [ - "daily_stale_shares" + "staleShares" ], "type": "field" }, @@ -2820,7 +3503,7 @@ "h": 8, "w": 4, "x": 20, - "y": 51 + "y": 43 }, "hideTimeOverride": true, "id": 12, @@ -2852,7 +3535,7 @@ [ { "params": [ - "daily_invalid_shares" + "invalidShares" ], "type": "field" }, @@ -2877,6 +3560,7 @@ "type": "stat" } ], + "refresh": false, "schemaVersion": 26, "style": "dark", "tags": [ @@ -2885,6 +3569,29 @@ ], "templating": { "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_INFLUXDB}", + "definition": "", + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "coin", + "options": [], + "query": "SHOW TAG VALUES FROM flexpool_miner_stats WITH KEY = \"coin\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, { "allValue": null, "current": {}, @@ -2897,7 +3604,7 @@ "multi": false, "name": "miner", "options": [], - "query": "SHOW TAG VALUES FROM flexpool_miner_stats WITH KEY = \"miner\"", + "query": "SHOW TAG VALUES FROM flexpool_miner_stats WITH KEY = \"miner\" WHERE \"coin\" = '$coin'", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -2935,7 +3642,7 @@ "allValue": null, "current": {}, "datasource": "${DS_INFLUXDB}", - "definition": "select value from currencies where \"to\" =~ /^$currency$/ order by desc limit 1", + "definition": "", "error": null, "hide": 2, "includeAll": false, @@ -2943,7 +3650,7 @@ "multi": false, "name": "exchange_rate", "options": [], - "query": "select value from currencies where \"to\" =~ /^$currency$/ order by desc limit 1", + "query": "select value from currencies where \"to\" =~ /^$currency$/ and \"from\" =~ /^(?i)$coin$/ order by desc limit 1", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -3116,5 +3823,5 @@ "timezone": "utc", "title": "Flexpool miners", "uid": "Q3JPASkgz", - "version": 6 + "version": 21 } \ No newline at end of file diff --git a/grafana/flexpool-pool.json b/grafana/flexpool-pool.json index b1f8d8e..de7bdf1 100644 --- a/grafana/flexpool-pool.json +++ b/grafana/flexpool-pool.json @@ -53,7 +53,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1617517178341, + "iteration": 1629216495656, "links": [], "panels": [ { @@ -80,7 +80,32 @@ "defaults": { "custom": {} }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -118,7 +143,7 @@ "steppedLine": false, "targets": [ { - "alias": "total", + "alias": "total (ETH)", "groupBy": [ { "params": [ @@ -152,7 +177,70 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "total (XCH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT mean(\"total\") FROM \"flexpool_pool_hashrate\" WHERE (\"coin\" = 'xch' AND \"coin\" =~ /^$coin$/) AND $timeFilter GROUP BY time($__interval) fill(null)", + "rawQuery": false, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -213,9 +301,34 @@ } ] }, - "unit": "Hs" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "gridPos": { "h": 9, @@ -241,7 +354,7 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "total", + "alias": "total (XCH)", "groupBy": [], "measurement": "flexpool_pool_hashrate", "orderByTime": "ASC", @@ -262,7 +375,55 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "total (ETH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "total" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -281,7 +442,32 @@ "defaults": { "custom": {} }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -319,118 +505,7 @@ "steppedLine": false, "targets": [ { - "alias": "eu", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_pool_hashrate", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "eu" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - }, - { - "alias": "us", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_pool_hashrate", - "orderByTime": "ASC", - "policy": "default", - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "us" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - }, - { - "alias": "sa", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_pool_hashrate", - "orderByTime": "ASC", - "policy": "default", - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "sa" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [] - }, - { - "alias": "as", + "alias": "as (XCH)", "groupBy": [ { "params": [ @@ -454,7 +529,7 @@ [ { "params": [ - "as" + "regions_as" ], "type": "field" }, @@ -464,10 +539,22 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] }, { - "alias": "au", + "alias": "au (XCH)", "groupBy": [ { "params": [ @@ -491,7 +578,7 @@ [ { "params": [ - "au" + "regions_au" ], "type": "field" }, @@ -501,7 +588,411 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "eu (XCH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_eu" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "sa (XCH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_sa" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "us (XCH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_us" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "as (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "F", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_as" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "au (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "G", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_au" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "eu (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "H", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_eu" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "sa (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "I", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_sa" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "us (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "J", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_us" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -563,9 +1054,34 @@ } ] }, - "unit": "Hs" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "gridPos": { "h": 9, @@ -591,79 +1107,7 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "eu", - "groupBy": [], - "measurement": "flexpool_pool_hashrate", - "orderByTime": "ASC", - "policy": "default", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "eu" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - } - ] - ], - "tags": [] - }, - { - "alias": "us", - "groupBy": [], - "measurement": "flexpool_pool_hashrate", - "orderByTime": "ASC", - "policy": "default", - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "us" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - } - ] - ], - "tags": [] - }, - { - "alias": "sa", - "groupBy": [], - "measurement": "flexpool_pool_hashrate", - "orderByTime": "ASC", - "policy": "default", - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "sa" - ], - "type": "field" - }, - { - "params": [], - "type": "last" - } - ] - ], - "tags": [] - }, - { - "alias": "as", + "alias": "as (XCH)", "groupBy": [], "measurement": "flexpool_pool_hashrate", "orderByTime": "ASC", @@ -674,7 +1118,7 @@ [ { "params": [ - "as" + "regions_as" ], "type": "field" }, @@ -684,10 +1128,22 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] }, { - "alias": "au", + "alias": "au (XCH)", "groupBy": [], "measurement": "flexpool_pool_hashrate", "orderByTime": "ASC", @@ -698,7 +1154,7 @@ [ { "params": [ - "au" + "regions_au" ], "type": "field" }, @@ -708,7 +1164,307 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "eu (XCH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_eu" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "sa (XCH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_sa" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "us (XCH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "E", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_us" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "as (ETH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "F", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_as" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "au (ETH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "G", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_au" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "eu (ETH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "H", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_eu" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "sa (ETH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "I", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_sa" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "us (ETH)", + "groupBy": [], + "measurement": "flexpool_pool_hashrate", + "orderByTime": "ASC", + "policy": "default", + "refId": "J", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "regions_us" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -794,7 +1550,7 @@ "type": "fill" } ], - "measurement": "flexpool_pool_miners_online", + "measurement": "flexpool_pool_miners_count", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -813,7 +1569,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -904,7 +1666,7 @@ { "alias": "online miners", "groupBy": [], - "measurement": "flexpool_pool_miners_online", + "measurement": "flexpool_pool_miners_count", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -923,7 +1685,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -994,7 +1762,7 @@ "type": "fill" } ], - "measurement": "flexpool_pool_workers_online", + "measurement": "flexpool_pool_workers_count", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1013,7 +1781,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -1103,7 +1877,7 @@ { "alias": "online workers", "groupBy": [], - "measurement": "flexpool_pool_workers_online", + "measurement": "flexpool_pool_workers_count", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1122,7 +1896,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -1193,40 +1973,31 @@ "targets": [ { "alias": "count", - "groupBy": [ - { - "params": [ - "1d" - ], - "type": "time" - }, - { - "params": [ - "linear" - ], - "type": "fill" - } - ], - "measurement": "flexpool_pool_blocks", + "groupBy": [], + "measurement": "flexpool_pool_blocks_chart", "orderByTime": "ASC", "policy": "default", + "query": "SELECT \"blockCount\" FROM \"flexpool_pool_blocks_chart\" WHERE (\"coin\" =~ /^$coin$/) AND $timeFilter tz('$timezone')", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "number" + "blockCount" ], "type": "field" - }, - { - "params": [], - "type": "count" } ] ], - "tags": [], + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ], "tz": "$timezone" } ], @@ -1286,10 +2057,6 @@ { "color": "green", "value": null - }, - { - "color": "red", - "value": 80 } ] } @@ -1322,21 +2089,8 @@ "targets": [ { "alias": "blocks", - "groupBy": [ - { - "params": [ - "1d" - ], - "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_pool_blocks", + "groupBy": [], + "measurement": "flexpool_pool_blocks_chart", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1345,17 +2099,23 @@ [ { "params": [ - "number" + "blockCount" ], "type": "field" }, { "params": [], - "type": "count" + "type": "mean" } ] ], - "tags": [], + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ], "tz": "$timezone" } ], @@ -1374,7 +2134,32 @@ "defaults": { "custom": {} }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -1412,7 +2197,7 @@ "steppedLine": false, "targets": [ { - "alias": "Block reward", + "alias": "Block reward (ETH)", "groupBy": [ { "params": [ @@ -1436,7 +2221,7 @@ [ { "params": [ - "total_rewards" + "reward" ], "type": "field" }, @@ -1452,7 +2237,74 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "Block reward (XCH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "linear" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_blocks", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "reward" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + " / 1000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -1512,16 +2364,61 @@ { "color": "green", "value": null - }, - { - "color": "red", - "value": 80 } ] }, - "unit": "ETH" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "decimals", + "value": 5 + } + ] + } + ] }, "gridPos": { "h": 8, @@ -1547,7 +2444,7 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "rewards", + "alias": "rewards (XCH)", "groupBy": [ { "params": [ @@ -1571,7 +2468,62 @@ [ { "params": [ - "total_rewards" + "reward" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "/ 1000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] + }, + { + "alias": "rewards (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_blocks", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "reward" ], "type": "field" }, @@ -1587,7 +2539,19 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -1605,7 +2569,32 @@ "defaults": { "custom": {} }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -1643,7 +2632,7 @@ "steppedLine": false, "targets": [ { - "alias": "total rewards", + "alias": "total rewards (XCH)", "groupBy": [ { "params": [ @@ -1658,7 +2647,7 @@ "type": "fill" } ], - "measurement": "flexpool_pool_blocks", + "measurement": "flexpool_pool_blocks_chart", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1667,7 +2656,63 @@ [ { "params": [ - "total_rewards" + "rewards" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "/1000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ], + "tz": "$timezone" + }, + { + "alias": "total rewards (ETH)", + "groupBy": [ + { + "params": [ + "1d" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_pool_blocks_chart", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rewards" ], "type": "field" }, @@ -1683,7 +2728,19 @@ } ] ], - "tags": [], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ], "tz": "$timezone" } ], @@ -1736,7 +2793,6 @@ "fieldConfig": { "defaults": { "custom": {}, - "decimals": 5, "mappings": [], "thresholds": { "mode": "absolute", @@ -1747,9 +2803,42 @@ } ] }, - "unit": "ETH" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "XCH" + }, + { + "id": "decimals", + "value": 2 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "ETH" + }, + { + "id": "decimals", + "value": 5 + } + ] + } + ] }, "gridPos": { "h": 8, @@ -1775,22 +2864,16 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "total rewards", + "alias": "total rewards (XCH)", "groupBy": [ { "params": [ "1d" ], "type": "time" - }, - { - "params": [ - "null" - ], - "type": "fill" } ], - "measurement": "flexpool_pool_blocks", + "measurement": "flexpool_pool_blocks_chart", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1799,7 +2882,57 @@ [ { "params": [ - "total_rewards" + "rewards" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "/1000000000000" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "xch" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ], + "tz": "$timezone" + }, + { + "alias": "total rewards (ETH)", + "groupBy": [ + { + "params": [ + "1d" + ], + "type": "time" + } + ], + "measurement": "flexpool_pool_blocks_chart", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rewards" ], "type": "field" }, @@ -1815,7 +2948,19 @@ } ] ], - "tags": [], + "tags": [ + { + "key": "coin", + "operator": "=", + "value": "eth" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ], "tz": "$timezone" } ], @@ -1887,7 +3032,7 @@ "type": "fill" } ], - "measurement": "flexpool_pool_average_luck_round_time", + "measurement": "flexpool_pool_blocks", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1896,7 +3041,7 @@ [ { "params": [ - "round_time" + "roundTime" ], "type": "field" }, @@ -1906,7 +3051,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -1998,7 +3149,7 @@ { "alias": "round time", "groupBy": [], - "measurement": "flexpool_pool_average_luck_round_time", + "measurement": "flexpool_pool_blocks", "orderByTime": "ASC", "policy": "default", "query": "SELECT mean(\"round_time\") FROM \"flexpool_pool_average_luck_round_time\" WHERE $timeFilter GROUP BY time($__interval) fill(null)", @@ -2009,7 +3160,7 @@ [ { "params": [ - "round_time" + "roundTime" ], "type": "field" }, @@ -2019,7 +3170,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -2100,14 +3257,16 @@ }, { "params": [ - "null" + "linear" ], "type": "fill" } ], - "measurement": "flexpool_pool_average_luck_round_time", + "measurement": "flexpool_pool_blocks", "orderByTime": "ASC", "policy": "default", + "query": "SELECT mean(\"luck\") *100 FROM \"flexpool_pool_blocks\" WHERE (\"coin\" =~ /^$coin$/) AND $timeFilter GROUP BY time($__interval) fill(linear)", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ @@ -2130,7 +3289,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "thresholds": [], @@ -2221,7 +3386,7 @@ { "alias": "luck", "groupBy": [], - "measurement": "flexpool_pool_average_luck_round_time", + "measurement": "flexpool_pool_current_luck", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -2230,7 +3395,7 @@ [ { "params": [ - "luck" + "result" ], "type": "field" }, @@ -2246,7 +3411,13 @@ } ] ], - "tags": [] + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + } + ] } ], "timeFrom": null, @@ -2321,7 +3492,7 @@ "measurement": "flexpool_pool_average_luck_round_time", "orderByTime": "ASC", "policy": "default", - "query": "SELECT 1/mean(\"luck\") *100 FROM \"flexpool_pool_average_luck_round_time\" WHERE $timeFilter GROUP BY time($__interval) fill(null)", + "query": "SELECT 1/mean(\"result\") *100 FROM \"flexpool_pool_current_luck\" WHERE coin =~ /^$coin$/ AND $timeFilter GROUP BY time($__interval) fill(null)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -2452,7 +3623,7 @@ "measurement": "flexpool_pool_average_luck_round_time", "orderByTime": "ASC", "policy": "default", - "query": "SELECT 1/last(\"luck\") *100 FROM \"flexpool_pool_average_luck_round_time\" WHERE $timeFilter fill(null)", + "query": "SELECT 1/last(\"result\") *100 FROM \"flexpool_pool_current_luck\" WHERE coin =~ /^$coin$/ AND $timeFilter GROUP BY time($__interval) fill(null)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -2633,6 +3804,29 @@ "queryValue": "", "skipUrlSync": false, "type": "custom" + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_INFLUXDB}", + "definition": "", + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "coin", + "options": [], + "query": "SHOW TAG VALUES FROM flexpool_miner_stats WITH KEY = \"coin\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false } ] }, @@ -2644,5 +3838,5 @@ "timezone": "utc", "title": "Flexpool pool", "uid": "_vo2TQQMk", - "version": 27 + "version": 10 } \ No newline at end of file diff --git a/grafana/flexpool-workers.json b/grafana/flexpool-workers.json index d704876..bc3e981 100644 --- a/grafana/flexpool-workers.json +++ b/grafana/flexpool-workers.json @@ -53,7 +53,7 @@ "gnetId": null, "graphTooltip": 0, "id": null, - "iteration": 1617949836004, + "iteration": 1629269888685, "links": [], "panels": [ { @@ -82,7 +82,32 @@ "custom": {}, "links": [] }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "fill": 1, "fillGradient": 0, @@ -120,7 +145,7 @@ "steppedLine": false, "targets": [ { - "alias": "effective", + "alias": "current effective (XCH)", "groupBy": [ { "params": [ @@ -128,69 +153,6 @@ ], "type": "time" }, - { - "params": [ - "miner" - ], - "type": "tag" - }, - { - "params": [ - "null" - ], - "type": "fill" - } - ], - "measurement": "flexpool_miner_workers", - "orderByTime": "ASC", - "policy": "home", - "query": "SELECT mean(\"effective_hashrate\") FROM \"flexpool_miner_workers\" WHERE (\"miner\" =~ /^$miner$/ AND \"name\" =~ /^$worker$/) AND $timeFilter GROUP BY time($__interval), \"miner\" fill(null)", - "rawQuery": true, - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "effective_hashrate" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - } - ] - ], - "tags": [ - { - "key": "miner", - "operator": "=~", - "value": "/^$miner$/" - }, - { - "condition": "AND", - "key": "name", - "operator": "=~", - "value": "/^$worker$/" - } - ] - }, - { - "alias": "reported", - "groupBy": [ - { - "params": [ - "$__interval" - ], - "type": "time" - }, - { - "params": [ - "miner" - ], - "type": "tag" - }, { "params": [ "null" @@ -201,15 +163,13 @@ "measurement": "flexpool_miner_workers", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"reported_hashrate\") FROM \"flexpool_miner_workers\" WHERE (\"miner\" =~ /^$miner$/ AND \"name\" =~ /^$worker$/) AND $timeFilter GROUP BY time($__interval), \"miner\" fill(null)", - "rawQuery": true, - "refId": "B", + "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "reported_hashrate" + "currentEffectiveHashrate" ], "type": "field" }, @@ -221,6 +181,12 @@ ], "tags": [ { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", "key": "miner", "operator": "=~", "value": "/^$miner$/" @@ -230,6 +196,195 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "average effective (XCH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_workers", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "averageEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "current effective (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_workers", + "orderByTime": "ASC", + "policy": "default", + "refId": "C", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "currentEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" + } + ] + }, + { + "alias": "average effective (ETH)", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "flexpool_miner_workers", + "orderByTime": "ASC", + "policy": "default", + "refId": "D", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "averageEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] } @@ -254,6 +409,7 @@ }, "yaxes": [ { + "$$hashKey": "object:7053", "format": "Hs", "label": null, "logBase": 1, @@ -262,6 +418,7 @@ "show": true }, { + "$$hashKey": "object:7054", "format": "Hs", "label": null, "logBase": 1, @@ -294,9 +451,34 @@ } ] }, - "unit": "Hs" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "gridPos": { "h": 8, @@ -322,7 +504,7 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "hashrate", + "alias": "hashrate (XCH)", "groupBy": [], "measurement": "flexpool_miner_workers", "orderByTime": "ASC", @@ -333,7 +515,7 @@ [ { "params": [ - "effective_hashrate" + "currentEffectiveHashrate" ], "type": "field" }, @@ -354,6 +536,66 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "hashrate (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_workers", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "currentEffectiveHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] } @@ -382,9 +624,34 @@ } ] }, - "unit": "Hs" + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/XCH/" + }, + "properties": [ + { + "id": "unit", + "value": "bytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/ETH/" + }, + "properties": [ + { + "id": "unit", + "value": "Hs" + } + ] + } + ] }, "gridPos": { "h": 8, @@ -410,18 +677,20 @@ "pluginVersion": "7.3.7", "targets": [ { - "alias": "hashrate", + "alias": "hashrate (XCH)", "groupBy": [], "measurement": "flexpool_miner_workers", "orderByTime": "ASC", "policy": "default", + "query": "SELECT last(\"reported_hashrate\") FROM \"flexpool_miner_workers\" WHERE (\"miner\" =~ /^$miner$/ AND \"name\" =~ /^$worker$/) AND $timeFilter", + "rawQuery": false, "refId": "A", "resultFormat": "time_series", "select": [ [ { "params": [ - "reported_hashrate" + "reportedHashrate" ], "type": "field" }, @@ -442,6 +711,68 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "xch" + } + ] + }, + { + "alias": "hashrate (ETH)", + "groupBy": [], + "measurement": "flexpool_miner_workers", + "orderByTime": "ASC", + "policy": "default", + "query": "SELECT last(\"reported_hashrate\") FROM \"flexpool_miner_workers\" WHERE (\"miner\" =~ /^$miner$/ AND \"name\" =~ /^$worker$/) AND $timeFilter", + "rawQuery": false, + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "reportedHashrate" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + } + ] + ], + "tags": [ + { + "key": "miner", + "operator": "=~", + "value": "/^$miner$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=", + "value": "eth" } ] } @@ -511,15 +842,18 @@ "renderer": "flot", "seriesOverrides": [ { - "alias": "valid", + "$$hashKey": "object:8033", + "alias": "/valid/", "color": "#56A64B" }, { - "alias": "stale", + "$$hashKey": "object:8034", + "alias": "/stale/", "color": "#F2CC0C" }, { - "alias": "invalid", + "$$hashKey": "object:8035", + "alias": "/invalid/", "color": "#E02F44" } ], @@ -552,7 +886,7 @@ [ { "params": [ - "valid_shares" + "validShares" ], "type": "field" }, @@ -573,6 +907,12 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" } ] }, @@ -601,7 +941,7 @@ [ { "params": [ - "stale_shares" + "staleShares" ], "type": "field" }, @@ -622,6 +962,12 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" } ] }, @@ -671,6 +1017,12 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" } ] } @@ -679,7 +1031,7 @@ "timeFrom": null, "timeRegions": [], "timeShift": null, - "title": "Daily shares", + "title": "Shares", "tooltip": { "shared": true, "sort": 0, @@ -695,6 +1047,7 @@ }, "yaxes": [ { + "$$hashKey": "object:8054", "format": "short", "label": null, "logBase": 1, @@ -703,6 +1056,7 @@ "show": true }, { + "$$hashKey": "object:8055", "format": "short", "label": null, "logBase": 1, @@ -773,7 +1127,7 @@ [ { "params": [ - "valid_shares" + "validShares" ], "type": "field" }, @@ -794,6 +1148,12 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" } ] } @@ -863,7 +1223,7 @@ [ { "params": [ - "stale_shares" + "staleShares" ], "type": "field" }, @@ -884,6 +1244,12 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" } ] } @@ -954,7 +1320,7 @@ [ { "params": [ - "invalid_shares" + "invalidShares" ], "type": "field" }, @@ -975,6 +1341,12 @@ "key": "name", "operator": "=~", "value": "/^$worker$/" + }, + { + "condition": "AND", + "key": "coin", + "operator": "=~", + "value": "/^$coin$/" } ] } @@ -997,7 +1369,28 @@ "allValue": null, "current": {}, "datasource": "${DS_INFLUXDB}", - "definition": "", + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "coin", + "options": [], + "query": "SHOW TAG VALUES FROM flexpool_miner_workers WITH KEY = \"coin\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_INFLUXDB}", "error": null, "hide": 0, "includeAll": false, @@ -1005,7 +1398,7 @@ "multi": false, "name": "miner", "options": [], - "query": "SHOW TAG VALUES FROM flexpool_miner_workers WITH KEY = \"miner\"", + "query": "SHOW TAG VALUES FROM flexpool_miner_workers WITH KEY = \"miner\" WHERE coin =~ /^$coin$/", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -1042,7 +1435,7 @@ ] }, "time": { - "from": "now-6h", + "from": "now-2d", "to": "now" }, "timepicker": { @@ -1061,5 +1454,5 @@ "timezone": "utc", "title": "Flexpool workers", "uid": "slcUBSzgz", - "version": 4 + "version": 3 } \ No newline at end of file diff --git a/images/grafana-010.png b/images/grafana-010.png index 48f8c40..de7953f 100644 Binary files a/images/grafana-010.png and b/images/grafana-010.png differ diff --git a/telegraf/currencies.conf b/telegraf/currencies.conf index a4c8b44..6672727 100644 --- a/telegraf/currencies.conf +++ b/telegraf/currencies.conf @@ -18,6 +18,26 @@ from = "ETH" to = "USD" +[[inputs.http]] + name_override = "currencies" + urls = ["https://api.coingecko.com/api/v3/simple/price?ids=chia&vs_currencies=eur"] + data_format = "json" + tagexclude = ["url"] + json_query = "chia" + [inputs.http.tags] + from = "XCH" + to = "EUR" + +[[inputs.http]] + name_override = "currencies" + urls = ["https://api.coingecko.com/api/v3/simple/price?ids=chia&vs_currencies=usd"] + data_format = "json" + tagexclude = ["url"] + json_query = "chia" + [inputs.http.tags] + from = "XCH" + to = "USD" + [[processors.rename]] namepass = ["currencies"] [[processors.rename.replace]] diff --git a/telegraf/flexpool-miner.conf b/telegraf/flexpool-miner.conf index d56920a..63cb241 100644 --- a/telegraf/flexpool-miner.conf +++ b/telegraf/flexpool-miner.conf @@ -1,51 +1,49 @@ [[inputs.http]] name_override = "flexpool_miner_balance" - urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/balance"] + urls = ["https://api.flexpool.io/v2/miner/balance?coin=${COIN}&address=${MINER_ADDRESS}"] data_format = "json" tagexclude = ["url"] - [inputs.http.tags] - miner = "${MINER_ADDRESS}" - -[[inputs.http]] - name_override = "flexpool_miner_stats" - urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/stats"] - data_format = "json" - fieldpass = ["*hashrate", "*shares"] - tagexclude = ["url"] json_query = "result" [inputs.http.tags] miner = "${MINER_ADDRESS}" + coin = "${COIN}" + +[[inputs.http]] + name_override = "flexpool_miner_stats" + urls = ["https://api.flexpool.io/v2/miner/stats?coin=${COIN}&address=${MINER_ADDRESS}"] + data_format = "json" + fieldpass = ["*Hashrate", "*Shares"] + tagexclude = ["url"] + json_query = "result" + [inputs.http.tags] + miner = "${MINER_ADDRESS}" + coin = "${COIN}" [[inputs.http]] name_override = "flexpool_miner_workers" - urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/workers"] + urls = ["https://api.flexpool.io/v2/miner/workers?coin=${COIN}&address=${MINER_ADDRESS}"] data_format = "json" tagexclude = ["url"] - fieldpass = ["*hashrate", "*shares"] + fieldpass = ["*Hashrate", "*Shares"] tag_keys = ["name"] json_query = "result" [inputs.http.tags] miner = "${MINER_ADDRESS}" + coin = "${COIN}" [[inputs.http]] name_override = "flexpool_miner_paid" - urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/totalPaid"] - data_format = "json" - tagexclude = ["url"] - [inputs.http.tags] - miner = "${MINER_ADDRESS}" - -[[inputs.http]] - name_override = "flexpool_miner_daily_revenue_estimation" - urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/estimatedDailyRevenue"] + urls = ["https://api.flexpool.io/v2/miner/paymentsStats?coin=${COIN}&address=${MINER_ADDRESS}"] data_format = "json" tagexclude = ["url"] + json_query = "result" [inputs.http.tags] miner = "${MINER_ADDRESS}" + coin = "${COIN}" [[inputs.http]] name_override = "flexpool_miner_payments" - urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/payments/?page=0"] + urls = ["https://api.flexpool.io/v2/miner/payments?coin=${COIN}&address=${MINER_ADDRESS}&page=0"] data_format = "json" tagexclude = ["url"] json_query = "result.data" @@ -53,3 +51,4 @@ json_time_key = "timestamp" [inputs.http.tags] miner = "${MINER_ADDRESS}" + coin = "${COIN}" diff --git a/telegraf/flexpool-pool.conf b/telegraf/flexpool-pool.conf index 5dbb556..c5521cd 100644 --- a/telegraf/flexpool-pool.conf +++ b/telegraf/flexpool-pool.conf @@ -1,18 +1,22 @@ [[inputs.http]] - name_override = "flexpool_pool_block_count" - urls = ["https://flexpool.io/api/v1/pool/blockCount"] + name_override = "flexpool_pool_blocks_chart" + urls = ["https://api.flexpool.io/v2/pool/blocksChart?coin=${COIN}"] data_format = "json" tagexclude = ["url"] json_query = "result" + json_time_format = "unix" + json_time_key = "timestamp" + [inputs.http.tags] + coin = "${COIN}" [[inputs.http]] name_override = "flexpool_pool_blocks" urls = [ - "https://flexpool.io/api/v1/pool/blocks/?page=0", - "https://flexpool.io/api/v1/pool/blocks/?page=1", - "https://flexpool.io/api/v1/pool/blocks/?page=2", - "https://flexpool.io/api/v1/pool/blocks/?page=3", - "https://flexpool.io/api/v1/pool/blocks/?page=4" + "https://api.flexpool.io/v2/pool/blocks?coin=${COIN}&page=0", + "https://api.flexpool.io/v2/pool/blocks?coin=${COIN}&page=1", + "https://api.flexpool.io/v2/pool/blocks?coin=${COIN}&page=2", + "https://api.flexpool.io/v2/pool/blocks?coin=${COIN}&page=3", + "https://api.flexpool.io/v2/pool/blocks?coin=${COIN}&page=4" ] data_format = "json" tagexclude = ["url"] @@ -20,35 +24,38 @@ json_time_format = "unix" json_time_key = "timestamp" tag_keys = ["miner"] + [inputs.http.tags] + coin = "${COIN}" [[inputs.http]] name_override = "flexpool_pool_hashrate" - urls = ["https://flexpool.io/api/v1/pool/hashrate"] + urls = ["https://api.flexpool.io/v2/pool/hashrate?coin=${COIN}"] data_format = "json" tagexclude = ["url"] json_query = "result" + [inputs.http.tags] + coin = "${COIN}" [[inputs.http]] - name_override = "flexpool_pool_miners_online" - urls = ["https://flexpool.io/api/v1/pool/minersOnline"] + name_override = "flexpool_pool_miners_count" + urls = ["https://api.flexpool.io/v2/pool/minerCount?coin=${COIN}"] data_format = "json" tagexclude = ["url"] + [inputs.http.tags] + coin = "${COIN}" [[inputs.http]] - name_override = "flexpool_pool_workers_online" - urls = ["https://flexpool.io/api/v1/pool/workersOnline"] + name_override = "flexpool_pool_workers_count" + urls = ["https://api.flexpool.io/v2/pool/workerCount?coin=${COIN}"] data_format = "json" tagexclude = ["url"] - -[[inputs.http]] - name_override = "flexpool_pool_average_luck_round_time" - urls = ["https://flexpool.io/api/v1/pool/avgLuckRoundtime"] - data_format = "json" - tagexclude = ["url"] - json_query = "result" + [inputs.http.tags] + coin = "${COIN}" [[inputs.http]] name_override = "flexpool_pool_current_luck" - urls = ["https://flexpool.io/api/v1/pool/currentLuck"] + urls = ["https://api.flexpool.io/v2/pool/currentLuck?coin=${COIN}"] data_format = "json" tagexclude = ["url"] + [inputs.http.tags] + coin = "${COIN}"