Fixed TPS Rounding too early into a long value.

Fixed Graph tooltips
Fixed Players Displaying in wrong position on TPS graph.
This commit is contained in:
Rsl1122 2017-07-30 21:19:49 +03:00
parent bc22a9d021
commit eb12fe2dfc
2 changed files with 65 additions and 43 deletions

View File

@ -114,7 +114,7 @@ public class TPSCountTimer extends AbsRunnable {
diff -= twentySeconds;
}
double tpsN = MathUtils.round(twentySeconds / diff);
double tpsN = twentySeconds * 1.0 / diff;
return new TPS(now, tpsN, playersOnline, cpuUsage, usedMemory, entityCount, chunksLoaded);
}

View File

@ -278,6 +278,7 @@
}
</style>
</head>
<body onload="countUpTimer()">
@ -341,7 +342,7 @@
</div>
</div>
</div>
<div id="playerChartDay" style="width=100%; height=350px;"></div>
<div id="playerChartDay" style="width=100%; height=350px;"></div>
<p><i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsday% | <i
class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsday%</p>
</div>
@ -388,7 +389,7 @@
class="fa fa-crosshairs" aria-hidden="true"></i> Mob kills: %mobkills% | <i
class="fa fa-meh-o" aria-hidden="true"></i> Deaths: %deaths%</p>
</div>
<div class=" box column">
<div class=" box column">
<div id="gmPie" style="width: 100%; height: 400px;"></div>
</div>
</div>
@ -415,29 +416,30 @@
</div>
</div>
</div>
<div id="playerChartMonth" style="width=100%; height=350px;"></div>
<div id="playerChartMonth" style="width=100%; height=350px;"></div>
</div>
<div class=" box column">
<p><b>Month:</b><br>
<i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsmonth% <br>
<i class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsmonth% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players: %npmonth% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players / Day: %newperdaymonth% </p>
<p><b>Week:</b><br>
<i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsweek% <br>
<i class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsweek% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players: %npweek% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players / Day: %newperdayweek%</p>
<p><b>Day:</b><br>
<i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsday% <br>
<i class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsday% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players: %npday% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players / Day: %newperdayday% </p>
<i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsmonth% <br>
<i class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsmonth%
<br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players: %npmonth% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players / Day: %newperdaymonth% </p>
<p><b>Week:</b><br>
<i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsweek% <br>
<i class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsweek% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players: %npweek% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players / Day: %newperdayweek%</p>
<p><b>Day:</b><br>
<i class="fa fa-user-circle" aria-hidden="true"></i> Unique Players: %uniquejoinsday% <br>
<i class="fa fa-user-circle-o" aria-hidden="true"></i> Unique/Day: %avguniquejoinsday% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players: %npday% <br>
<i class="fa fa-user-plus" aria-hidden="true"></i> New Players / Day: %newperdayday% </p>
</div>
</div>
<div class="row">
<div class="box column">
<div class="headerbox" style="width: 95%;">
<div class="headerbox" style="width: 95%;">
<div class="header-icon">
<div class="header-label"><i class="fa fa-pie-chart" aria-hidden="true"></i><span
class="header-text"> Playerbase</span></div>
@ -534,14 +536,14 @@
<i class="fa fa-umbrella" aria-hidden="true"></i> Avg. Entities: %averageentitiesweek%<br>
<i class="fa fa-tree" aria-hidden="true"></i> Average Chunks: %averagechunksweek%
</p>
<p><b>Day:</b><br>
<i class="fa fa-tachometer" aria-hidden="true"></i> Average TPS: %averagetpsday%<br>
<p><b>Day:</b><br>
<i class="fa fa-tachometer" aria-hidden="true"></i> Average TPS: %averagetpsday%<br>
<i class="fa fa-building-o" aria-hidden="true"></i> Average CPU: %averagecpuday%<br>
<i class="fa fa-microchip" aria-hidden="true"></i> Average RAM: %averagememoryday%Mb<br>
<i class="fa fa-umbrella" aria-hidden="true"></i> Avg. Entities: %averageentitiesday%<br>
<i class="fa fa-tree" aria-hidden="true"></i> Average Chunks: %averagechunksday%</p>
</div>
<div class="box column">
<div class="box column">
<div id="resourceGraph" style="width: 100%; height: 400px;"></div>
</div>
</div>
@ -549,7 +551,7 @@
<div class="box column">
<div id="tpsGraph" style="width: 100%; height: 400px;"></div>
</div>
<div class="box column">
<div class="box column">
<div id="worldGraph" style="width: 100%; height: 400px;"></div>
</div>
</div>
@ -665,10 +667,10 @@
</div>
</div>
<script src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/maps/modules/map.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/world.js"></script>
<script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/maps/modules/map.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/world.js"></script>
<script>
// Data Variables
var playersOnlineSeries = {
name: 'Players Online',
@ -783,8 +785,9 @@
color: '#222',
data: %punchcardseries%
};
</script>
<script>
</script>
<script>
function playersChart() {
var myChart = Highcharts.stockChart('playerChartDay', {
rangeSelector: {
@ -853,7 +856,8 @@
series: [playersOnlineSeries]
});
}
</script>
</script>
<script>
function tpsChart() {
var myChart = Highcharts.stockChart('tpsGraph', {
@ -881,18 +885,16 @@
}]
},
yAxis: [{
labels: {
labels: {
align: 'right',
x: -3
},
title: {
text: 'Players'
},
top: '55%',
height: '40%',
offset: 0,
lineWidth: 2
height: '30%',
}, {
lineWidth: 2,
labels: {
align: 'right',
x: -3
@ -900,9 +902,14 @@
title: {
text: 'TPS'
},
height: '55%',
height: '70%',
top: '30%',
offset: 0,
lineWidth: 2
}],
tooltip: {
split: true
},
plotOptions: {
areaspline: {
fillOpacity: 0.4
@ -912,8 +919,9 @@
series: [tpsSeries, playersOnlineSeries]
});
}
</script>
<script>
</script>
<script>
function resourceChart() {
var myChart = Highcharts.stockChart('resourceGraph', {
rangeSelector: {
@ -962,6 +970,9 @@
offset: 0,
lineWidth: 2
}],
tooltip: {
split: true
},
plotOptions: {
areaspline: {
fillOpacity: 0.4
@ -971,8 +982,9 @@
series: [cpuSeries, ramSeries]
});
}
</script>
<script>
</script>
<script>
function worldChart() {
var myChart = Highcharts.stockChart('worldGraph', {
rangeSelector: {
@ -1021,6 +1033,9 @@
offset: 0,
lineWidth: 2
}],
tooltip: {
split: true
},
plotOptions: {
areaspline: {
fillOpacity: 0.4
@ -1030,7 +1045,8 @@
series: [entitySeries, chunkSeries]
});
}
</script>
</script>
<script>
function activityPie() {
var myChart = Highcharts.chart('activityPie', {
@ -1059,8 +1075,9 @@
series: [activitySeries]
});
};
</script>
<script>
<script>
function gmPie() {
Highcharts.chart('gmPie', {
chart: {
@ -1086,6 +1103,7 @@
series: [gmSeries]
});
};
</script>
<script>
function punchCard() {
@ -1112,7 +1130,8 @@
series: [punchcardSeries]
});
}
</script>
</script>
<script>
function sessionDistributionChart() {
Highcharts.chart('sessionDistribution', {
@ -1146,6 +1165,7 @@
series: [sessionLengthSeries]
});
};
</script>
<script>
function worldMap() {
@ -1165,6 +1185,7 @@
series: [mapSeries]
});
}
</script>
<script>
// Navigation & Refresh time clock
@ -1256,6 +1277,7 @@
document.getElementById('divTime').innerHTML = out;
setTimeout('countUpTimer()', 1000);
}
</script>
</div>
</body>