mbajur / inner_performance

Database-backed modest performance monitoring tool for your Rails app.
34 stars 3 forks source link

Allow `config.events_retention` to accept a number of records #3

Open westonganger opened 1 week ago

westonganger commented 1 week ago

Would be nice if we could configure events_retention to limit to a particular number of records instead of just a time frame

Something like

# config/initializers/inner_performance.rb
InnerPerformance.config.events_retention = {
  number_of_records: 10_000
}

# app/jobs/inner_performance/cleanup_job.rb
def perform
  InnerPerformance::Event.order(created_at: :desc).offset(my_limit).destroy_all
end
mbajur commented 1 week ago

I like that. Consider it planned :)