reports an event’s start. NOTE: you must fire off a corresponding event end with report_end
reports an event’s end. NOTE: you must have fired off a corresponding event start with report_start
returns a function decorator and/or context manager which raises start and end events. If name is None events name is set to the name of the decorated function. In that case report_start_end can not be used as a context manager.
reports a value event to the counters.
Counts the number of times an end event has fired.
Clears the stored information
gets the value of this counter
reports an event to this counter
Counts the total of events’ values.
Clears the stored information
gets the value of this counter
reports an event to this counter
Calculates a running average of arbitrary values
Clears the stored information
gets the value of this counter
reports an event to this counter
Counts the average time between start and end events
Clears the stored information
gets the value of this counter
reports an event to this counter
Use to count the frequency of some occurrences in a sliding window. Occurrences can be reported directly via a value event (X occurrences has happened now) or via an end event which will be interpreted as a single occurrence.
Clears the stored information
gets the value of this counter
reports an event to this counter
Counts the number of end events in a sliding window
Clears the stored information
gets the value of this counter
reports an event to this counter
Log based reporter.
Reports to a file in a JSON format.
safely reads a value in a JSON format frome file
safely writes value in a JSON format to file
add a reporter to PyCounters. Registered reporters will output collected metrics
remove a reporter from PyCounters.
Manually cause the current values of all registered counters to be reported.
Start reporting in a background thread. Reporting frequency is set by seconds param.
configures PyCounters to collect values from multiple processes
Parameters: |
|
---|
Register a counter with PyCounters
Removes a previously registered counter
A shortcut decorator to count the number times a function is called. Uses the counters.EventCounter counter by default. If the parameter name is not supplied events are reported under the name of the wrapped function.
A shortcut decorator to count the frequency in which a function is called. Uses the counters.FrequencyCounter counter by default. If the parameter name is not supplied events are reported under the name of the wrapped function.
A shortcut function reports an occurrence of something. Uses the counters.FrequencyCounter counter by default.
A shortcut decorator to count the average execution time of a function. Uses the counters.AverageTimeCounter counter by default. If the parameter name is not supplied events are reported under the name of the wrapped function.
A shortcut function to report a value of something. Uses the counters.AverageWindowCounter counter by default.