#include <Statistics.hpp>
Collects and prints statistics.
Definition at line 442 of file Statistics.hpp.
◆ StatisticsRange
◆ StatisticsCollector() [1/2]
| jlm::util::StatisticsCollector::StatisticsCollector |
( |
| ) |
|
|
inline |
◆ StatisticsCollector() [2/2]
◆ CollectDemandedStatistics()
| void jlm::util::StatisticsCollector::CollectDemandedStatistics |
( |
std::unique_ptr< Statistics > |
statistics | ) |
|
|
inline |
Add statistics to collected statistics. A statistics is only added if it is demanded.
- Parameters
-
| statistics | The statistics to collect. |
- See also
- StatisticsCollectorSettings::IsDemanded()
Definition at line 574 of file Statistics.hpp.
◆ CollectedStatistics()
| StatisticsRange jlm::util::StatisticsCollector::CollectedStatistics |
( |
| ) |
const |
|
inlinenoexcept |
◆ createOutputFile()
| File jlm::util::StatisticsCollector::createOutputFile |
( |
std::string |
fileNameSuffix, |
|
|
bool |
includeCount = false |
|
) |
| |
Creates a unique file name in the statistics and debug output directory. If a module name is specified in the settings, it is included in the file name. If a unique string is specified in the settings, it is also included. Lastly the given fileNameSuffix is used as the suffix for the file, including an optional counter if includeCount is true.
If the specified output directory does not exist, it is created.
- Parameters
-
| fileNameSuffix | the output file name suffix, e.g., "statistics.log" |
| includeCount | include a counter per suffix, to avoid naming collisions |
- Returns
- a file representing the new output file
- Exceptions
-
| jlm::util::error | in any of the following cases:
- no output directory has been specified in the StatisticsCollectorSettings
- any issues occur with creating the output directory
- the resulting output file already exists
|
Definition at line 182 of file Statistics.cpp.
◆ GetSettings()
◆ IsDemanded() [1/2]
| bool jlm::util::StatisticsCollector::IsDemanded |
( |
const Statistics & |
statistics | ) |
const |
|
inlinenoexcept |
Checks if the pass statistics is demanded.
- Parameters
-
| statistics | The statistics to check whether it is demanded. |
- Returns
- True if
statistics is demanded, otherwise false.
Definition at line 561 of file Statistics.hpp.
◆ IsDemanded() [2/2]
| bool jlm::util::StatisticsCollector::IsDemanded |
( |
Statistics::Id |
id | ) |
const |
|
inlinenoexcept |
Checks statistics with the given id are demanded.
- Parameters
-
| id | The statistics id to check. |
- Returns
- True if
statistics with the given id are demanded, otherwise false.
Definition at line 548 of file Statistics.hpp.
◆ NumCollectedStatistics()
| size_t jlm::util::StatisticsCollector::NumCollectedStatistics |
( |
| ) |
const |
|
inlinenoexcept |
◆ PrintStatistics()
| void jlm::util::StatisticsCollector::PrintStatistics |
( |
| ) |
|
Print collected statistics to file. If no statistics have been collected, this is a no-op.
- Exceptions
-
| jlm::util::error | if there are statistics to print, but no output directory in settings |
Definition at line 167 of file Statistics.cpp.
◆ releaseStatistic()
Extracts the last collected statistic with the given statistics id, removing it from the collector and returning an owned pointer.
- Parameters
-
| id | the id of the statistic to extract. |
- Returns
- an owned pointer to the extracted statistic instance.
- Exceptions
-
| std::out_of_range | if no statistic instance with the given id is present. |
Definition at line 588 of file Statistics.hpp.
◆ CollectedStatistics_
| std::vector<std::unique_ptr<Statistics> > jlm::util::StatisticsCollector::CollectedStatistics_ |
|
private |
◆ OutputFileCounter_
| std::unordered_map<std::string, size_t> jlm::util::StatisticsCollector::OutputFileCounter_ |
|
private |
◆ Settings_
The documentation for this class was generated from the following files: