metrics-ipmi-blobs: Convert to nanopb
Tested: Decoded a metric proto from a host and verified that the fields
all looked as expected and "normal" with decode successfully identifying
everything.
Change-Id: Iaa1b5500db6d1b93fae95d44a1045a858624cc51
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/subprojects/metrics-ipmi-blobs/metric.hpp b/subprojects/metrics-ipmi-blobs/metric.hpp
index 7af7914..0f94d5f 100644
--- a/subprojects/metrics-ipmi-blobs/metric.hpp
+++ b/subprojects/metrics-ipmi-blobs/metric.hpp
@@ -13,11 +13,6 @@
// limitations under the License.
#pragma once
-
-#include "metricblob.pb.h"
-
-#include <unistd.h>
-
#include <blobs-ipmid/blobs.hpp>
#include <atomic>
@@ -60,19 +55,12 @@
*/
uint32_t size();
- private:
/**
- * Serialize to the pb_dump_ array.
+ * Returns the ID of the provided string
*/
- void serializeSnapshotToArray(
- const bmcmetrics::metricproto::BmcMetricSnapshot& snapshot);
-
- // The two following functions access the snapshot's string table so they
- // have to be member functions.
- bmcmetrics::metricproto::BmcProcStatMetric getProcStatList();
- bmcmetrics::metricproto::BmcFdStatMetric getFdStatList();
-
int getStringID(const std::string_view s);
+
+ private:
std::atomic<bool> done;
std::vector<char> pbDump;
std::unordered_map<std::string, int> stringTable;