Skip to content

Commit b2a1cba

Browse files
hanleyjadanielnelson
authored andcommitted
Allow jobs with dashes in the name in lustre2 input (#6313)
(cherry picked from commit 17a79e2)
1 parent f0a498c commit b2a1cba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/inputs/lustre2/lustre2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func (l *Lustre2) GetLustreProcStats(fileglob string, wantedFields []*mapping, a
377377
if err != nil {
378378
return err
379379
}
380-
jobs := strings.Split(string(wholeFile), "-")
380+
jobs := strings.Split(string(wholeFile), "- ")
381381
for _, job := range jobs {
382382
lines := strings.Split(string(job), "\n")
383383
jobid := ""

plugins/inputs/lustre2/lustre2_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cache_miss 11653333250 samples [pages] 1 1 11653333250
4242
`
4343

4444
const obdfilterJobStatsContents = `job_stats:
45-
- job_id: testjob1
45+
- job_id: cluster-testjob1
4646
snapshot_time: 1461772761
4747
read_bytes: { samples: 1, unit: bytes, min: 4096, max: 4096, sum: 4096 }
4848
write_bytes: { samples: 25, unit: bytes, min: 1048576, max: 1048576, sum: 26214400 }
@@ -92,7 +92,7 @@ crossdir_rename 369571 samples [reqs]
9292
`
9393

9494
const mdtJobStatsContents = `job_stats:
95-
- job_id: testjob1
95+
- job_id: cluster-testjob1
9696
snapshot_time: 1461772761
9797
open: { samples: 5, unit: reqs }
9898
close: { samples: 4, unit: reqs }
@@ -207,7 +207,7 @@ func TestLustre2GeneratesJobstatsMetrics(t *testing.T) {
207207

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

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

0 commit comments

Comments
 (0)