Skip to content

Commit

Permalink
Allow jobs with dashes in the name in lustre2 input (influxdata#6313)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanleyja authored and bitcharmer committed Oct 18, 2019
1 parent 4f9e3ec commit cb09ab7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/inputs/lustre2/lustre2.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (l *Lustre2) GetLustreProcStats(fileglob string, wantedFields []*mapping, a
if err != nil {
return err
}
jobs := strings.Split(string(wholeFile), "-")
jobs := strings.Split(string(wholeFile), "- ")
for _, job := range jobs {
lines := strings.Split(string(job), "\n")
jobid := ""
Expand Down
6 changes: 3 additions & 3 deletions plugins/inputs/lustre2/lustre2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cache_miss 11653333250 samples [pages] 1 1 11653333250
`

const obdfilterJobStatsContents = `job_stats:
- job_id: testjob1
- job_id: cluster-testjob1
snapshot_time: 1461772761
read_bytes: { samples: 1, unit: bytes, min: 4096, max: 4096, sum: 4096 }
write_bytes: { samples: 25, unit: bytes, min: 1048576, max: 1048576, sum: 26214400 }
Expand Down Expand Up @@ -92,7 +92,7 @@ crossdir_rename 369571 samples [reqs]
`

const mdtJobStatsContents = `job_stats:
- job_id: testjob1
- job_id: cluster-testjob1
snapshot_time: 1461772761
open: { samples: 5, unit: reqs }
close: { samples: 4, unit: reqs }
Expand Down Expand Up @@ -207,7 +207,7 @@ func TestLustre2GeneratesJobstatsMetrics(t *testing.T) {

tempdir := os.TempDir() + "/telegraf/proc/fs/lustre/"
ost_name := "OST0001"
job_names := []string{"testjob1", "testjob2"}
job_names := []string{"cluster-testjob1", "testjob2"}

mdtdir := tempdir + "/mdt/"
err := os.MkdirAll(mdtdir+"/"+ost_name, 0755)
Expand Down

0 comments on commit cb09ab7

Please sign in to comment.