mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-15 00:54:08 +00:00
perf(dashboard): economy reports on a large ledger
- Leave staff out of the currency and U-score reports by excluding the few staff characters, instead of joining every ledger row to its character and account. - Top earners: total per character first and look up names for the top rows only. - The places list and the activity report read map events for every kind in one query (GetMapZonesAllKinds) instead of one query per kind. With about 1M currency rows and 650k map event rows (90 days) on MariaDB: currency 1.8 s to 0.8 s, top earners 2.4 s to 0.75 s, places 2.6 s to 0.5 s, activity 2.6 s to 1.7 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -160,6 +160,10 @@ public:
|
||||
// Zones and clones with map events of a kind in the range: {zone, clone, events, quantity}
|
||||
virtual nlohmann::json GetMapZones(eMapEvent kind, uint32_t fromDay, uint32_t toDay) = 0;
|
||||
|
||||
// GetMapZones for every kind at once, in one pass over the range: {kind, zone, clone, events, quantity}, by kind and then
|
||||
// in GetMapZones' order
|
||||
virtual nlohmann::json GetMapZonesAllKinds(uint32_t fromDay, uint32_t toDay) = 0;
|
||||
|
||||
// LOTs with the most events of a kind in a zone (one clone, or every instance): {lot, events, quantity}
|
||||
virtual nlohmann::json GetMapLots(uint32_t zone, std::optional<uint32_t> clone, eMapEvent kind, uint32_t fromDay, uint32_t toDay, uint32_t limit) = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user