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

Commit 28caf0d

Browse files
Changed mock1 collector RPC Type: from JSONRPC to default NativeRPC
1 parent d9b23fa commit 28caf0d

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

control/control_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,7 @@ func TestDynamicMetricSubscriptionLoad(t *testing.T) {
17771777
So(m.Version(), ShouldEqual, 1)
17781778
if ok, _ := m.Namespace().IsDynamic(); ok {
17791779
// V1's data for no dynamic metric
1780-
// Because mock1 uses jsonrpc, all number typers are interpreted
1781-
// as float64
1782-
val, ok := m.Data().(float64)
1780+
val, ok := m.Data().(int)
17831781
So(ok, ShouldEqual, true)
17841782
So(val, ShouldBeLessThan, 100)
17851783
} else {
@@ -1961,9 +1959,7 @@ func TestDynamicMetricSubscriptionLoadLessMetrics(t *testing.T) {
19611959
Convey("metrics are collected from mock1", func() {
19621960
for _, m := range mts1 {
19631961
if strings.Contains(m.Namespace().String(), "host") {
1964-
// Because mock1 uses jsonrpc, all number typers are interpreted
1965-
// as float64
1966-
val, ok := m.Data().(float64)
1962+
val, ok := m.Data().(int)
19671963
So(ok, ShouldEqual, true)
19681964
So(val, ShouldBeLessThan, 100)
19691965
} else {

plugin/collector/snap-plugin-collector-mock1/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func main() {
3535

3636
// Define metadata about Plugin
3737
meta := mock.Meta()
38-
meta.RPCType = plugin.JSONRPC
38+
meta.RPCType = plugin.NativeRPC
3939
// Start a collector
4040
plugin.Start(meta, new(mock.Mock), os.Args[1])
4141
}

0 commit comments

Comments
 (0)