-
Notifications
You must be signed in to change notification settings - Fork 111
improve: batched trackers updated #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| self->flushBatchedTrackerData(); | ||
| }, | ||
| "Player::flushBatchedTrackerData" | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you sum the amount, it'll create a bug with the "max-dps" and "all-time high"
But if you don’t sum it, you’ll send all of them separately so it’ll be the same, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sending impact events separately is the right behavior, and it’s what the code already does.
src/creatures/players/player.cpp
Outdated
|
|
||
| // Send aggregated loot stats | ||
| if (batchedTrackerData.lootValue > 0) { | ||
| g_metrics().addCounter("player_loot", batchedTrackerData.lootValue, { { "player", getName() } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated info in g_metrics()
g_metrics().addCounter("player_loot", value, { { "player", getName() } });
- Previous behavior: flushBatchedTrackerData emitted a single aggregated counter using batchedTrackerData.lootValue ( src/creatures/players/player.cpp:1756 ). - Change: Emit one counter per loot item using its computed value (coins or “Lootmonger” sell price) during the loop over lootItems . Removed the aggregated emission. - Result: Metrics reflect each loot event individually and avoid double-reporting caused by batch aggregation.
|
This PR is stale because it has been open 45 days with no activity. |
Tracker Functions Optimization
Batching has been implemented for tracker functions to reduce I/O and allocations:
Changes Implemented:
BatchedTrackerDatato accumulate loot, supply, impact, and input datasendLootStats: Accumulates items and values, schedules flush in 250msupdateSupplyTracker: Accumulates items and values, schedules flush in 250msupdateImpactTracker: Accumulates combat data, schedules flush in 250msupdateInputAnalyzer: Accumulates input data, schedules flush in 250msflushBatchedTrackerData: Sends aggregated data and clears the bufferBenefits:
Impact: