Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Adds bool type to grpc Metric data
Browse files Browse the repository at this point in the history
  • Loading branch information
IRCody committed Aug 30, 2016
1 parent 9eaab0d commit 2c9004f
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 134 deletions.
6 changes: 5 additions & 1 deletion control/plugin/client/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ func ToCoreMetric(mt *rpc.Metric) core.Metric {
ret.data = mt.GetInt32Data()
case *rpc.Metric_Int64Data:
ret.data = mt.GetInt64Data()
case *rpc.Metric_BoolData:
ret.data = mt.GetBoolData()
}

return ret
Expand Down Expand Up @@ -374,10 +376,12 @@ func ToMetric(co core.Metric) *rpc.Metric {
cm.Data = &rpc.Metric_Int64Data{t}
case []byte:
cm.Data = &rpc.Metric_BytesData{t}
case bool:
cm.Data = &rpc.Metric_BoolData{t}
case nil:
cm.Data = nil
default:
panic(fmt.Sprintf("unsupported type: %s", t))
log.Error(fmt.Sprintf("unsupported type: %s", t))
}
return cm
}
Expand Down
200 changes: 116 additions & 84 deletions control/plugin/rpc/plugin.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions control/plugin/rpc/plugin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ message Metric {
int32 int32_data = 12;
int64 int64_data = 13;
bytes bytes_data = 14;
bool bool_data = 15;
}
}

Expand Down
Loading

0 comments on commit 2c9004f

Please sign in to comment.