diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-03-03 14:25:32 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2020-03-03 14:25:32 +0000 |
commit | ab6e28417a9195fe03b8355a808a81276d0435ff (patch) | |
tree | 3bf903f2dea07ac27b7de2168e76182ce0974a0c /lib/jobs | |
parent | 220ebc31c057bbf47eec1cccbbae8b3cf2190d24 (diff) |
Added command line config
Diffstat (limited to 'lib/jobs')
-rw-r--r-- | lib/jobs/slurm_job_states.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/jobs/slurm_job_states.rb b/lib/jobs/slurm_job_states.rb index bc3e8a1..9d4ea94 100644 --- a/lib/jobs/slurm_job_states.rb +++ b/lib/jobs/slurm_job_states.rb @@ -1,10 +1,11 @@ class SlurmJobStates - def initialize(collector) + def initialize(collector, config) @collector = collector + @interval = config[:collect_every] end def run - start_time = (Time.now - 60).strftime("%H:%M:%S") + start_time = (Time.now - @interval).strftime("%H:%M:%S") raw = `sacct -a -P -o State -S #{start_time}`.lines.map(&:strip)[1..-1] tally = Hash.new{0} |