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

Commit

Permalink
Changed mock1 collector RPC Type: from JSONRPC to default NativeRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
IzabellaRaulin committed Oct 18, 2016
1 parent d9b23fa commit 28caf0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions control/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1777,9 +1777,7 @@ func TestDynamicMetricSubscriptionLoad(t *testing.T) {
So(m.Version(), ShouldEqual, 1)
if ok, _ := m.Namespace().IsDynamic(); ok {
// V1's data for no dynamic metric
// Because mock1 uses jsonrpc, all number typers are interpreted
// as float64
val, ok := m.Data().(float64)
val, ok := m.Data().(int)
So(ok, ShouldEqual, true)
So(val, ShouldBeLessThan, 100)
} else {
Expand Down Expand Up @@ -1961,9 +1959,7 @@ func TestDynamicMetricSubscriptionLoadLessMetrics(t *testing.T) {
Convey("metrics are collected from mock1", func() {
for _, m := range mts1 {
if strings.Contains(m.Namespace().String(), "host") {
// Because mock1 uses jsonrpc, all number typers are interpreted
// as float64
val, ok := m.Data().(float64)
val, ok := m.Data().(int)
So(ok, ShouldEqual, true)
So(val, ShouldBeLessThan, 100)
} else {
Expand Down
2 changes: 1 addition & 1 deletion plugin/collector/snap-plugin-collector-mock1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func main() {

// Define metadata about Plugin
meta := mock.Meta()
meta.RPCType = plugin.JSONRPC
meta.RPCType = plugin.NativeRPC
// Start a collector
plugin.Start(meta, new(mock.Mock), os.Args[1])
}

0 comments on commit 28caf0d

Please # to comment.