This commit is a squash of 8 optimization commits to TPSCounter.
1. Extracted duplicate code in TPSCounters to ServerSensors.
- TPSCounter tasks now live inside common module
- ServerTPSCounter and ProxyTPSCounter
- Gathering methods are implemented with ServerSensor interface:
Player count, TPS, Entity count, Chunk count
- ServerProperties#getOnlinePlayers was replaced with ServerSensor
- Fixed sonar smells: "Hiding field" in TPSStoreTransaction & NavLink
2. Optimizations down to 0.15ms / run
- Optimized entity+chunk count (same for loop)
- Added warm-up for system resource methods
- Removed Stream API usages
- Removed List copy operation
- Entities & chunks only count once per minute
- CPU & RAM averages now produced with Average class
- Maximum player count per minute now produced with Maximum class
Affects issues:
- Fixed#1289
Original query used an odd inner join which caused some tables to
not be displayed at all, in some cases no tables were displayed at all.
The inner join was joining the value table, which is lower in the table hierarchy.
Changed the query to instead inner join upwards in the table hierarchy, joining the
plugin table.
Affects issues:
- #1260
Regression during redesign placed single tab content in card-columns div,
which caused the content to be displayed with a sub-par width.
Fixed by extracting new code that handles case for wide tabs, which
display the plugin container as full page width.
- Additionally, solved some issues with the plugin tab names & ids
Affects issues:
- Fixed#1276
- Reduced constructor parameters in Exporter
- Removed Throwable#printStackTrace calls
- Cleaned up SessionsMutator#toJSONMaps a little
- Replaced uses of getString/Number/ methods of PlanConfig with PlanConfig#get
Also for /network -> /network/
This was causing some issues with relative links when Plan was in
subdirectory eg address/plan/server would direct requests to address/v1/
instead of address/plan/v1/
Affects issues:
- Fixed#1210
Player names were in use previously, but changed to uuids to reduce
odd player name issues (On cracked servers the names can be whatever)
Encoded the playernames to URL (new session json parameter) and added that
to sessionAccordion
Affects issues:
- Fixed#1269
- GeoLite2 downloads the file using License key, only if EULA is accepted
- Fallback to IP2C if GeoLite2 is not available
- Remove GeoIP.dat after successfully downloading GeoLite2-Country.mmdb
- Added case where geolocation fails to enable and doesn't cause issues
- Adds Apache commons-compress to the dependencies because of a tar archive
Affects issues:
- Fixed#1273
- Some extension API implementation things refactored
- getOrDefault+put calls replaced with computeIfAbsent
using Maps#create, Lists#create
- stream().map(mapper).collect(toList/toSet) optimized
using Lists#map, #mapUnique
- stream().filter(by).collect(toList) optimized
using Lists#filter
- Removed unused code in Reflection
- Removed duplicated Strings in GMTimes
- Added private constructor to TimeZoneUtility
- Renamed local variable in RegisterDateMinimizationPatch
- Replaced Function<String, Boolean> with Predicate in ExtensionRegister
- Changed AFKListeners to use primitive boolean
- Changed Config#get(Setting<Boolean>) uses to isTrue and isFalse
- comment to NukkitListenerSystem
An earlier fix attempt for another bug #247 (ages ago)
was still in the code, moving 12 am to the next day by
adding 24 hours to the time.
Fixed by removing the check
Affects issues:
- Fixed#712