ywkaras commented on code in PR #11214:
URL: https://github.com/apache/trafficserver/pull/11214#discussion_r1558010072


##########
include/tsutil/Metrics.h:
##########
@@ -276,13 +287,62 @@ class Metrics
     return _makeId(std::get<0>(id), std::get<1>(id));
   }
 
-  void _addBlob();
+  class Storage
+  {
+    BlobStorage _blobs;
+    uint16_t _cur_blob = 0;
+    uint16_t _cur_off  = 0;
+    LookupTable _lookups;
+    mutable std::mutex _mutex;
+
+  public:
+    Storage(const self_type &)          = delete;
+    Storage &operator=(const Storage &) = delete;
+    Storage &operator=(Storage &&)      = delete;
+    Storage(Storage &&)                 = delete;
+
+    Storage()
+    {
+      _blobs[0] = new NamesAndAtomics();
+      release_assert(_blobs[0]);
+      release_assert(0 == _create("proxy.process.api.metrics.bad_id")); // 
Reserve slot 0 for errors, this should always be 0
+    }
+
+    ~Storage()
+    {
+      for (size_t i = 0; i <= _cur_blob; ++i) {
+        delete _blobs[i];
+      }
+    }
+
+    IdType _create(const std::string_view name);
+    void _addBlob();

Review Comment:
   Why do these functions start with underscore when they' re public?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to