• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Sync protocol for debug info clients can send to the sync server.
6
7syntax = "proto2";
8
9option optimize_for = LITE_RUNTIME;
10option retain_unknown_fields = true;
11
12package sync_pb;
13
14import "get_updates_caller_info.proto";
15
16// Per-type hint information.
17message TypeHint {
18  // The data type this hint applied to.
19  optional int32 data_type_id = 1;
20
21  // Whether or not a valid hint is provided.
22  optional bool has_valid_hint = 2;
23}
24
25// Information about the source that triggered a sync.
26message SourceInfo {
27  // An enum indicating the reason for the nudge.
28  optional GetUpdatesCallerInfo.GetUpdatesSource source = 1;
29
30  // The per-type hint information associated with the nudge.
31  repeated TypeHint type_hint = 2;
32}
33
34// The additional info here is from the StatusController. They get sent when
35// the event SYNC_CYCLE_COMPLETED  is sent.
36message SyncCycleCompletedEventInfo {
37  // optional bool syncer_stuck = 1; // Was always false, now obsolete.
38
39  // The client has never set these values correctly.  It set
40  // num_blocking_conflicts to the total number of conflicts detected and set
41  // num_non_blocking_conflicts to the number of blocking (aka. simple)
42  // conflicts.
43  //
44  // These counters have been deprecated to avoid further confusion.  The newer
45  // counters provide more detail and are less buggy.
46  optional int32 num_blocking_conflicts = 2 [deprecated = true];
47  optional int32 num_non_blocking_conflicts = 3 [deprecated = true];
48
49  // These new conflict counters replace the ones above.
50  optional int32 num_encryption_conflicts = 4;
51  optional int32 num_hierarchy_conflicts = 5;
52  optional int32 num_simple_conflicts = 6; // No longer sent since M24.
53  optional int32 num_server_conflicts = 7;
54
55  // Counts to track the effective usefulness of our GetUpdate requests.
56  optional int32 num_updates_downloaded = 8;
57  optional int32 num_reflected_updates_downloaded = 9;
58  optional GetUpdatesCallerInfo caller_info = 10;
59
60  // A list of all the sources that were merged into this session.
61  //
62  // Some scenarios, notably mode switches and canary jobs, can spuriously add
63  // back-to-back duplicate sources to this list.
64  repeated SourceInfo source_info = 11;
65}
66
67// Datatype specifics statistics gathered at association time.
68message DatatypeAssociationStats {
69  // The datatype that was associated.
70  optional int32 data_type_id = 1;
71
72  // The state of the world before association.
73  optional int32 num_local_items_before_association = 2;
74  optional int32 num_sync_items_before_association = 3;
75
76  // The state of the world after association.
77  optional int32 num_local_items_after_association = 4;
78  optional int32 num_sync_items_after_association = 5;
79
80  // The changes that got us from before to after. In a correctly working
81  // system these should be the deltas between before and after.
82  optional int32 num_local_items_added = 6;
83  optional int32 num_local_items_deleted = 7;
84  optional int32 num_local_items_modified = 8;
85  optional int32 num_sync_items_added = 9;
86  optional int32 num_sync_items_deleted = 10;
87  optional int32 num_sync_items_modified = 11;
88
89  // Model versions before association. Ideally local and sync model should
90  // have same version if models were persisted properly in last session.
91  // Note: currently version is only set on bookmark model.
92  optional int64 local_version_pre_association = 20;
93  optional int64 sync_version_pre_association = 21;
94
95  // The data type ran into an error during model association.
96  optional bool had_error = 12;
97
98  // Waiting time before downloading starts. This measures the time between
99  // receiving configuration request for a set of data types to starting
100  // downloading data of this type.
101  optional int64 download_wait_time_us = 15;
102
103  // Time spent on downloading sync data for first time sync.
104  // Note: This measures the time between asking backend to download data to
105  //       being notified of download-ready by backend. So it consists of
106  //       time on data downloading and processing at sync backend. But
107  //       downloading time should dominate. It's also the total time spent on
108  //       downloading data of all types in the priority group of
109  //       |data_type_id| instead of just one data type.
110  optional int64 download_time_us = 13;
111
112  // Waiting time for higher priority types to finish association. This
113  // measures the time between finishing downloading data to requesting
114  // association manager to associate this batch of types. High priority types
115  // have near zero waiting time.
116  optional int64 association_wait_time_for_high_priority_us = 16;
117
118  // Waiting time for other types with same priority during association.
119  // Data type manger sends types of same priority to association manager to
120  // configure as a batch. Association manager configures one type at a time.
121  // This measures the time between when a type is sent to association manager
122  // (among other types) to when association manager starts configuring the
123  // type. Total wait time before association is
124  //     |association_wait_time_for_high_priority_us| +
125  //     |association_wait_time_for_same_priority_us|
126  optional int64 association_wait_time_for_same_priority_us = 14;
127
128  // Time spent on model association.
129  optional int64 association_time_us = 17;
130
131  // Higher priority type that's configured before this type.
132  repeated int32 high_priority_type_configured_before = 18;
133
134  // Same priority type that's configured before this type.
135  repeated int32 same_priority_type_configured_before = 19;
136}
137
138message DebugEventInfo {
139  // Singleton event types. These events have no further information beyond
140  // the fact that the event happened.
141  enum SingletonEventType {
142    CONNECTION_STATUS_CHANGE = 1; // Connection status change. Note this
143                                  // gets generated even during a successful
144                                  // connection.
145    UPDATED_TOKEN = 2; // Client received an updated token.
146    PASSPHRASE_REQUIRED = 3; // Cryptographer needs passphrase.
147    PASSPHRASE_ACCEPTED = 4; // Passphrase was accepted by cryptographer.
148    INITIALIZATION_COMPLETE = 5; // Sync Initialization is complete.
149
150    // |STOP_SYNCING_PERMANENTLY| event should never be seen by the server in
151    // the absence of bugs.
152    STOP_SYNCING_PERMANENTLY = 6; // Server sent stop syncing permanently.
153
154    ENCRYPTION_COMPLETE = 7; // Client has finished encrypting all data.
155    ACTIONABLE_ERROR = 8; // Client received an actionable error.
156    ENCRYPTED_TYPES_CHANGED = 9; // Set of encrypted types has changed.
157                                 // NOTE: until m25 bootstrap token updated also
158                                 // shared this field (erroneously).
159    PASSPHRASE_TYPE_CHANGED = 10;  // The encryption passphrase state changed.
160    KEYSTORE_TOKEN_UPDATED = 11;  // A new keystore encryption token was
161                                  // persisted.
162    CONFIGURE_COMPLETE = 12;      // The datatype manager has finished an
163                                  // at least partially successful
164                                  // configuration and is once again syncing
165                                  // with the server.
166    BOOTSTRAP_TOKEN_UPDATED = 13;  // A new cryptographer bootstrap token was
167                                   // generated.
168  }
169
170  // Each of the following fields correspond to different kinds of events. as
171  // a result, only one is set during any single DebugEventInfo.
172  // A singleton event. See enum definition.
173  optional SingletonEventType singleton_event = 1;
174  // A sync cycle completed.
175  optional SyncCycleCompletedEventInfo sync_cycle_completed_event_info = 2;
176  // A datatype triggered a nudge.
177  optional int32 nudging_datatype = 3;
178  // A notification triggered a nudge.
179  repeated int32 datatypes_notified_from_server = 4;
180  // A datatype finished model association.
181  optional DatatypeAssociationStats datatype_association_stats = 5;
182}
183
184message DebugInfo {
185  repeated DebugEventInfo events = 1;
186
187  // Whether cryptographer is ready to encrypt and decrypt data.
188  optional bool cryptographer_ready = 2;
189
190  // Cryptographer has pending keys which indicates the correct passphrase
191  // has not been provided yet.
192  optional bool cryptographer_has_pending_keys = 3;
193
194  // Indicates client has dropped some events to save bandwidth.
195  optional bool events_dropped = 4;
196}
197