Skip to content

Commit

Permalink
Merge pull request #71 from HewlettPackard/wip-fix-empty-metric
Browse files Browse the repository at this point in the history
Skip empty jobstats
  • Loading branch information
Joe Handzik authored May 16, 2017
2 parents 7e4b5eb + dd58ab6 commit 8fa85a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sources/procfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ func getJobStatsByOperation(jobBlock string, jobID string, promName string, help
pattern := opMap[helpText].pattern
opStat := regexCaptureString(pattern+": .*", jobBlock)
opNumbers := regexCaptureStrings("[0-9]*.[0-9]+|[0-9]+", opStat)
if len(opNumbers) < 1 {
return nil, nil
}
result, err := strconv.ParseUint(strings.TrimSpace(opNumbers[opMap[helpText].index]), 10, 64)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8fa85a6

Please # to comment.