From 28caf0d25334c1cfe6104cb96b7d4f141fbe488d Mon Sep 17 00:00:00 2001 From: Izabella Raulin Date: Tue, 18 Oct 2016 18:17:54 +0200 Subject: [PATCH] Changed mock1 collector RPC Type: from JSONRPC to default NativeRPC --- control/control_test.go | 8 ++------ plugin/collector/snap-plugin-collector-mock1/main.go | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/control/control_test.go b/control/control_test.go index d2a7fc448..d44d9d62f 100644 --- a/control/control_test.go +++ b/control/control_test.go @@ -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 { @@ -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 { diff --git a/plugin/collector/snap-plugin-collector-mock1/main.go b/plugin/collector/snap-plugin-collector-mock1/main.go index 995ba831f..2cdf3c6a1 100644 --- a/plugin/collector/snap-plugin-collector-mock1/main.go +++ b/plugin/collector/snap-plugin-collector-mock1/main.go @@ -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]) }