Bug 167471 - Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
Summary: Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-01-26 15:44 PST by Chris Dumez
Modified: 2017-01-26 16:16 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.96 KB, patch)
2017-01-26 15:56 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.