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

Makes metrics implementation configurable #152

Merged
merged 10 commits into from
Apr 28, 2020

Conversation

theanirudhvyas
Copy link
Contributor

Introduces a {:ziggurat {:metrics {:constructor}}} configuration key that accepts a constructor (of a class that implements MetricsLib interface).

Renames interface fn update-histogram to update-timing as timing is the statsd metric_type.


(defn get-metrics-implementor-constructor []
(if-let [configured-metrics-class-constructor (get-in (ziggurat-config) [:metrics :implementation])]
(let [configured-constructor-symbol (symbol configured-metrics-class-constructor)
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good, I was wondering if we could instantiate the impl class by doing something like this?
https://stackoverflow.com/questions/3748559/clojure-creating-new-instance-from-string-class-name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, good suggestion, couldn't make it work. Will try it out in the next release.

@theanirudhvyas theanirudhvyas merged commit 1ad95f7 into gojek:master Apr 28, 2020
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.

2 participants