* proto conversion
*/
-static grpc::Status unmarshal_value_list(const collectd::types::ValueList &msg, value_list_t *vl)
+static grpc::Status unmarshal_ident(const collectd::types::Identifier &msg, value_list_t *vl)
{
- vl->time = NS_TO_CDTIME_T(TimeUtil::TimestampToNanoseconds(msg.time()));
- vl->interval = NS_TO_CDTIME_T(TimeUtil::DurationToNanoseconds(msg.interval()));
-
std::string s;
s = msg.host();
s = msg.type_instance();
sstrncpy(vl->type_instance, s.c_str(), sizeof(vl->type_instance));
+ return grpc::Status::OK;
+} /* unmarshal_ident() */
+
+static grpc::Status unmarshal_value_list(const collectd::types::ValueList &msg, value_list_t *vl)
+{
+ vl->time = NS_TO_CDTIME_T(TimeUtil::TimestampToNanoseconds(msg.time()));
+ vl->interval = NS_TO_CDTIME_T(TimeUtil::DurationToNanoseconds(msg.interval()));
+
+ auto status = unmarshal_ident(msg.identifier(), vl);
+ if (!status.ok())
+ return status;
+
value_t *values = NULL;
size_t values_len = 0;
- auto status = grpc::Status::OK;
+ status = grpc::Status::OK;
for (auto v : msg.value()) {
value_t *val = (value_t *)realloc(values, (values_len + 1) * sizeof(*values));