-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create Statistic / Aggregate Handlers #26
Comments
Seems good. What I would suggest is look into a database setup where we have a performant database for the most accessed data(e.g. recent alerts, data that is displayed on the landing page; also it might be nice to look into splitting it into a read and write) and one that is used for long time storage(e.g. older alerts). With such a setup we might be able to go further by storing more detailed alert data(e.g. kill list) which are later dropped when it is put into the archive database. Also it might be an idea to only keep the alerts older then a month that were during prime time. Lastly I just want to point out the current way of accumulating data is mostly possible because of linearity. We might want to consider a system that is flexible enough to deal with non-linear data collection. Might be a good idea too talk to the data-analysts about this before we commit to any approach. P.S.: Is it an idea to create a survey to get an idea of how people used the old ps2alerts and what they expect from the new one? |
This looks like a really good change, those aggregates will definitely enrich the statistics that we can report back to both individual players and globally. On the suggestion of the hybrid database topology, I think it is a good suggestion but we need to implement it carefully, in that we want to put in checks to ensure data integrity when transferred especially if it is large amounts. Once implemented though, It would certainly help us on the backend to pull data off the archival database for analytics while we use the performant one for player queries on the front end. With respect to the linearity of data collection, I think you raise a really good point. Just recently census was down for a few days, I'm not sure if the data was retrospectively available for that silent period, but if it were we should be able to take advantage of it. I personally can't see any problems from an analytics side from the non-linear collection as long as it is used for data-recovery rather than as our primary accumulation technique. With linear accumulation, (assuming it's availability) we can have live statistics and rolling averages etc. |
Looks good so far.. the aggregation is definitely something that is needed, will increase data lookup times alot.. however.. i am a big fan of retaining raw data aswell, atleast for important/interesting things. like Deaths, facilitycaptures.. could provide some nice stats to display to users if not now, then in the future |
If we keep the raw data, we should take a look at views to aggregate values via the database itself |
If we hold raw data we need to be very careful about the retension policy. I'm not going to allow a permant collection of events, the dataset will be absolutely gigantic and it will consume gigabytes of block storage in a matter of days. |
I don't know if it is totally representative of the data generated by the event stream. But based on what I collected during a 7h period during prime time on EU across all servers I found(based on the exported json files):
In mongo compared to the json files was also able to store it at 65% of the size. With that if you store 2h of data(so you have some room when it comes to alerts), that seems very reasonable. Edit: Should be MB/h not per second :P |
I'd say a 48 hour "ultra detail" retention is acceptable. Not GainExperience though, that will have to be aggregated unfortunately. |
#26 - Implemented AlertFactionCombatAggregate
…egate #26 - AlertFacilityControlAggregate
…gate #26 - WorldFacilityControlAggregate
#26 - AlertPlayerAggregate & GlobalPlayerAggregate
#26 - AlertWeaponAggregate & GlobalWeaponAggregate
#26 - Outfit Instance & Global Aggregates
As part of #18 we now have a solid foundation where messages are being handled and will then be proxied off for processing. In effect the collection and validation of messages is now done.
Next step is to process the data into a useful format for the Alerts Statiatics dataset itself.
In the old code, there were very crude implementations which enabled aggregation of statistics, e.g. for a player how many kills they got on a per-alert basis for example. This was done by simply incrementing a number in a database row. However, it was done in a very poor manner which meant any changes to the database schema were a royal ballache, as the implementation was basically a vast set of update queries, each being a special snowflake.
Therefore, we now need to create Aggregate Handlers which updates the appropiate sections of the data set when we receieve relevent events. This is required to reduce the vast amount of processing required to generate the statistics, due to the sheer volume of the data. E.g., when we get a PlayerDeath event, we need to do the following things:
There are a few things to consider with this approach:
From memory, below are the aggregates that the old site used:
Alert level aggregates
Player specific
AlertPlayerAggregate
- this holds general stats e.g. kills, deaths, TKs, suicides, headshots, etcAlertPlayerWeaponsAggregate
- this holds per-alert per-player per-weapon statistics, mainly kills and headshotsAlertPlayerVehiclesAggregate
- this holds per-player per-vehicle statisticsAlertPlayerClassAggregate
- holds metrics per-player per-class (this is in the current code but not exposed anywhere)Outfit specific
AlertOutfitAggregate
- this holds per-outfit per-alert stats, combat, facilitycontrol captures etcPotentially we could add
AlertOutfitVehicle
andAlertOutfitWeapon
aggregate but debatable for the usage of thisAlert aggregates
AlertWeaponAggregate
- this holds total kills with that weapon per alertAlertVehicleAggregate
- this holds total vehicle kills / deaths per alertAlertFactionCombatAggregate
- holds combat statistics for each factionAlertClassAggregate
- holds combat metrics for each classGlobal level aggregates
GlobalOutfitAggregate
- this holds per-outfit stats globallyGlobalPlayerAggregate
- this holds per-player stats globally, including number of alerts involved etcGlobalPlayerWeaponAggregate
- weapon use per-player per "globally" (using world ID seperation)GlobalWeaponAggregate
- this holds per-weapon global statsGlobalVehicleAggregate
- this holds per-vehicle global statsGlobalVehiclePlayerAggregate
- vehicle stats use per player globallyGlobalFactionAggregate
- stats per-faction globallyProposed new aggregates
The below was never in the original code (it was calculated from the API and cost CPU cycles to figure it out) and would be very nice to add.
AlertFacilityAggregate
- holds the number of times a facility changes hands etc (this is currently calculated in API / frontend code)AlertExperienceAggregate
- holds the experience types. We can choose which ones we want to track (e.g. medical)GlobalFacilityAggregate
- holds captures and defenses for each facility IDGlobalClassAggregate
- holds class metrics split by world for all serversThe text was updated successfully, but these errors were encountered: