summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/sessions/update_counters.h
blob: 7ce8b5e4a2c6d69d63613440bc41a645f1e877b4 (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
// Copyright 2014 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_SESSIONS_UPDATE_COUNTERS_H_
#define SYNC_INTERNAL_API_PUBLIC_SESSIONS_UPDATE_COUNTERS_H_

#include <string>

#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "sync/base/sync_export.h"

namespace syncer {

// A class to maintain counts related to the update requests and responses for
// a particular sync type.
struct SYNC_EXPORT UpdateCounters {
  UpdateCounters();
  ~UpdateCounters();

  scoped_ptr<base::DictionaryValue> ToValue() const;
  std::string ToString() const;

  int num_updates_received;
  int num_reflected_updates_received;
  int num_tombstone_updates_received;

  int num_updates_applied;
  int num_hierarchy_conflict_application_failures;
  int num_encryption_conflict_application_failures;

  int num_server_overwrites;
  int num_local_overwrites;
};

}  // namespace syncer

#endif  // SYNC_INTERNAL_API_PUBLIC_SESSIONS_UPDATE_COUNTERS_H_