Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Base class to print a nice summary of a group of statistics. More...
#include <stats.h>
Public Types | |
enum | PrintOrder { SORT_BY_PRIORITY_THEN_VALUE = 0 , SORT_BY_NAME = 1 } |
Public Member Functions | |
StatsGroup (absl::string_view name) | |
StatsGroup (const StatsGroup &)=delete | |
This type is neither copyable nor movable. | |
StatsGroup & | operator= (const StatsGroup &)=delete |
~StatsGroup () | |
void | Register (Stat *stat) |
std::string | StatString () const |
void | SetPrintOrder (PrintOrder print_order) |
TimeDistribution * | LookupOrCreateTimeDistribution (std::string name) |
void | Reset () |
Calls Reset() on all the statistics registered with this group. | |
Base class to print a nice summary of a group of statistics.
|
inlineexplicit |
|
delete |
This type is neither copyable nor movable.
TimeDistribution * operations_research::StatsGroup::LookupOrCreateTimeDistribution | ( | std::string | name | ) |
Returns and if needed creates and registers a TimeDistribution with the given name. Note that this involve a map lookup and his thus slower than directly accessing a TimeDistribution variable.
|
delete |
void operations_research::StatsGroup::Register | ( | Stat * | stat | ) |
Registers a Stat, which will appear in the string returned by StatString(). The Stat object must live as long as this StatsGroup.
void operations_research::StatsGroup::Reset | ( | ) |
|
inline |
Changes the print ordering (will affect the order in which the stats registered with this group are printed via StatString()).
std::string operations_research::StatsGroup::StatString | ( | ) | const |
Returns this group name, followed by one line per Stat registered with this group (this includes the ones created by LookupOrCreateTimeDistribution()).
Computes the longest name of all the stats we want to display. Also create a temporary vector so we can sort the stats by names.
We support UTF8 characters in the stat names.
Do not display groups without print-worthy stats.
Pretty-print all the stats.