summaryrefslogtreecommitdiff
path: root/absl/strings/internal/cordz_statistics.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-05-04 09:52:56 -0700
committerGravatar Andy Getz <durandal@google.com>2021-05-04 13:46:18 -0400
commitcba8cf87bcaac32e90a366fa16216ee89f7f61cc (patch)
tree64df1ab20ff988498a18e5b0fde96f5d27c15d74 /absl/strings/internal/cordz_statistics.h
parenta9831f1cbf93fb18dd951453635f488037454ce9 (diff)
Export of internal Abseil changes
-- 5d6734366ec54997df5234ac3b7e21015d7d5fde by Martijn Vels <mvels@google.com>: Increase slop for unit test to reduce flakiness of test PiperOrigin-RevId: 371935786 -- 6e97ff23e7f732ebf969bbc69102e5e677aae8cd by Martijn Vels <mvels@google.com>: Add node and memory usage stats analysis to GetCordzStatistics. PiperOrigin-RevId: 371893353 -- 17f7443e6f988f25efa25c2291c1cde191af2bf2 by Martijn Vels <mvels@google.com>: Add check on n == 0 in CordReader::ReadCord, which breaks invariants in the ring buffer code. PiperOrigin-RevId: 371738207 GitOrigin-RevId: 5d6734366ec54997df5234ac3b7e21015d7d5fde Change-Id: I0fc883f4f49f2380ab9afddbdfe6eb5ccc15dfc3
Diffstat (limited to 'absl/strings/internal/cordz_statistics.h')
-rw-r--r--absl/strings/internal/cordz_statistics.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/absl/strings/internal/cordz_statistics.h b/absl/strings/internal/cordz_statistics.h
index 6e335c0b..1c93dfd0 100644
--- a/absl/strings/internal/cordz_statistics.h
+++ b/absl/strings/internal/cordz_statistics.h
@@ -28,6 +28,15 @@ namespace cord_internal {
struct CordzStatistics {
using MethodIdentifier = CordzUpdateTracker::MethodIdentifier;
+ // Node counts information
+ struct NodeCounts {
+ size_t flat = 0;
+ size_t external = 0;
+ size_t substring = 0;
+ size_t concat = 0;
+ size_t ring = 0;
+ };
+
// The size of the cord in bytes. This matches the result of Cord::size().
int64_t size = 0;
@@ -50,6 +59,9 @@ struct CordzStatistics {
// A value of 0 implies the property has not been recorded.
int64_t node_count = 0;
+ // Detailed node counts per type
+ NodeCounts node_counts;
+
// The cord method responsible for sampling the cord.
MethodIdentifier method = MethodIdentifier::kUnknown;