|
|
|||
File indexing completed on 2025-12-16 09:41:00
0001 // Copyright 2019 The Abseil Authors. 0002 // 0003 // Licensed under the Apache License, Version 2.0 (the "License"); 0004 // you may not use this file except in compliance with the License. 0005 // You may obtain a copy of the License at 0006 // 0007 // https://www.apache.org/licenses/LICENSE-2.0 0008 // 0009 // Unless required by applicable law or agreed to in writing, software 0010 // distributed under the License is distributed on an "AS IS" BASIS, 0011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0012 // See the License for the specific language governing permissions and 0013 // limitations under the License. 0014 0015 #ifndef ABSL_STRINGS_INTERNAL_CORDZ_STATISTICS_H_ 0016 #define ABSL_STRINGS_INTERNAL_CORDZ_STATISTICS_H_ 0017 0018 #include <cstdint> 0019 0020 #include "absl/base/config.h" 0021 #include "absl/strings/internal/cordz_update_tracker.h" 0022 0023 namespace absl { 0024 ABSL_NAMESPACE_BEGIN 0025 namespace cord_internal { 0026 0027 // CordzStatistics captures some meta information about a Cord's shape. 0028 struct CordzStatistics { 0029 using MethodIdentifier = CordzUpdateTracker::MethodIdentifier; 0030 0031 // Node counts information 0032 struct NodeCounts { 0033 size_t flat = 0; // #flats 0034 size_t flat_64 = 0; // #flats up to 64 bytes 0035 size_t flat_128 = 0; // #flats up to 128 bytes 0036 size_t flat_256 = 0; // #flats up to 256 bytes 0037 size_t flat_512 = 0; // #flats up to 512 bytes 0038 size_t flat_1k = 0; // #flats up to 1K bytes 0039 size_t external = 0; // #external reps 0040 size_t substring = 0; // #substring reps 0041 size_t concat = 0; // #concat reps 0042 size_t ring = 0; // #ring buffer reps 0043 size_t btree = 0; // #btree reps 0044 size_t crc = 0; // #crc reps 0045 }; 0046 0047 // The size of the cord in bytes. This matches the result of Cord::size(). 0048 size_t size = 0; 0049 0050 // The estimated memory used by the sampled cord. This value matches the 0051 // value as reported by Cord::EstimatedMemoryUsage(). 0052 // A value of 0 implies the property has not been recorded. 0053 size_t estimated_memory_usage = 0; 0054 0055 // The effective memory used by the sampled cord, inversely weighted by the 0056 // effective indegree of each allocated node. This is a representation of the 0057 // fair share of memory usage that should be attributed to the sampled cord. 0058 // This value is more useful for cases where one or more nodes are referenced 0059 // by multiple Cord instances, and for cases where a Cord includes the same 0060 // node multiple times (either directly or indirectly). 0061 // A value of 0 implies the property has not been recorded. 0062 size_t estimated_fair_share_memory_usage = 0; 0063 0064 // The total number of nodes referenced by this cord. 0065 // For ring buffer Cords, this includes the 'ring buffer' node. 0066 // For btree Cords, this includes all 'CordRepBtree' tree nodes as well as all 0067 // the substring, flat and external nodes referenced by the tree. 0068 // A value of 0 implies the property has not been recorded. 0069 size_t node_count = 0; 0070 0071 // Detailed node counts per type 0072 NodeCounts node_counts; 0073 0074 // The cord method responsible for sampling the cord. 0075 MethodIdentifier method = MethodIdentifier::kUnknown; 0076 0077 // The cord method responsible for sampling the parent cord if applicable. 0078 MethodIdentifier parent_method = MethodIdentifier::kUnknown; 0079 0080 // Update tracker tracking invocation count per cord method. 0081 CordzUpdateTracker update_tracker; 0082 }; 0083 0084 } // namespace cord_internal 0085 ABSL_NAMESPACE_END 0086 } // namespace absl 0087 0088 #endif // ABSL_STRINGS_INTERNAL_CORDZ_STATISTICS_H_
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|