Bug 167471

Summary: Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, commit-queue, kling, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2017-01-26 15:44:42 PST
Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler to use numeric values for logDiagnosticMessageWithValue().
Comment 1 Chris Dumez 2017-01-26 15:50:12 PST
<rdar://problem/30221723>
Comment 2 Chris Dumez 2017-01-26 15:56:47 PST
Created attachment 299870 [details]
Patch
Comment 3 Alex Christensen 2017-01-26 16:08:12 PST
Comment on attachment 299870 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299870&action=review

> Source/WebKit2/UIProcess/PerActivityStateCPUUsageSampler.cpp:87
> +        page->logDiagnosticMessageWithValue(DiagnosticLoggingKeys::cpuUsageKey(), activityStateKey, String::number(cpuUsage, 1), false);

Yeah, we could just make logDiagnosticMessageWithValue take a double and call String::number.
Comment 4 Chris Dumez 2017-01-26 16:10:42 PST
Comment on attachment 299870 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299870&action=review

>> Source/WebKit2/UIProcess/PerActivityStateCPUUsageSampler.cpp:87
>> +        page->logDiagnosticMessageWithValue(DiagnosticLoggingKeys::cpuUsageKey(), activityStateKey, String::number(cpuUsage, 1), false);
> 
> Yeah, we could just make logDiagnosticMessageWithValue take a double and call String::number.

The number of significant digits we log matters though and may depend on the call sites. For example, here 1 significant digit is sufficient but you could imagine us wanting more (or less) in other places.
Comment 5 Chris Dumez 2017-01-26 16:16:09 PST
Comment on attachment 299870 [details]
Patch

Clearing flags on attachment: 299870

Committed r211239: <http://trac.webkit.org/changeset/211239>
Comment 6 Chris Dumez 2017-01-26 16:16:14 PST
All reviewed patches have been landed.  Closing bug.