summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/data_type_association_stats.h
blob: c779dcd0191af1cec6049fe747c2e10dfc6b4094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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"

namespace syncer {

// Container for datatype association results.
struct SYNC_EXPORT DataTypeAssociationStats {
  DataTypeAssociationStats();
  ~DataTypeAssociationStats();

  // The datatype that was associated.
  ModelType model_type;

  // The state of the world before association.
  int num_local_items_before_association;
  int num_sync_items_before_association;

  // The state of the world after association.
  int num_local_items_after_association;
  int num_sync_items_after_association;

  // The changes that took place during association. In a correctly working
  // system these should be the deltas between before and after.
  int num_local_items_added;
  int num_local_items_deleted;
  int num_local_items_modified;
  int num_sync_items_added;
  int num_sync_items_deleted;
  int num_sync_items_modified;

  // 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

#endif  // SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ASSOCIATION_STATS_H_