Skip to content
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

metrics: add linear probabilistic counter #4776

Merged
merged 2 commits into from Dec 4, 2023
Merged

Conversation

wasaga
Copy link
Contributor

@wasaga wasaga commented Dec 1, 2023

Summary

Adds an utility package with linear probabilistic counter, to be used to estimate session statistics
while only occupying a limited storage space.

Related issues

Related: https://github.com/pomerium/pomerium-zero/issues/821

User Explanation

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@wasaga wasaga requested a review from a team as a code owner December 1, 2023 15:55
@coveralls
Copy link

coveralls commented Dec 1, 2023

Coverage Status

coverage: 62.786% (+0.05%) from 62.733%
when pulling 2071140 on wasaga/linear-counter
into a246466 on main.

@calebdoxsey
Copy link
Contributor

This is just go.mod changes?

Copy link
Contributor

@calebdoxsey calebdoxsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM but I'm not sure what it's for. For counting sessions can't we just do a DB query?

@wasaga
Copy link
Contributor Author

wasaga commented Dec 1, 2023

in order to measure monthly active users you need keep track of all the unique user IDs within a specific period of time (a month, for MAU).

if you just count sessions, say, every hour, that would be a different kind of metric, also useful, but you cannot convert it into a MAU.

@wasaga wasaga merged commit 4559320 into main Dec 4, 2023
9 checks passed
@wasaga wasaga deleted the wasaga/linear-counter branch December 4, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants