-
Notifications
You must be signed in to change notification settings - Fork 1
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
Chore: Batch reporting for Graphite #26
Conversation
|
||
function validate({ name, value, type }) { | ||
if (value === undefined || value === null) throw new TypeError(`${name} is missing`); | ||
// eslint-disable-next-line valid-typeof |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's wrong with this one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this rule requires a comparison to a literal string, Since I'm comparing to a parameter it fails the lint. In this specific case I want to use the parameter (thats the point of this function)
describe('constructor', () => { | ||
it('should create socket with given host and default values', () => { | ||
// eslint-disable-next-line no-new | ||
new StatsdSocket({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you still want to use constructor for this function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime yes - I don't want to confuse different standards in the repo. We will change it as a single PR all across the repository (its backward compatible so its not a must for version 1)
Add batch reporting to graphite reporter.
TL;DR: Extract statsd logic and re-use it in both graphite and datadog, thus gaining batch reporting from the current datadog implementation
Since DD and Graphite both use statsd to report metrics, there were two options here:
Option 2 was more viable at this point since there are slight differences in the actual reporting format between DataDog and Graphite. It will also give more flexibility to modify the reporters according to the specific target instead of trying to over generalize and pay the cost. Furthermore, with composition we still gain re-use of the major parts and allowing other reporters to re-use it as well without creating hard dependencies between them.
resolves #21