keygen-sh / keygen-api

Keygen is a fair source software licensing and distribution API built with Ruby on Rails. For developers, by developers.
https://keygen.sh
Other
699 stars 40 forks source link

Rollup duplicate high-volume event logs into a single row instead of deleting duplicates #855

Open ezekg opened 1 month ago

ezekg commented 1 month ago

Currently, we prune duplicate event logs for certain high-volume events. Instead, we should rollup the duplicates into a single row so that we don't lose history. It may be valuable information to some to see that a license was validated n times on a certain day, or that a machine sent n heartbeat pings on a certain day. But right now, we lose that information because duplicates are pruned rather than rolled up, so only 1 event log is saved per-day.

Keeping a simple count should be sufficient. But we should also consider keeping an array of timestamps as well.