Chromium Code Reviews| Index: ui/latency/latency_info.cc |
| diff --git a/ui/latency/latency_info.cc b/ui/latency/latency_info.cc |
| index 9427c4ccc308e9eaa71f9a60b5b5df36b69c1cd6..2ddb1962917b5fdfd54dce3e7f634de297aa743e 100644 |
| --- a/ui/latency/latency_info.cc |
| +++ b/ui/latency/latency_info.cc |
| @@ -166,7 +166,6 @@ void LatencyInfo::CopyLatencyFrom(const LatencyInfo& other, |
| if (lc.first.first == type) { |
| AddLatencyNumberWithTimestamp(lc.first.first, |
| lc.first.second, |
| - lc.second.sequence_number, |
| lc.second.event_time, |
| lc.second.event_count); |
| } |
| @@ -178,43 +177,36 @@ void LatencyInfo::AddNewLatencyFrom(const LatencyInfo& other) { |
| if (!FindLatency(lc.first.first, lc.first.second, NULL)) { |
| AddLatencyNumberWithTimestamp(lc.first.first, |
| lc.first.second, |
| - lc.second.sequence_number, |
| lc.second.event_time, |
| lc.second.event_count); |
| } |
| } |
| } |
| -void LatencyInfo::AddLatencyNumber(LatencyComponentType component, |
| - int64_t id, |
| - int64_t component_sequence_number) { |
| - AddLatencyNumberWithTimestampImpl(component, id, component_sequence_number, |
| - base::TimeTicks::Now(), 1, nullptr); |
| +void LatencyInfo::AddLatencyNumber(LatencyComponentType component, int64_t id) { |
| + AddLatencyNumberWithTimestampImpl(component, id, base::TimeTicks::Now(), 1, |
| + nullptr); |
| } |
| void LatencyInfo::AddLatencyNumberWithTraceName( |
| LatencyComponentType component, |
| int64_t id, |
| - int64_t component_sequence_number, |
| const char* trace_name_str) { |
| - AddLatencyNumberWithTimestampImpl(component, id, component_sequence_number, |
| - base::TimeTicks::Now(), 1, trace_name_str); |
| + AddLatencyNumberWithTimestampImpl(component, id, base::TimeTicks::Now(), 1, |
| + trace_name_str); |
| } |
| void LatencyInfo::AddLatencyNumberWithTimestamp( |
| LatencyComponentType component, |
| int64_t id, |
| - int64_t component_sequence_number, |
| base::TimeTicks time, |
| uint32_t event_count) { |
| - AddLatencyNumberWithTimestampImpl(component, id, component_sequence_number, |
| - time, event_count, nullptr); |
| + AddLatencyNumberWithTimestampImpl(component, id, time, event_count, nullptr); |
| } |
| void LatencyInfo::AddLatencyNumberWithTimestampImpl( |
| LatencyComponentType component, |
| int64_t id, |
| - int64_t component_sequence_number, |
| base::TimeTicks time, |
| uint32_t event_count, |
| const char* trace_name_str) { |
| @@ -222,9 +214,10 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( |
| g_latency_info_enabled.Get().latency_info_enabled; |
| if (IsBeginComponent(component)) { |
| + static int global_trace_id = 0; |
|
tdresser
2017/06/08 18:36:44
Real change.
dtapuska
2017/06/09 15:15:35
This is kind of scary because latency_info.cc coul
tdresser
2017/06/29 19:04:38
Dealt with in separate patch.
|
| // Should only ever add begin component once. |
| CHECK_EQ(-1, trace_id_); |
| - trace_id_ = component_sequence_number; |
| + trace_id_ = global_trace_id++; // TODO. |
|
tdresser
2017/06/08 18:36:44
I'm not super happy with this naming. Any thoughts
dtapuska
2017/06/26 20:51:43
global trace id isn't ideal because this is actual
|
| if (*latency_info_enabled) { |
| // The timestamp for ASYNC_BEGIN trace event is used for drawing the |
| @@ -269,12 +262,9 @@ void LatencyInfo::AddLatencyNumberWithTimestampImpl( |
| LatencyMap::key_type key = std::make_pair(component, id); |
| LatencyMap::iterator it = latency_components_.find(key); |
| if (it == latency_components_.end()) { |
| - LatencyComponent info = {component_sequence_number, time, event_count, time, |
| - time}; |
| + LatencyComponent info = {time, event_count, time, time}; |
| latency_components_[key] = info; |
| } else { |
| - it->second.sequence_number = std::max(component_sequence_number, |
| - it->second.sequence_number); |
| uint32_t new_count = event_count + it->second.event_count; |
| if (event_count > 0 && new_count != 0) { |
| // Do a weighted average, so that the new event_time is the average of |
| @@ -317,8 +307,6 @@ LatencyInfo::AsTraceableData() { |
| "time", |
| static_cast<double>(lc.second.event_time.ToInternalValue())); |
| component_info->SetDouble("count", lc.second.event_count); |
| - component_info->SetDouble("sequence_number", |
| - lc.second.sequence_number); |
| record_data->Set(GetComponentName(lc.first.first), |
| std::move(component_info)); |
| } |