Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.trace by

I would like to propose adding several features to tools.trace:

  • The ability to trottle tracing using several characteristics:

     *  Number of messages logged.
    
    • Number of times called.
    • Size of output generated
    • Times logged in a given period
  • The ability to trace only certain calls:
    * Trace calls to functions with specific values for their argument

4 Answers

0 votes
by

Comment made by: aeronotix

I have an implementation of most of this on my branch at github: https://github.com/AeroNotix/tools.trace/tree/alf-implement-throttled-tracing

0 votes
by

Comment made by: lprefontaine

I find this feature interesting but I read the implementation and find it complex.
I would like to simplify it. The count may be done at all times even without the throttling
feature enabled.

I would pass a different wrapper in do-trace-var* depending if the throttling feature is
required or not instead of testing the throttle feature at runtime every time.

I may also want to preserve existing fns that have been made public in the past.

The top level call could be a bit more specific than trace-opts.
Will think about a name. Maybe having top level calls more explicit will make
things clearer and easier to implement while preserving backward compat.

Can you shed some light on why you need a dosync in the throttler ?

I reread the code three/four times but cannot wrap my mind as to why a simple atom
with swap! does not do the job here.

All your refs are in the local scope of the throttler fn, nothing leaks out as far as I can
see. (It's late however...:)

Luc P.

0 votes
by

Comment made by: aeronotix

The dosync is for when the function is being called from multiple threads.

0 votes
by
Reference: https://clojure.atlassian.net/browse/TTRACE-10 (reported by alex+import)
...