-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: data collection for link click statistics #209
Conversation
5108462
to
e971b06
Compare
have confirmed with @kylerwsm that data collection is presently working when tested on staging |
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.
as commented. it would be good if we can try creating the tables without indexes, then run an EXPLAIN SELECT ...
and make sure that we're still able to rely on the composite primary keys without doing any table scans here. indexes result in additional write overhead, best if the composite PKs can provide indexed lookup.
a0e2a9e
to
7218a3f
Compare
Problem
This PR aims to start-off data collection for our upcoming link click statistics feature.
Closes #168.
Solution
We do this by collecting and storing data directly to dedicated tables, each representing a statistic we will show to users. Additionally, in this implementation, badly formatted data will not be written to the statistics databases.
More information on how the each statistic is implemented:
Daily Statistics
shortUrl
anddate
fieldsWeekday Statistics
shortUrl
,weekday
, andhours
fieldsDevice Statistics
ua-parser-js
library to parse the user agent string to a device type.shortUrl
field