Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: content/common/inter_process_time_ticks_converter.cc

Issue 481443003: Add UMA histograms for the inter-process TimeTicks skew. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/inter_process_time_ticks_converter.h" 5 #include "content/common/inter_process_time_ticks_converter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return LocalTimeDelta(Convert(remote_delta.value_)); 65 return LocalTimeDelta(Convert(remote_delta.value_));
66 } 66 }
67 67
68 int64 InterProcessTimeTicksConverter::Convert(int64 value) const { 68 int64 InterProcessTimeTicksConverter::Convert(int64 value) const {
69 if (value <= 0) { 69 if (value <= 0) {
70 return value; 70 return value;
71 } 71 }
72 return numerator_ * value / denominator_; 72 return numerator_ * value / denominator_;
73 } 73 }
74 74
75 bool InterProcessTimeTicksConverter::IsSkewAdditiveForMetrics() const {
76 return numerator_ == 1 && denominator_ == 1;
pasko 2014/08/18 09:30:34 I guess non-additive cases are assumed to be low,
77 }
78
79 base::TimeDelta InterProcessTimeTicksConverter::GetSkewForMetrics() const {
80 return base::TimeTicks::FromInternalValue(remote_lower_bound_) -
81 base::TimeTicks::FromInternalValue(local_base_time_);
82 }
83
75 } // namespace content 84 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698