AceRoutine  1.5.0
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
Public Types | Static Public Member Functions | List of all members
ace_routine::LogBinTableRendererTemplate< T_COROUTINE > Class Template Reference

Print the information in the LogBinProfiler for each Coroutine in a human-readable table. More...

#include <LogBinTableRenderer.h>

Public Types

using Profiler = LogBinProfilerTemplate< T_COROUTINE >
 Typedef of the LogBinProfiler supported by this class.
 

Static Public Member Functions

static void printTo (Print &printer, uint8_t startBin, uint8_t endBin, bool clear=true, bool rollup=true)
 Loop over all coroutines and print the ASCII version of the frequency distribution. More...
 

Detailed Description

template<typename T_COROUTINE>
class ace_routine::LogBinTableRendererTemplate< T_COROUTINE >

Print the information in the LogBinProfiler for each Coroutine in a human-readable table.

Each bin is printed as a 5-digit number, since the bins use a uint16_t integer for the count. The number of digits in the printed number is equivalent to the log10() of the frequency count. To see why that's true, imagine if each digit of the bin count was replaced by a '*' character. Therefore the table is a rough ASCII version of a log-log graph of the frequency count.

For example, the output of printTo(Serial, 2, 10) for examples/SoundManager looks like this:

* name          <8us <16us <32us <64us<128us<256us<512us  <1ms  <2ms    >>
* soundManager  1418     0     0     1     0     0     0     0     1     0
* soundRoutine  1417     0     0     1     1     1     0     0     0     0
* 

The bins below the first bin (at startBin) are rolled into the first bin. The bins above the last bin (at endBin-1) are rolled into the last bin and printed with the label >>.

Template Parameters
T_COROUTINEclass of the specific CoroutineTemplate instantiation, usually Coroutine

Definition at line 105 of file LogBinTableRenderer.h.

Member Function Documentation

◆ printTo()

template<typename T_COROUTINE >
static void ace_routine::LogBinTableRendererTemplate< T_COROUTINE >::printTo ( Print &  printer,
uint8_t  startBin,
uint8_t  endBin,
bool  clear = true,
bool  rollup = true 
)
inlinestatic

Loop over all coroutines and print the ASCII version of the frequency distribution.

This assumes that all the coroutines are using the same CoroutineProfiler class, so we can use any of the profilers to print the header, and the numbers will be lined up properly.

Parameters
printerdestination of output, usually Serial
startBinstart index of the bins (0-31)
endBinend index (exclusive) of the bins (0-32)
clearcall LogBinProfiler::clear() after printing (default true)
rolluproll-up exterior bins into the first and last bins (default true)

Definition at line 124 of file LogBinTableRenderer.h.


The documentation for this class was generated from the following file: