Small optimizations

This commit is contained in:
Risto Lahtela 2021-01-28 16:45:05 +02:00
parent 1e897a09bf
commit e00de54879
2 changed files with 10 additions and 9 deletions

View File

@ -192,15 +192,16 @@ function mapToDataSeries(performanceData) {
chunks: [],
disk: []
};
for (const entry of performanceData) {
for (let i = 0; i < performanceData.length; i++) {
const entry = performanceData[i];
const date = entry[0];
dataSeries.playersOnline.push([date, entry[1]]);
dataSeries.tps.push([date, entry[2]]);
dataSeries.cpu.push([date, entry[3]]);
dataSeries.ram.push([date, entry[4]]);
dataSeries.entities.push([date, entry[5]]);
dataSeries.chunks.push([date, entry[6]]);
dataSeries.disk.push([date, entry[7]]);
dataSeries.playersOnline[i] = [date, entry[1]];
dataSeries.tps[i] = [date, entry[2]];
dataSeries.cpu[i] = [date, entry[3]];
dataSeries.ram[i] = [date, entry[4]];
dataSeries.entities[i] = [date, entry[5]];
dataSeries.chunks[i] = [date, entry[6]];
dataSeries.disk[i] = [date, entry[7]];
}
return dataSeries;
}

View File

@ -125,7 +125,7 @@
Links
</div>
<li class="nav-item nav-button">
<a class="nav-link" href="/query">
<a class="nav-link" href="../query">
<i class="fas fa-fw fa-search"></i>
<span>Make a query</span></a>
</li>