intelsdi-x / snap-plugin-collector-interface

Collects network interface metrics from /proc/interface
http://snap-telemetry.io/
Apache License 2.0
1 stars 13 forks source link

Metrics are now exposed as dynamic #12

Closed obourdon closed 8 years ago

obourdon commented 8 years ago

Depends on #11

All tests passed successfully

obourdon commented 8 years ago

Can someone retrigger Travis CI please. No clue why the tests fail

marcin-krolik commented 8 years ago

@obourdon I took a look at this error and it seems that problem is in function TestCollectMetrics You are preparing mTypes for CollectMetrics, but you forgot to set config for each metric. CollectCetrics "reads" configuration from metrics to get the path, so you need to set up config per each metric.

obourdon commented 8 years ago

@marcin-krolik thanks a lot for digging into this, however what I do not understand is why the tests are running perfectly fine on my environment. As a general rule, I always try to run tests prior to submit the final PR

Nevertheless, I will fix this ASAP. Another point you might want to shed light onto is the fact that I already did the same kind of modifications in other plugins without ever running into this kind of issue so the question: is the code of the interface plugin different from other plugins in this respect (disk, df, cpu, ...) Thanks again for everything

obourdon commented 8 years ago

I just reran the tests on yet another system (MacOSX after tweaking the source code a little bit of course because this plugin is not supposed to be buildable on Macs) and tests ran ok again.

marcin-krolik commented 8 years ago

@obourdon I've just fetched your branch dynamic_metrics, and reran tests in iface directory with go test. As expected I got the same error. How do you run tests on your environment?

obourdon commented 8 years ago

I use

TEST_SUITE=unit make check

If I use your method:

MBP-Olivier-2:snap-plugin-collector-interface olivierbourdon$ cd iface/
MBP-Olivier-2:iface olivierbourdon$ go test
.....
5 total assertions

..................
23 total assertions

................
39 total assertions

PASS
ok      github.com/intelsdi-x/snap-plugin-collector-interface/iface 0.027s
obourdon commented 8 years ago

@marcin-krolik seems to be good now

marcin-krolik commented 8 years ago

LGTM