xprof
xprof copied to clipboard
Argument distribution
Instead of plotting latency of a function, plot the distribution of an argument. Additionally it would be nice to plot a value derived from one or more arguments. Deriving can happen in the match-spec (limited) or after passing all the necessary arguments to an arbitrary "derive" fun which could be executed in the trace handler.
The value
-
int
: in the simplest case must be an integer (with a lower and upper bound; default range can be 0..max_duration
) -
enum
: or any term with max number of combinations/buckets
Options:
- aggregation method: histogram (only integer;
int
) or frequency count (any term,enum
) - interval: how often to take a snapshot of the collected data (this is hard-coded currently for function latency to 1 second, but could make sense to set larger intervals in this case) (maybe does not need to be implemented)
http://manpages.ubuntu.com/manpages/zesty/man8/argdist-bpfcc.8.html
Query syntax
With the current syntax it would be possible to add extra action function:
mod:fun(_,A,_) -> argdist(A)
mod:fun(_,A,B) -> argdist(A+B)
mod:fun(_,A,_) -> argdist(A >= 0, enum)
Extended syntax: (multiple lines for readability)
#argdist enum = 2,
interval = "5sec",
derive: if A > 0 -> positive; true -> neg_or_zero end,
mfa = mod:fun(_, A, _)
%Argdist int: -100..100,
interval: "5sec",
mfa: Mod.fun(_, a, _)
Prerequisits:
- histogram/spectrogram visualisation ( #107 )
- extended query syntax ( #110 )