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

Side by Side Diff: ui/latency/latency_info.h

Issue 2954473002: Record accuracy of expected queueing time metric. (Closed)
Patch Set: Set trace ID in test. Created 3 years, 5 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
« no previous file with comments | « ui/latency/ipc/latency_info_param_traits.cc ('k') | ui/latency/latency_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef UI_LATENCY_LATENCY_INFO_H_ 5 #ifndef UI_LATENCY_LATENCY_INFO_H_
6 #define UI_LATENCY_LATENCY_INFO_H_ 6 #define UI_LATENCY_LATENCY_INFO_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 const LatencyMap& latency_components() const { return latency_components_; } 202 const LatencyMap& latency_components() const { return latency_components_; }
203 203
204 const SourceEventType& source_event_type() const { 204 const SourceEventType& source_event_type() const {
205 return source_event_type_; 205 return source_event_type_;
206 } 206 }
207 void set_source_event_type(SourceEventType type) { 207 void set_source_event_type(SourceEventType type) {
208 source_event_type_ = type; 208 source_event_type_ = type;
209 } 209 }
210 210
211 void set_expected_queueing_time_on_dispatch(
212 base::TimeDelta expected_queueing_time) {
213 expected_queueing_time_on_dispatch_ = expected_queueing_time;
214 }
215
216 base::TimeDelta expected_queueing_time_on_dispatch() const {
217 return expected_queueing_time_on_dispatch_;
218 }
219
211 bool began() const { return began_; } 220 bool began() const { return began_; }
212 bool terminated() const { return terminated_; } 221 bool terminated() const { return terminated_; }
213 void set_coalesced() { coalesced_ = true; } 222 void set_coalesced() { coalesced_ = true; }
214 bool coalesced() const { return coalesced_; } 223 bool coalesced() const { return coalesced_; }
215 int64_t trace_id() const { return trace_id_; } 224 int64_t trace_id() const { return trace_id_; }
216 void set_trace_id(int64_t trace_id) { trace_id_ = trace_id; } 225 void set_trace_id(int64_t trace_id) { trace_id_ = trace_id; }
217 226
218 private: 227 private:
219 void AddLatencyNumberWithTimestampImpl(LatencyComponentType component, 228 void AddLatencyNumberWithTimestampImpl(LatencyComponentType component,
220 int64_t id, 229 int64_t id,
(...skipping 15 matching lines...) Expand all
236 // The unique id for matching the ASYNC_BEGIN/END trace event. 245 // The unique id for matching the ASYNC_BEGIN/END trace event.
237 int64_t trace_id_; 246 int64_t trace_id_;
238 // Whether this event has been coalesced into another event. 247 // Whether this event has been coalesced into another event.
239 bool coalesced_; 248 bool coalesced_;
240 // Whether a begin component has been added. 249 // Whether a begin component has been added.
241 bool began_; 250 bool began_;
242 // Whether a terminal component has been added. 251 // Whether a terminal component has been added.
243 bool terminated_; 252 bool terminated_;
244 // Stores the type of the first source event. 253 // Stores the type of the first source event.
245 SourceEventType source_event_type_; 254 SourceEventType source_event_type_;
255 // The expected queueing time on the main thread when this event was
256 // dispatched.
257 base::TimeDelta expected_queueing_time_on_dispatch_;
246 258
247 #if !defined(OS_IOS) 259 #if !defined(OS_IOS)
248 friend struct IPC::ParamTraits<ui::LatencyInfo>; 260 friend struct IPC::ParamTraits<ui::LatencyInfo>;
249 friend struct mojo::StructTraits<ui::mojom::LatencyInfoDataView, 261 friend struct mojo::StructTraits<ui::mojom::LatencyInfoDataView,
250 ui::LatencyInfo>; 262 ui::LatencyInfo>;
251 #endif 263 #endif
252 }; 264 };
253 265
254 // This is declared here for use in gtest-based unit tests, but is defined in 266 // This is declared here for use in gtest-based unit tests, but is defined in
255 // //ui/latency:test_support target. 267 // //ui/latency:test_support target.
256 // Without this the default PrintTo template in gtest tries to pass LatencyInfo 268 // Without this the default PrintTo template in gtest tries to pass LatencyInfo
257 // by value, which leads to an alignment compile error on Windows. 269 // by value, which leads to an alignment compile error on Windows.
258 void PrintTo(const LatencyInfo& latency, ::std::ostream* os); 270 void PrintTo(const LatencyInfo& latency, ::std::ostream* os);
259 271
260 } // namespace ui 272 } // namespace ui
261 273
262 #endif // UI_LATENCY_LATENCY_INFO_H_ 274 #endif // UI_LATENCY_LATENCY_INFO_H_
OLDNEW
« no previous file with comments | « ui/latency/ipc/latency_info_param_traits.cc ('k') | ui/latency/latency_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698