Greetings,
I’ve never modified telegraf source or tested plugins before, tried to google and stumble my way through it but I seem to be missing some arg or step.
I added some data points to telegraf/plugins/input/lustre2. Modified both lustre2.go and lustre2_test.go. lustre2_test.go creates a test tree and test files for lustre2.go to parse and create output. I cannot seem to make it create any output, I just get OK at the various steps and no data string of what the module would output using the test tree and test files.
go test -v plugins/inputs/lustre2/lustre2.go plugins/inputs/lustre2/lustre2_test.go
=== RUN TestLustre2GeneratesMetrics
— PASS: TestLustre2GeneratesMetrics (0.00s)
=== RUN TestLustre2GeneratesClientMetrics
— PASS: TestLustre2GeneratesClientMetrics (0.00s)
=== RUN TestLustre2GeneratesJobstatsMetrics
— PASS: TestLustre2GeneratesJobstatsMetrics (0.00s)
=== RUN TestLustre2CanParseConfiguration
— PASS: TestLustre2CanParseConfiguration (0.00s)
PASS
ok command-line-arguments (cached)
I was assuming I’d get the output string where I could make sure I was sourcing the correct fields in my modification.
lustre2,host=oss2,jobid=42990218,name=wrk-OST0041 jobstats_ost_setattr=0i,jobstats_ost_sync=0i,jobstats_punch=0i,jobstats_read_bytes=4096i,jobstats_read_calls=1i,jobstats_read_max_size=4096i,jobstats_read_min_size=4096i,jobstats_write_bytes=310206488i,jobstats_write_calls=7423i,jobstats_write_max_size=53048i,jobstats_write_min_size=8820i 1556525847000000000
Can someone give me some pointers or insight to what I am doing wrong or how to properly test the modifications I made (sourcing other files, new fields, etc).
Many thanks!