Changeset 265131 in webkit
- Timestamp:
- Jul 30, 2020 9:49:30 PM (4 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r265122 r265131 1 2020-07-30 Simon Fraser <simon.fraser@apple.com> 2 3 Have TimingScope track the max event duration 4 https://bugs.webkit.org/show_bug.cgi?id=215006 5 6 Reviewed by Tim Horton. 7 8 Have TimingScope track and print the longest event, as well as the count and 9 mean duration. 10 11 * wtf/TimingScope.cpp: 12 (WTF::TimingScope::scopeDidEnd): 13 1 14 2020-07-30 Keith Miller <keith_miller@apple.com> 2 15 -
trunk/Source/WTF/wtf/TimingScope.cpp
r245061 r265131 42 42 Seconds totalDuration; 43 43 unsigned callCount { 0 }; 44 Seconds maxDuration; 44 45 45 46 Seconds meanDuration() const { return totalDuration / callCount; } … … 53 54 auto& result = totals.add(name, CallData()).iterator->value; 54 55 ++result.callCount; 56 result.maxDuration = std::max(result.maxDuration, duration); 55 57 result.totalDuration += duration; 56 58 return result; … … 74 76 const auto& data = state().addToTotal(m_name, MonotonicTime::now() - m_startTime); 75 77 if (!(data.callCount % m_logIterationInterval)) 76 WTFLogAlways("%s: %u calls, mean duration: %.6fms, total duration: %.6fms ", m_name, data.callCount, data.meanDuration().milliseconds(), data.totalDuration.milliseconds());78 WTFLogAlways("%s: %u calls, mean duration: %.6fms, total duration: %.6fms, max duration %.6fms", m_name, data.callCount, data.meanDuration().milliseconds(), data.totalDuration.milliseconds(), data.maxDuration.milliseconds()); 77 79 } 78 80
Note: See TracChangeset
for help on using the changeset viewer.