From 2f16beebe43f158a106001b865800b66c2f87d57 Mon Sep 17 00:00:00 2001 From: Fuzzlemann Date: Wed, 26 Jul 2017 19:54:14 +0200 Subject: [PATCH] Adds the variables for RAM Usage Chunks loaded Entities living --- .../plan/data/analysis/TPSPart.java | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/analysis/TPSPart.java b/Plan/src/main/java/com/djrapitops/plan/data/analysis/TPSPart.java index dafc210f7..00c47f1ad 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/analysis/TPSPart.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/analysis/TPSPart.java @@ -17,8 +17,9 @@ import java.util.List; *

* Placeholder values can be retrieved using the get method. *

- * Contains following place-holders: tpsscatterday, tpsscatterweek, cpuscatterday, cpuscatterweek, averagetps, - * averagetpsday, averagecpuday, averagecpuweek + * Contains following place-holders: tpsscatterday, tpsscatterweek, cpuscatterday, cpuscatterweek, averagetps(-week), + * averagetpsday, averagecpuday, averagecpuweek, averagememoryday, averagememoryweek, averageentitiesday, averageentitiesweek, + * averagechunksday, averagechunkweek * * @author Rsl1122 * @since 3.5.2 @@ -48,17 +49,36 @@ public class TPSPart extends RawData { addValue("cpuscatterday", cpuScatterDay); addValue("cpuscatterweek", cpuScatterWeek); - double averageTPSweek = MathUtils.averageDouble(week.stream().map(TPS::getTps)); - double averageTPSday = MathUtils.averageDouble(day.stream().map(TPS::getTps)); + double averageTPSWeek = MathUtils.averageDouble(week.stream().map(TPS::getTps)); + double averageTPSDay = MathUtils.averageDouble(day.stream().map(TPS::getTps)); - double averageCPUweek = MathUtils.averageDouble(week.stream().map(TPS::getCPUUsage)); - double averageCPUday = MathUtils.averageDouble(day.stream().map(TPS::getCPUUsage)); + double averageCPUWeek = MathUtils.averageDouble(week.stream().map(TPS::getCPUUsage)); + double averageCPUDay = MathUtils.averageDouble(day.stream().map(TPS::getCPUUsage)); - addValue("averagetps", FormatUtils.cutDecimals(averageTPSweek)); - addValue("averagetpsday", FormatUtils.cutDecimals(averageTPSday)); + long averageUsedMemoryWeek = MathUtils.averageLong(week.stream().map(TPS::getUsedMemory)); + long averageUsedMemoryDay = MathUtils.averageLong(day.stream().map(TPS::getUsedMemory)); - addValue("averagecpuweek", FormatUtils.cutDecimals(averageCPUweek)); - addValue("averagecpuday", FormatUtils.cutDecimals(averageCPUday)); + double averageEntityCountWeek = MathUtils.averageInt(week.stream().map(TPS::getEntityCount)); + double averageEntityCountDay = MathUtils.averageInt(day.stream().map(TPS::getEntityCount)); + + double averageChunksLoadedWeek = MathUtils.averageInt(week.stream().map(TPS::getChunksLoaded)); + double averageChunksLoadedDay = MathUtils.averageInt(day.stream().map(TPS::getChunksLoaded)); + + addValue("averagetps", FormatUtils.cutDecimals(averageTPSWeek)); //Staying for backwards compatibility + addValue("averagetpsweek", FormatUtils.cutDecimals(averageTPSWeek)); + addValue("averagetpsday", FormatUtils.cutDecimals(averageTPSDay)); + + addValue("averagecpuweek", FormatUtils.cutDecimals(averageCPUWeek)); + addValue("averagecpuday", FormatUtils.cutDecimals(averageCPUDay)); + + addValue("averagememoryweek", FormatUtils.cutDecimals(averageUsedMemoryWeek)); + addValue("averagememoryday", FormatUtils.cutDecimals(averageUsedMemoryDay)); + + addValue("averageentitiesweek", FormatUtils.cutDecimals(averageEntityCountWeek)); + addValue("averageentitiesday", FormatUtils.cutDecimals(averageEntityCountDay)); + + addValue("averagechunksweek", FormatUtils.cutDecimals(averageChunksLoadedWeek)); + addValue("averagechunksday", FormatUtils.cutDecimals(averageChunksLoadedDay)); } public List getTpsData() {