Skip to content

Repository files navigation

Timebased

This repo contains useful methods can be used in your daily development.

Timebased stats for a period of time.

You want to know most viewed products within 3 hours. Assume we have 3 buckets to store recent 3 hours views into them, here is a list

Hour 1:00Hour 2:00Hour 3:00
P1: 0P1: 13p1: 9
P2: 5P2: 11p2: 29
P3: 7P3: 0p3: 0
P4: 0P4: 0p4: 21

Now, we are at fourth hour, (assume it's 3:10), we can get a rank list at the end.

  1. P2: 45
  2. p1: 22
  3. p4: 21
  4. p3: 7

You can check the implementation under examples/.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages