elixometer icon indicating copy to clipboard operation
elixometer copied to clipboard

Is there anyway to support multiple reporters?

Open tony612 opened this issue 8 years ago • 6 comments

If my understanding is right, only one reporter is supported in Elixometer at the moment, right? If so, is there anyway to support multiple ones?

tony612 avatar May 31 '16 16:05 tony612

Right now, no, elixometer only allows you to subscribe to the reporter defined in Application.get_env(:elixometer, :reporter).

If you want to submit a PR for adding this, it should be rather easy.

scohen avatar May 31 '16 17:05 scohen

@scohen Got it, I'll try to solve this. I think this should be a useful feature 😁

tony612 avatar May 31 '16 17:05 tony612

@tony612 Yes, I agree.

I think it's as simple as allowing a list to be passed to :reporter and checking for that an iterating over it in https://github.com/pinterest/elixometer/blob/master/lib/elixometer.ex#L349

scohen avatar May 31 '16 17:05 scohen

@scohen There's one problem: How about deprecating :reporter to support :reporters?

tony612 avatar May 31 '16 17:05 tony612

I don't know how I feel about that; soft deprecation is OK, but should emit a warning. Hard deprecation will break things for people (including us).

What are your thoughts? :reporters can take a single names or a list of names?

scohen avatar May 31 '16 19:05 scohen

@scohen Yeah, I'm OK with soft deprecation and we can remove :reporter in a future version. I refer :reporters only accept a list of names, which is more clear.

tony612 avatar Jun 01 '16 05:06 tony612