80 #ifdef TrackStatistics
91 void log(
const std::string& identifier,
double value,
bool disableSampling =
false );
96 void log(
const std::string& identifier,
const std::string& value );
103 void inc(
const std::string& identifier,
double value = 1.0,
bool disableSampling =
false,
bool clearAfterDatabaseDump =
false );
105 inline void log( [[maybe_unused]]
const std::string& identifier, [[maybe_unused]]
double value, [[maybe_unused]]
bool disableSampling =
false ) {}
106 inline void log( [[maybe_unused]]
const std::string& identifier, [[maybe_unused]]
const std::string& value ) {}
107 inline void inc( [[maybe_unused]]
const std::string& identifier, [[maybe_unused]]
double value = 1.0, [[maybe_unused]]
bool disableSampling =
false, [[maybe_unused]]
bool clearAfterDatabaseDump =
false ) {}
142 void writeToCSV( std::string filename =
"statistics" );
174 std::vector< std::tuple<double,double,double,double,int> >
_data;
187 std::vector< std::tuple<double,std::string> >
_data;
214 bool acceptNewData(
const std::string& identifier,
bool disableSampling);
221 void initData(
const std::string& identifier);
Global statistics interface.
tarch::timing::Watch _globalWatch
void log(const std::string &identifier, double value, bool disableSampling=false)
std::map< std::string, LogMessage > _logMessageMap
void updateDataSnapshot(const std::string &identifier, double value)
Updates snapshot.
void initData(const std::string &identifier)
Ensures that dataset is there.
void log(const std::string &identifier, const std::string &value)
void writeToCSV(std::string filename="statistics")
Write data to csv file.
double _maxTimeInBetweenTwoMeasurements
void inc(const std::string &identifier, double value=1.0, bool disableSampling=false, bool clearAfterDatabaseDump=false)
int _maxCountInBetweenTwoMeasurements
std::map< std::string, DataSet > _dataSetMap
Mapping from identifier who wrote stats (key) onto DataSet.
static tarch::multicore::BooleanSemaphore _semaphore
static Statistics _singleton
bool acceptNewData(const std::string &identifier, bool disableSampling)
Not const, as it also updates the internal counters.
static Statistics & getInstance()
This is not the canonical realisation of singletons as I use it usually for stats in Peano.
A simple class that has to be included to measure the clock ticks required for an operation.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
One data set for one type (identifier) of statistics.
DataSet()
As we hold data sets within a map, we need a default constructor.
void createNewSnapshot(double t, bool clearAfterDatabaseDump)
std::string toString() const
tarch::timing::Watch _watch
Not used for time stamps but only for sampling.
std::vector< std::tuple< double, double, double, double, int > > _data
std::vector< std::tuple< double, std::string > > _data