blob: 9430d309faa7a784d895b2e1535ee0d35fcdaa1c [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2018 The Chromium Authors
Troy Hildebrandtdd10ae172018-11-06 17:55:232// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Tommy Nyquiste5a5b1a152019-01-17 06:54:375#ifndef COMPONENTS_LEVELDB_PROTO_INTERNAL_PROTO_LEVELDB_WRAPPER_METRICS_H_
6#define COMPONENTS_LEVELDB_PROTO_INTERNAL_PROTO_LEVELDB_WRAPPER_METRICS_H_
Troy Hildebrandtdd10ae172018-11-06 17:55:237
8#include <string>
9
10namespace leveldb {
11class Status;
12} // namespace leveldb
13
14namespace leveldb_proto {
15
16// Static metrics recording helper functions for ProtoLevelDBWrapper.
17//
18// When adding database clients that require UMA metrics recording, ensure that
Tommy Nyquist61133cb2021-10-12 22:16:4819// the client name is added as a LevelDBClient variant in
20// //tools/metrics/histograms/metadata/leveldb_proto/histograms.xml for the
21// appropriate ProtoDB.* metrics.
Troy Hildebrandtdd10ae172018-11-06 17:55:2322class ProtoLevelDBWrapperMetrics {
23 public:
Troy Hildebrandtdd10ae172018-11-06 17:55:2324 static void RecordUpdate(const std::string& client,
25 bool success,
26 const leveldb::Status& status);
Troy Hildebrandtdd10ae172018-11-06 17:55:2327 static void RecordLoadEntries(const std::string& client, bool success);
Troy Hildebrandtdd10ae172018-11-06 17:55:2328};
29
30} // namespace leveldb_proto
31
Tommy Nyquist61133cb2021-10-12 22:16:4832#endif // COMPONENTS_LEVELDB_PROTO_INTERNAL_PROTO_LEVELDB_WRAPPER_METRICS_H_