summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc6f54c)
raw | patch | inline | side by side (parent: dc6f54c)
author | Florian Forster <octo@collectd.org> | |
Fri, 29 Jul 2016 09:27:08 +0000 (11:27 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 2 Aug 2016 14:56:58 +0000 (16:56 +0200) |
Fields holding a ValueList are now called "value_list", fields holding
a Value are now called "value". Repeated fields use the plural form.
a Value are now called "value". Repeated fields use the plural form.
proto/collectd.proto | patch | blob | history | |
proto/types.proto | patch | blob | history | |
src/grpc.cc | patch | blob | history |
diff --git a/proto/collectd.proto b/proto/collectd.proto
index 5134dbfdc15f037c27a36335be176dbd55063ce1..4bc3501345321dce50c27bd0090c59e9155d9aaa 100644 (file)
--- a/proto/collectd.proto
+++ b/proto/collectd.proto
// The arguments to DispatchValues.
message DispatchValuesRequest {
- collectd.types.ValueList values = 1;
+ collectd.types.ValueList value_list = 1;
}
// The response from DispatchValues.
// The response from QueryValues.
message QueryValuesReply {
- repeated collectd.types.ValueList values = 1;
+ repeated collectd.types.ValueList value_lists = 1;
}
diff --git a/proto/types.proto b/proto/types.proto
index 4a852e42de37b19fca66a58f5ba586f6f4c9afbc..5d82a5b9add09cd5a090d52a7f3fb168682c288f 100644 (file)
--- a/proto/types.proto
+++ b/proto/types.proto
}
message ValueList {
- repeated Value value = 1;
+ repeated Value values = 1;
google.protobuf.Timestamp time = 2;
google.protobuf.Duration interval = 3;
diff --git a/src/grpc.cc b/src/grpc.cc
index ae3dab25d6445249831d76291a0316c5aa1c7b3e..905e403b1ffb9473cf22d7b8108a422ee585c473 100644 (file)
--- a/src/grpc.cc
+++ b/src/grpc.cc
@@ -172,7 +172,7 @@ static grpc::Status marshal_value_list(const value_list_t *vl, collectd::types::
msg->set_allocated_interval(new google::protobuf::Duration(d));
for (size_t i = 0; i < vl->values_len; ++i) {
- auto v = msg->add_value();
+ auto v = msg->add_values();
switch (ds->ds[i].type) {
case DS_TYPE_COUNTER:
v->set_counter(vl->values[i].counter);
size_t values_len = 0;
status = grpc::Status::OK;
- for (auto v : msg.value()) {
+ for (auto v : msg.values()) {
value_t *val = (value_t *)realloc(values, (values_len + 1) * sizeof(*values));
if (!val) {
status = grpc::Status(grpc::StatusCode::RESOURCE_EXHAUSTED,
DispatchValuesRequest request, DispatchValuesReply *reply)
{
value_list_t vl = VALUE_LIST_INIT;
- auto status = unmarshal_value_list(request.values(), &vl);
+ auto status = unmarshal_value_list(request.value_list(), &vl);
if (!status.ok())
return status;
break;
}
- auto vl = reply->add_values();
+ auto vl = reply->add_value_lists();
status = marshal_value_list(&res, vl);
free(res.values);
if (!status.ok())