Re: Good way of handling metric gathering?

2016-11-12 Thread Didier
You could use: https://github.com/technomancy/robert-hooke Its basically an AOP library for Clojure. You can use "with-hooks-disabled" in your tests to disable the hooks that have side effects. On Friday, 11 November 2016 21:42:59 UTC-8, Shantanu Kumar wrote: > > Hi Tianxiang, > > In my experie

Re: Good way of handling metric gathering?

2016-11-11 Thread Shantanu Kumar
Hi Tianxiang, In my experience a good way to decouple a non-trivial fn with metrics is to make the fn provide hooks for various events when metrics may be gathered. (defn nop [& args]) (defn foo->bar [foo {:keys [on-foo on-bar] :or {on-foo nop on-bar nop} :as options}] (on-foo) (let [bar (

Good way of handling metric gathering?

2016-11-11 Thread Tianxiang Xiong
What are some good ways of handling metric gathering (or, more generally, AOP) in Clojure? Suppose we have an application in which there is a transformation function, foo->bar. Every time a foo is input to foo->bar, we'd like to increment the foo-counter. Every time a bar is produced, we'd like