Skip to content

Instantly share code, notes, and snippets.

@matsimitsu
Created May 14, 2019 12:16
Show Gist options
  • Save matsimitsu/0d93fbbd943e86699bf3986b17f167d4 to your computer and use it in GitHub Desktop.
Save matsimitsu/0d93fbbd943e86699bf3986b17f167d4 to your computer and use it in GitHub Desktop.
custom_metrics.rake
namespace :database do
task :current_visits => :environment do
Appsignal.set_gauge("current_visits", CurrentVisit.count)
end
task :done do
# Wait for data to flush
Appsignal.stop
end
task :all => [
"custom_metrics:current_visits",
"custom_metrics:done"
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment