OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sync/driver/startup_controller.h" | 5 #include "components/sync/driver/startup_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return; | 179 return; |
180 } | 180 } |
181 | 181 |
182 if (!start_engine_time_.is_null()) | 182 if (!start_engine_time_.is_null()) |
183 return; | 183 return; |
184 | 184 |
185 DVLOG(2) << "Data type requesting sync startup: " << ModelTypeToString(type); | 185 DVLOG(2) << "Data type requesting sync startup: " << ModelTypeToString(type); |
186 // Measure the time spent waiting for init and the type that triggered it. | 186 // Measure the time spent waiting for init and the type that triggered it. |
187 // We could measure the time spent deferred on a per-datatype basis, but | 187 // We could measure the time spent deferred on a per-datatype basis, but |
188 // for now this is probably sufficient. | 188 // for now this is probably sufficient. |
| 189 // TODO(wychen): enum uma should be strongly typed. crbug.com/661401 |
189 UMA_HISTOGRAM_ENUMERATION("Sync.Startup.TypeTriggeringInit", | 190 UMA_HISTOGRAM_ENUMERATION("Sync.Startup.TypeTriggeringInit", |
190 ModelTypeToHistogramInt(type), MODEL_TYPE_COUNT); | 191 ModelTypeToHistogramInt(type), |
| 192 static_cast<int>(MODEL_TYPE_COUNT)); |
191 if (!start_up_time_.is_null()) { | 193 if (!start_up_time_.is_null()) { |
192 RecordTimeDeferred(); | 194 RecordTimeDeferred(); |
193 UMA_HISTOGRAM_ENUMERATION("Sync.Startup.DeferredInitTrigger", | 195 UMA_HISTOGRAM_ENUMERATION("Sync.Startup.DeferredInitTrigger", |
194 TRIGGER_DATA_TYPE_REQUEST, MAX_TRIGGER_VALUE); | 196 TRIGGER_DATA_TYPE_REQUEST, MAX_TRIGGER_VALUE); |
195 } | 197 } |
196 received_start_request_ = true; | 198 received_start_request_ = true; |
197 TryStart(); | 199 TryStart(); |
198 } | 200 } |
199 | 201 |
200 } // namespace syncer | 202 } // namespace syncer |
OLD | NEW |