Skip to content

Conversation

@andyatkinson
Copy link
Owner

@andyatkinson andyatkinson commented Jun 17, 2025

Add ankane/rollup gem and a usage example
https://github.com/ankane/rollup

Rollups

https://github.com/ankane/rollup

Example

  • Rollups for new drivers created on the platform

Populate drivers over the last week:

bin/rails data_generators:drivers

Create rollups:

rails runner 'Driver.rollup("New drivers")'

Driver.rollup("New drivers", range: 1.week.ago.all_week)

Check driver counts for a day:

Rollup.series("New drivers")

Rollup.where(time: Date.yesterday).series("New drivers").values.last.to_i

@andyatkinson andyatkinson force-pushed the chore/ankane-rollups branch from 8e5c994 to 92e4ad0 Compare June 17, 2025 14:59
Use ankane/rollups

Basic examples with Driver counts by day

Pre-calculate these so lookups are nearly instant
@andyatkinson andyatkinson force-pushed the chore/ankane-rollups branch from 92e4ad0 to 9181d2a Compare July 1, 2025 03:43
@andyatkinson andyatkinson changed the title chore/ankane rollups Add ankane/ankane rollups gem and a usage exmaple Jul 1, 2025
@andyatkinson andyatkinson changed the title Add ankane/ankane rollups gem and a usage exmaple Add ankane/rollup gem and a usage exmaple Jul 1, 2025
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.

2 participants