Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Troy Hildebrandt | dd10ae17 | 2018-11-06 17:55:23 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Tommy Nyquist | e5a5b1a15 | 2019-01-17 06:54:37 | [diff] [blame] | 5 | #ifndef COMPONENTS_LEVELDB_PROTO_INTERNAL_PROTO_LEVELDB_WRAPPER_METRICS_H_ |
| 6 | #define COMPONENTS_LEVELDB_PROTO_INTERNAL_PROTO_LEVELDB_WRAPPER_METRICS_H_ |
Troy Hildebrandt | dd10ae17 | 2018-11-06 17:55:23 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | namespace leveldb { |
| 11 | class Status; |
| 12 | } // namespace leveldb |
| 13 | |
| 14 | namespace 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 Nyquist | 61133cb | 2021-10-12 22:16:48 | [diff] [blame] | 19 | // 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 Hildebrandt | dd10ae17 | 2018-11-06 17:55:23 | [diff] [blame] | 22 | class ProtoLevelDBWrapperMetrics { |
| 23 | public: |
Troy Hildebrandt | dd10ae17 | 2018-11-06 17:55:23 | [diff] [blame] | 24 | static void RecordUpdate(const std::string& client, |
| 25 | bool success, |
| 26 | const leveldb::Status& status); |
Troy Hildebrandt | dd10ae17 | 2018-11-06 17:55:23 | [diff] [blame] | 27 | static void RecordLoadEntries(const std::string& client, bool success); |
Troy Hildebrandt | dd10ae17 | 2018-11-06 17:55:23 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | } // namespace leveldb_proto |
| 31 | |
Tommy Nyquist | 61133cb | 2021-10-12 22:16:48 | [diff] [blame] | 32 | #endif // COMPONENTS_LEVELDB_PROTO_INTERNAL_PROTO_LEVELDB_WRAPPER_METRICS_H_ |