data_type_histogram.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef COMPONENTS_SYNC_BASE_DATA_TYPE_HISTOGRAM_H_
  5. #define COMPONENTS_SYNC_BASE_DATA_TYPE_HISTOGRAM_H_
  6. #include "base/metrics/histogram_macros.h"
  7. #include "components/sync/base/model_type.h"
  8. namespace syncer {
  9. // The enum values are used for histogram suffixes. When adding a new type here,
  10. // extend also the "SyncModelTypeUpdateDrop" <histogram_suffixes> in
  11. // histograms.xml.
  12. enum class UpdateDropReason {
  13. kInconsistentClientTag,
  14. kCannotGenerateStorageKey,
  15. kTombstoneInFullUpdate,
  16. kTombstoneForNonexistentInIncrementalUpdate,
  17. kDecryptionPending,
  18. kDecryptionPendingForTooLong,
  19. kFailedToDecrypt
  20. };
  21. // Records that a remote update of an entity of type |type| got dropped into a
  22. // |reason| related histogram.
  23. void SyncRecordModelTypeUpdateDropReason(UpdateDropReason reason,
  24. ModelType type);
  25. // Converts memory size |bytes| into kilobytes and records it into |model_type|
  26. // related histogram for memory footprint of sync data.
  27. void SyncRecordModelTypeMemoryHistogram(ModelType model_type, size_t bytes);
  28. // Records |count| into a |model_type| related histogram for count of sync
  29. // entities.
  30. void SyncRecordModelTypeCountHistogram(ModelType model_type, size_t count);
  31. } // namespace syncer
  32. #endif // COMPONENTS_SYNC_BASE_DATA_TYPE_HISTOGRAM_H_