summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-09 21:50:06 +0000
committerhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-09 21:50:06 +0000
commitc6f0f2deec84f57dcd8d61cfbb35bebf5dbb89ff (patch)
tree07ae2169c894eed5a8bff013bdf5950d51f0e35d /sync
parentc3d48fc1ecec141cdaae58785944310fd6e61157 (diff)
downloadchromium_src-c6f0f2deec84f57dcd8d61cfbb35bebf5dbb89ff.zip
chromium_src-c6f0f2deec84f57dcd8d61cfbb35bebf5dbb89ff.tar.gz
chromium_src-c6f0f2deec84f57dcd8d61cfbb35bebf5dbb89ff.tar.bz2
Add time tracking to association stats:
* download time: time spent on downloading data for first time association. * association wait time: time waiting for loading local model and association of preceding data types. * association time: time spent on model association. BUG=236466 Review URL: https://chromiumcodereview.appspot.com/14645020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/internal_api/debug_info_event_listener.cc6
-rw-r--r--sync/internal_api/public/data_type_association_stats.h10
-rw-r--r--sync/protocol/client_debug_info.proto19
3 files changed, 34 insertions, 1 deletions
diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc
index 4beef12..97ff3eb 100644
--- a/sync/internal_api/debug_info_event_listener.cc
+++ b/sync/internal_api/debug_info_event_listener.cc
@@ -201,6 +201,12 @@ void DebugInfoEventListener::OnDataTypeAssociationComplete(
datatype_stats->set_num_sync_items_modified(
association_stats.num_sync_items_modified);
datatype_stats->set_had_error(association_stats.had_error);
+ datatype_stats->set_download_time_us(
+ association_stats.download_time.InMicroseconds());
+ datatype_stats->set_association_wait_time_us(
+ association_stats.association_wait_time.InMicroseconds());
+ datatype_stats->set_association_time_us(
+ association_stats.association_time.InMicroseconds());
AddEventToQueue(association_event);
}
diff --git a/sync/internal_api/public/data_type_association_stats.h b/sync/internal_api/public/data_type_association_stats.h
index 344624a..c779dcd 100644
--- a/sync/internal_api/public/data_type_association_stats.h
+++ b/sync/internal_api/public/data_type_association_stats.h
@@ -5,6 +5,7 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ASSOCIATION_STATS_H_
#define SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ASSOCIATION_STATS_H_
+#include "base/time.h"
#include "sync/base/sync_export.h"
#include "sync/internal_api/public/base/model_type.h"
@@ -37,6 +38,15 @@ struct SYNC_EXPORT DataTypeAssociationStats {
// Whether a datatype unrecoverable error was encountered during association.
bool had_error;
+
+ // Time spent on downloading data for association.
+ base::TimeDelta download_time;
+
+ // Time waiting for local model loading and preceding data types to finish.
+ base::TimeDelta association_wait_time;
+
+ // Time spent on association.
+ base::TimeDelta association_time;
};
} // namespace syncer
diff --git a/sync/protocol/client_debug_info.proto b/sync/protocol/client_debug_info.proto
index ab7de4f..dee1c34 100644
--- a/sync/protocol/client_debug_info.proto
+++ b/sync/protocol/client_debug_info.proto
@@ -86,8 +86,25 @@ message DatatypeAssociationStats {
optional int32 num_sync_items_deleted = 10;
optional int32 num_sync_items_modified = 11;
- // The datatype ran into an error during model association.
+ // The data type ran into an error during model association.
optional bool had_error = 12;
+
+ // Time spent on downloading sync data for first time sync.
+ // Note: This measures the time between asking backend to download data to
+ // being notified of download-ready by backend. So it consists of
+ // time on data downloading and processing at sync backend. But
+ // downloading time should dominate. It's also the total time spent on
+ // downloading data of all types in the priority group of
+ // |data_type_id| instead of just one data type.
+ optional int64 download_time_us = 13;
+
+ // Time between when data of the type becomes ready to when association of
+ // the type starts. This measures the waiting time for local model loading
+ // and association of other preceding data types.
+ optional int64 association_wait_time_us = 14;
+
+ // Time spent on model association.
+ optional int64 association_time_us = 15;
}
message DebugEventInfo {