13namespace detail::stats
29 using Clock = std::chrono::steady_clock;
73 enum class EGroupedReport
77 ProportionWithAverage,
78 ProportionWithAverageAndTotal
81 std::vector<TimeRecord> m_records;
83 static GroupedTimeRecord makeGroupedTimeRecordRecursive(
const std::vector<TimeRecord>& records);
85 static std::string makeGroupedReportRecursive(
86 const GroupedTimeRecord& records,
87 EGroupedReport reportType,
88 const std::string& linePrefix);
93#define PH_DEFINE_INLINE_TIMER_STAT(statName, categoryName)\
94 inline ::ph::detail::stats::TimeCounter& internal_impl_time_counter_access_##statName()\
96 static ::ph::detail::stats::TimeCounter counter(#statName, #categoryName);\
100#define PH_DEFINE_INTERNAL_TIMER_STAT(statName, categoryName)\
103 PH_DEFINE_INLINE_TIMER_STAT(statName, categoryName);\
106#define PH_DEFINE_EXTERNAL_TIMER_STAT(statName, categoryName)\
107 PH_DEFINE_INLINE_TIMER_STAT(statName, categoryName)
109#define PH_SCOPED_TIMER(statName)\
110 ::ph::detail::stats::ScopedTimer internal_impl_scopedTimer##statName(\
111 internal_impl_time_counter_access_##statName())
GroupedTimeRecord getGroupedTimeRecord() const
Definition stats.cpp:87
std::string rawReport() const
Definition stats.cpp:125
std::string detailedReport() const
Definition stats.cpp:114
TimerStatsReport()
Definition stats.cpp:69
std::string averagedReport() const
Definition stats.cpp:103
std::string proportionalReport() const
Definition stats.cpp:92
The root for all renderer implementations.
Definition assertion.h:9
std::vector< GroupedTimeRecord > subgroups
Definition stats.h:59
GroupedTimeRecord()
Definition stats.cpp:65
std::uint64_t count
Definition stats.h:57
std::uint64_t totalMicroseconds
Definition stats.h:56
std::string groupName
Definition stats.h:55
TimeRecord()
Definition stats.cpp:61
std::uint64_t totalMicroseconds
Definition stats.h:47
std::string category
Definition stats.h:46
std::uint64_t count
Definition stats.h:48
std::string name
Definition stats.h:45
TimeCounter & counter
Definition stats.h:31
Clock::time_point startTime
Definition stats.h:32
ScopedTimer(TimeCounter &counter)
Definition stats.cpp:46
~ScopedTimer()
Definition stats.cpp:50
std::chrono::steady_clock Clock
Definition stats.h:29
void addMicroseconds(std::uint64_t microseconds)
Definition stats.cpp:40
const std::string name
Definition stats.h:18
const std::string category
Definition stats.h:19
TimeCounter(std::string name, std::string category)
Definition stats.cpp:32
std::atomic_uint64_t totalMicroseconds
Definition stats.h:20
std::atomic_uint64_t count
Definition stats.h:21