This module implements some convenience functions for analyzing
microstate accounting data. For details about how to use the basic api and
what the different states represent see
Basic Scenario
1> msacc:start(1000). ok 2> msacc:print(). Average thread real-time : 1000513 us Accumulated system run-time : 2213 us Average scheduler run-time : 1076 us Thread aux check_io emulator gc other port sleep Stats per thread: async( 0) 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 100.00% async( 1) 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 100.00% aux( 1) 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 99.99% scheduler( 1) 0.00% 0.03% 0.13% 0.00% 0.01% 0.00% 99.82% scheduler( 2) 0.00% 0.00% 0.00% 0.00% 0.03% 0.00% 99.97% Stats per type: async 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 100.00% aux 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% 99.99% scheduler 0.00% 0.02% 0.06% 0.00% 0.02% 0.00% 99.89% ok
This first command enables microstate accounting for 1000 milliseconds.
See
Then one column per state is printed with a the percentage of time this thread spent in the state out of it's own real-time. After the thread specific time, the accumulated time for each type of thread is printed in a similar format.
Since we have the average real-time and the percentage spent in each
state we can easily calculate the time spent in each state by multiplying
A map containing the different microstate accounting states and the number of microseconds spent in it.
A map containing information about a specific thread. The
percentages in the map can be either run-time or real-time depending
on if
A map containing the different microstate accounting states. Each
value in the map contains another map with the percentage of time that
this thread has spent in the specific state. Both the percentage of
The different states that a thread can be in. See
The different options that can be given to
This function checks whether microstate accounting is available or not.
Start microstate accounting. Returns whether it was previously enabled or disabled.
Resets all counters and then starts microstate accounting for the given milliseconds.
Stop microstate accounting. Returns whether is was previously enabled or disabled.
Reset microstate accounting counters. Returns whether is was enabled or disabled.
Prints the current microstate accounting to standard out.
Same as
Print the given microstate statistics values to stdout.
Same as
Print the given microstate statistics values to standard out. With many states this can be quite verbose. See the top of this reference manual for a brief description of what the fields mean.
It is possible to print more specific types of statistics by
first manipulating the
msacc:print(msacc:stats(runtime,msacc:stats())).
If you want to only print run-time per thread type you can do:
msacc:print(msacc:stats(type,msacc:stats(runtime,msacc:stats()))).
Options
Print the given microstate statistics values to the given file
or device. The other arguments behave the same way as for
Returns a runtime system independent version of the microstate
statistics data presented by
Returns the system time for the given microstate statistics values. System time is the accumulated time of all threads.
Returns fractions of real-time or run-time spent in the various threads from the given microstate statistics values.
Returns a list of microstate statistics values where the values for all threads of the same type has been merged.
Dumps the current microstate statistics counters to a file that can
be parsed with
Read a file dump produced by