View Source exometer_util (exometer_core v1.7.1)

Exometer utility functions.

Summary

Functions

drop_duplicates/1 will drop all duplicate elements from a list of tuples identified by their first element. Elements which are not tuples will be dropped as well. If called with a non-list argument, the argument is returned as is.

Calculate statistics from a sorted list of values.

Pick values from specified positions in a sorted list of numbers.

Generate a millisecond-resolution timestamp.

Convert timestamp to a regular datetime.

Types

-type timestamp() :: non_neg_integer().

Functions

-spec drop_duplicates(List0 :: [tuple()]) -> [tuple()].
drop_duplicates/1 will drop all duplicate elements from a list of tuples identified by their first element. Elements which are not tuples will be dropped as well. If called with a non-list argument, the argument is returned as is.
-spec ensure_all_started(atom()) -> {ok, [atom()]} | {error, term()}.
Link to this function

get_datapoints(Exometer_entry)

View Source
Link to this function

get_opt(K, Opts, Default)

View Source
Link to this function

get_statistics2(L, Sorted, Total, Mean)

View Source
Link to this function

get_statistics(Length, Total, Sorted)

View Source
-spec get_statistics(Length :: non_neg_integer(), Total :: non_neg_integer(), Sorted :: list()) ->
                  [{atom(), number()}].

Calculate statistics from a sorted list of values.

This function assumes that you have already sorted the list, and now the number and sum of the elements in the list.

The stats calculated are min, max, mean, median and the 50th, 75th, 90th, 95th, 99th, and 99.9th percentiles (note that the 99.9th percentile is labeled 999).

This function is similar to bear:get_statistics_subset/2. mean refers to the arithmetic mean.

Fulpatchad med min/max av Magnus Feuer.
Link to this function

histogram(Values, DataPoints)

View Source
-spec pick_items([number()], [{atom() | integer(), integer()}]) -> [{atom(), number()}].

Pick values from specified positions in a sorted list of numbers.

This function is used to extract datapoints (usually percentiles) from a sorted list of values. Items is a list of {Datapoint, Position} entries.
Link to this function

report_type(Key, Extra, TypeMap)

View Source
Link to this function

set_call_count(M, F, Bool)

View Source
-spec timestamp() -> timestamp().

Generate a millisecond-resolution timestamp.

This timestamp format is used e.g. by the exometer_slide and exometer_histogram implementations.
Link to this function

timestamp_to_datetime(TS)

View Source
-spec timestamp_to_datetime(timestamp()) -> {calendar:datetime(), non_neg_integer()}.

Convert timestamp to a regular datetime.

The timestamp is expected