mirror of
https://github.com/wownero/diff-chart.git
synced 2026-12-02 13:04:44 +01:00
tx-per-day: show avg tx sizes
This commit is contained in:
@@ -24,6 +24,9 @@ var aeon_config = {
|
|||||||
get_emission_speed_factor: function(target_minutes) {
|
get_emission_speed_factor: function(target_minutes) {
|
||||||
return this.EMISSION_SPEED_FACTOR_PER_MINUTE - int_log2(target_minutes);
|
return this.EMISSION_SPEED_FACTOR_PER_MINUTE - int_log2(target_minutes);
|
||||||
},
|
},
|
||||||
|
get_blockheader_size(height) {
|
||||||
|
return 43;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var aeon_offset_1 = {
|
var aeon_offset_1 = {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||||
|
<script src="js/util.js"></script>
|
||||||
<script src="data/aeon-data-0.js"></script>
|
<script src="data/aeon-data-0.js"></script>
|
||||||
<script src="data/aeon-data-1.js"></script>
|
<script src="data/aeon-data-1.js"></script>
|
||||||
<script src="data/aeon-data-2.js"></script>
|
<script src="data/aeon-data-2.js"></script>
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
<script src="data/aeon-data-8.js"></script>
|
<script src="data/aeon-data-8.js"></script>
|
||||||
<script src="data/aeon-data-9.js"></script>
|
<script src="data/aeon-data-9.js"></script>
|
||||||
<script src="js/tx-per-day.js"></script>
|
<script src="js/tx-per-day.js"></script>
|
||||||
|
<script src="aeon-config.js"></script>
|
||||||
|
|
||||||
<!-- Chart code -->
|
<!-- Chart code -->
|
||||||
<script>
|
<script>
|
||||||
@@ -39,7 +41,7 @@ var chart = get_chart([].concat(
|
|||||||
chartData_7,
|
chartData_7,
|
||||||
chartData_8,
|
chartData_8,
|
||||||
chartData_9,
|
chartData_9,
|
||||||
));
|
), aeon_config);
|
||||||
|
|
||||||
function togglePan() {
|
function togglePan() {
|
||||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||||
|
<script src="js/util.js"></script>
|
||||||
<script src="data/aeon-data-10.js"></script>
|
<script src="data/aeon-data-10.js"></script>
|
||||||
<script src="data/aeon-data-11.js"></script>
|
<script src="data/aeon-data-11.js"></script>
|
||||||
<script src="js/tx-per-day.js"></script>
|
<script src="js/tx-per-day.js"></script>
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
var chart = get_chart([].concat(
|
var chart = get_chart([].concat(
|
||||||
chartData_10,
|
chartData_10,
|
||||||
chartData_11,
|
chartData_11,
|
||||||
), aeon_offset_1);
|
), aeon_config, aeon_offset_1);
|
||||||
|
|
||||||
function togglePan() {
|
function togglePan() {
|
||||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||||
|
|||||||
+100000
-100000
File diff suppressed because it is too large
Load Diff
+30879
-30856
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -71,6 +71,8 @@ class GetData():
|
|||||||
reward = block_header['reward']
|
reward = block_header['reward']
|
||||||
block_size = block_header['block_size']
|
block_size = block_header['block_size']
|
||||||
num_txes = block_header['num_txes']
|
num_txes = block_header['num_txes']
|
||||||
|
|
||||||
|
blob_size = len(res_blk['blob']) / 2
|
||||||
# print(res_blk)
|
# print(res_blk)
|
||||||
# print('====================================================')
|
# print('====================================================')
|
||||||
|
|
||||||
@@ -98,7 +100,7 @@ class GetData():
|
|||||||
if j > 0:
|
if j > 0:
|
||||||
txs_str += ','
|
txs_str += ','
|
||||||
txs_str += "[%d,%d,%d,%d,%d,%d]" % (unlock_time, ins, outs, ring_size, fee, extra_size)
|
txs_str += "[%d,%d,%d,%d,%d,%d]" % (unlock_time, ins, outs, ring_size, fee, extra_size)
|
||||||
print('[%d,%d,%d,%d,%d,[%s]],' % (timestamp, nonce, difficulty, reward, block_size, txs_str))
|
print('[%d,%d,%d,%d,%d,%d,[%s]],' % (timestamp, nonce, difficulty, reward, block_size, blob_size, txs_str))
|
||||||
print(']')
|
print(']')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
+46
-6
@@ -1,4 +1,4 @@
|
|||||||
function get_chart(chartData, offset) {
|
function get_chart(chartData, cryptonote_config, offset) {
|
||||||
if (offset === undefined)
|
if (offset === undefined)
|
||||||
chartData.shift();
|
chartData.shift();
|
||||||
var chartData_tpd = [];
|
var chartData_tpd = [];
|
||||||
@@ -14,9 +14,20 @@ function get_chart(chartData, offset) {
|
|||||||
chartData_tpd.push({
|
chartData_tpd.push({
|
||||||
"date": block_date,
|
"date": block_date,
|
||||||
"num_txes": 0,
|
"num_txes": 0,
|
||||||
|
"tx_size_sum": 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
chartData_tpd[chartData_tpd.length - 1].num_txes += chartData[i][5].length;
|
var blk_size = chartData[i][4];
|
||||||
|
var blk_blob_size = chartData[i][5];
|
||||||
|
var num_txes = chartData[i][6].length;
|
||||||
|
var height = i + (offset === undefined ? 1 : offset.height);
|
||||||
|
var miner_tx_size = blk_blob_size - cryptonote_config.get_blockheader_size(height) - num_txes * 32 - 1;
|
||||||
|
chartData_tpd[chartData_tpd.length - 1].num_txes += num_txes;
|
||||||
|
chartData_tpd[chartData_tpd.length - 1].tx_size_sum += blk_size - miner_tx_size;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < chartData_tpd.length; ++i) {
|
||||||
|
chartData_tpd[i].tx_size = chartData_tpd[i].num_txes === 0 ? 1 : (chartData_tpd[i].tx_size_sum / chartData_tpd[i].num_txes);
|
||||||
|
chartData_tpd[i].tx_size_str = formatBytes(chartData_tpd[i].tx_size, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
var chart = AmCharts.makeChart("chartdiv", {
|
var chart = AmCharts.makeChart("chartdiv", {
|
||||||
@@ -27,15 +38,31 @@ function get_chart(chartData, offset) {
|
|||||||
"marginTop": 7,
|
"marginTop": 7,
|
||||||
"dataProvider": chartData_tpd,
|
"dataProvider": chartData_tpd,
|
||||||
"valueAxes": [{
|
"valueAxes": [{
|
||||||
|
"id":"va_num",
|
||||||
|
"color": "#9966cc",
|
||||||
|
"axisColor": "#9966cc",
|
||||||
|
"axisThickness": 2,
|
||||||
"axisAlpha": 0.2,
|
"axisAlpha": 0.2,
|
||||||
"dashLength": 1,
|
"dashLength": 1,
|
||||||
"position": "left",
|
"position": "left",
|
||||||
|
}, {
|
||||||
|
"id":"va_size",
|
||||||
|
"color": "#118844",
|
||||||
|
"axisColor": "#118844",
|
||||||
|
"axisThickness": 2,
|
||||||
|
"axisAlpha": 0.2,
|
||||||
|
"dashLength": 1,
|
||||||
|
"position": "left",
|
||||||
|
"gridAlpha": 0,
|
||||||
|
"position": "right"
|
||||||
}],
|
}],
|
||||||
"mouseWheelZoomEnabled": true,
|
"mouseWheelZoomEnabled": true,
|
||||||
"graphs": [{
|
"graphs": [{
|
||||||
"id": "g1",
|
"id": "g_num",
|
||||||
|
"valueAxis": "va_num",
|
||||||
"lineColor": "#cc99ff",
|
"lineColor": "#cc99ff",
|
||||||
"balloonText": "<b>[[value]]</b>",
|
"lineThickness": 2,
|
||||||
|
"balloonText": "Count: <b>[[value]]</b>\nSize: [[tx_size_str]]",
|
||||||
"bullet": "round",
|
"bullet": "round",
|
||||||
"bulletBorderAlpha": 1,
|
"bulletBorderAlpha": 1,
|
||||||
"bulletColor": "#FFFFFF",
|
"bulletColor": "#FFFFFF",
|
||||||
@@ -46,14 +73,27 @@ function get_chart(chartData, offset) {
|
|||||||
"balloon":{
|
"balloon":{
|
||||||
"cornerRadius": 10,
|
"cornerRadius": 10,
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"id": "g_size",
|
||||||
|
"valueAxis": "va_size",
|
||||||
|
"lineColor": "#22b681",
|
||||||
|
"lineThickness": 1,
|
||||||
|
"showBalloon" : false,
|
||||||
|
"bullet": "round",
|
||||||
|
"bulletBorderAlpha": 1,
|
||||||
|
"bulletColor": "#FFFFFF",
|
||||||
|
"hideBulletsCount": 50,
|
||||||
|
"title": "StdDev",
|
||||||
|
"valueField": "tx_size",
|
||||||
|
"useLineColorForBulletBorder": true,
|
||||||
}],
|
}],
|
||||||
"chartScrollbar": {
|
"chartScrollbar": {
|
||||||
"autoGridCount": true,
|
"autoGridCount": true,
|
||||||
"graph": "g1",
|
"graph": "g_num",
|
||||||
"scrollbarHeight": 40
|
"scrollbarHeight": 40
|
||||||
},
|
},
|
||||||
"chartCursor": {
|
"chartCursor": {
|
||||||
"limitToGraph":"g1",
|
"limitToGraph":"g_num",
|
||||||
"pan": false
|
"pan": false
|
||||||
},
|
},
|
||||||
"categoryField": "date",
|
"categoryField": "date",
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ var monero_config = {
|
|||||||
get_emission_speed_factor: function(target_minutes) {
|
get_emission_speed_factor: function(target_minutes) {
|
||||||
return this.EMISSION_SPEED_FACTOR_PER_MINUTE - (target_minutes - 1);
|
return this.EMISSION_SPEED_FACTOR_PER_MINUTE - (target_minutes - 1);
|
||||||
},
|
},
|
||||||
|
get_blockheader_size(height) {
|
||||||
|
return 43;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var monero_offset_1 = {
|
var monero_offset_1 = {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||||
|
<script src="js/util.js"></script>
|
||||||
<script src="data/monero-data-0.js"></script>
|
<script src="data/monero-data-0.js"></script>
|
||||||
<script src="data/monero-data-1.js"></script>
|
<script src="data/monero-data-1.js"></script>
|
||||||
<script src="data/monero-data-2.js"></script>
|
<script src="data/monero-data-2.js"></script>
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
<script src="data/monero-data-8.js"></script>
|
<script src="data/monero-data-8.js"></script>
|
||||||
<script src="data/monero-data-9.js"></script>
|
<script src="data/monero-data-9.js"></script>
|
||||||
<script src="js/tx-per-day.js"></script>
|
<script src="js/tx-per-day.js"></script>
|
||||||
|
<script src="monero-config.js"></script>
|
||||||
|
|
||||||
<!-- Chart code -->
|
<!-- Chart code -->
|
||||||
<script>
|
<script>
|
||||||
@@ -39,7 +41,7 @@ var chart = get_chart([].concat(
|
|||||||
chartData_7,
|
chartData_7,
|
||||||
chartData_8,
|
chartData_8,
|
||||||
chartData_9,
|
chartData_9,
|
||||||
));
|
), monero_config);
|
||||||
|
|
||||||
function togglePan() {
|
function togglePan() {
|
||||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||||
|
<script src="js/util.js"></script>
|
||||||
<script src="data/monero-data-10.js"></script>
|
<script src="data/monero-data-10.js"></script>
|
||||||
<script src="data/monero-data-11.js"></script>
|
<script src="data/monero-data-11.js"></script>
|
||||||
<script src="data/monero-data-12.js"></script>
|
<script src="data/monero-data-12.js"></script>
|
||||||
@@ -40,7 +41,7 @@ var chart = get_chart([].concat(
|
|||||||
chartData_17,
|
chartData_17,
|
||||||
chartData_18,
|
chartData_18,
|
||||||
chartData_19,
|
chartData_19,
|
||||||
), monero_offset_1);
|
), monero_config, monero_offset_1);
|
||||||
|
|
||||||
function togglePan() {
|
function togglePan() {
|
||||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||||
|
|||||||
@@ -11,4 +11,7 @@ var wownero_config = {
|
|||||||
get_emission_speed_factor: function(target_minutes) {
|
get_emission_speed_factor: function(target_minutes) {
|
||||||
return this.EMISSION_SPEED_FACTOR_PER_MINUTE - (target_minutes - 1);
|
return this.EMISSION_SPEED_FACTOR_PER_MINUTE - (target_minutes - 1);
|
||||||
},
|
},
|
||||||
|
get_blockheader_size(height) {
|
||||||
|
return 43;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,16 +14,18 @@
|
|||||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||||
|
<script src="js/util.js"></script>
|
||||||
<script src="data/wownero-data-0.js"></script>
|
<script src="data/wownero-data-0.js"></script>
|
||||||
<script src="data/wownero-data-1.js"></script>
|
<script src="data/wownero-data-1.js"></script>
|
||||||
<script src="js/tx-per-day.js"></script>
|
<script src="js/tx-per-day.js"></script>
|
||||||
|
<script src="wownero-config.js"></script>
|
||||||
|
|
||||||
<!-- Chart code -->
|
<!-- Chart code -->
|
||||||
<script>
|
<script>
|
||||||
var chart = get_chart([].concat(
|
var chart = get_chart([].concat(
|
||||||
chartData_0,
|
chartData_0,
|
||||||
chartData_1
|
chartData_1
|
||||||
));
|
), wownero_config);
|
||||||
|
|
||||||
function togglePan() {
|
function togglePan() {
|
||||||
chart.chartCursor.pan = document.getElementById("pan").checked;
|
chart.chartCursor.pan = document.getElementById("pan").checked;
|
||||||
|
|||||||
Reference in New Issue
Block a user