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

Commit

Permalink
SDI-2081: expand supported types for grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
candysmurf committed Nov 16, 2016
1 parent c63df74 commit 16a8c93
Show file tree
Hide file tree
Showing 8 changed files with 376 additions and 258 deletions.
9 changes: 8 additions & 1 deletion control/plugin/client/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,11 @@ func ToCoreMetric(mt *rpc.Metric) core.Metric {
ret.data = mt.GetInt64Data()
case *rpc.Metric_BoolData:
ret.data = mt.GetBoolData()
case *rpc.Metric_Uint32Data:
ret.data = mt.GetUint32Data()
case *rpc.Metric_Uint64Data:
ret.data = mt.GetUint64Data()
}

return ret
}

Expand Down Expand Up @@ -374,6 +377,10 @@ func ToMetric(co core.Metric) *rpc.Metric {
cm.Data = &rpc.Metric_Int64Data{int64(t)}
case int64:
cm.Data = &rpc.Metric_Int64Data{t}
case uint32:
cm.Data = &rpc.Metric_Uint32Data{t}
case uint64:
cm.Data = &rpc.Metric_Uint64Data{t}
case []byte:
cm.Data = &rpc.Metric_BytesData{t}
case bool:
Expand Down
261 changes: 157 additions & 104 deletions control/plugin/rpc/plugin.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions control/plugin/rpc/plugin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ message Metric {
int64 int64_data = 13;
bytes bytes_data = 14;
bool bool_data = 15;
uint32 uint32_data = 16;
uint64 uint64_data = 17;
}
}

Expand Down
12 changes: 3 additions & 9 deletions glide.lock

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

8 changes: 8 additions & 0 deletions grpc/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func ToMetric(co core.Metric) *Metric {
cm.Data = &Metric_Int64Data{int64(t)}
case int64:
cm.Data = &Metric_Int64Data{t}
case uint32:
cm.Data = &Metric_Uint32Data{t}
case uint64:
cm.Data = &Metric_Uint64Data{t}
case []byte:
cm.Data = &Metric_BytesData{t}
case bool:
Expand Down Expand Up @@ -161,6 +165,10 @@ func ToCoreMetric(mt *Metric) core.Metric {
ret.data = mt.GetInt32Data()
case *Metric_Int64Data:
ret.data = mt.GetInt64Data()
case *Metric_Uint32Data:
ret.data = mt.GetUint32Data()
case *Metric_Uint64Data:
ret.data = mt.GetUint64Data()
case *Metric_BoolData:
ret.data = mt.GetBoolData()
}
Expand Down
195 changes: 124 additions & 71 deletions grpc/common/common.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions grpc/common/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ message Metric {
int64 int64_data = 13;
bytes bytes_data = 14;
bool bool_data = 15;
uint32 uint32_data = 16;
uint64 uint64_data = 17;
}
}

Expand Down
145 changes: 72 additions & 73 deletions grpc/controlproxy/rpc/control.pb.go

Large diffs are not rendered by default.

0 comments on commit 16a8c93

Please sign in to comment.