Skip to content

Instantly share code, notes, and snippets.

@jderrett
Last active August 29, 2015 14:04
Show Gist options
  • Save jderrett/9c2a2a11955cea61af2a to your computer and use it in GitHub Desktop.
Save jderrett/9c2a2a11955cea61af2a to your computer and use it in GitHub Desktop.
librato_source_counter.rb
require 'librato/metrics'
# Estimate the number of sources for each metric
Librato::Metrics.authenticate 'my-email@example.com', 'api token'
Librato::Metrics.metrics.each do |m|
# Grab last 4 hours at hourly resolution
puts [m['name'], Librato::Metrics.get_measurements(m['name'], resolution: 3600, count: 4).keys.size]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment