Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow selection of which metrics to submit from Librato metrics reporter #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryanlower
Copy link

Can specific :only or :except when initializing the reporter, e.g.

Metriks::Reporter::LibratoMetrics.new(
  'email',
  'key',
  {
    prefix: 'example',
    only: [
      :count,
      :mean,
      :one_minute_rate
    ]
  }
).start

@eric
Copy link
Owner

eric commented Apr 18, 2012

This is great. It may be a couple days before I get a chance to merge and release this — I'm traveling in Japan at the moment... but this looks useful.

Thanks for the pull request.

raise 'Can only specify one of :only or :except'
end
@only = options[:only] || []
@except = options[:except] || []
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defaulting these to an empty array is going to cause the if's later on to always evaluate to true.

I think this may be worth a test case to not break things.

@douglasdollars
Copy link

This one is going to really come in handy. Thanks guys!

@@ -121,6 +127,15 @@ def prepare_metric(base_name, metric, keys, snapshot_keys = [])
base_name = "#{@prefix}.#{base_name}"
end

if @only
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the defaulting above, this is going to need to be if @only && [email protected]? — same with the @except one.

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.

3 participants