Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow jobs with dashes in the name by changing job marker. #6313

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -39,7 +39,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 @@ -89,7 +89,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 @@ -204,7 +204,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