aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKillian Murphy <killian.murphy@york.ac.uk>2020-10-30 18:18:36 +0000
committerKillian Murphy <killian.murphy@york.ac.uk>2020-10-30 18:18:36 +0000
commite9aa40ca482919267dc4edc3e4f3efbe8a0f81bb (patch)
tree82fb36d445d8cbc50bb8ab68d0f7e8733b1b6eb9
parent7b35c62b49f0a50a5fbe5aff0759c78326130785 (diff)
Checkpointing
-rw-r--r--pending_on_qos.rb22
1 files changed, 14 insertions, 8 deletions
diff --git a/pending_on_qos.rb b/pending_on_qos.rb
index 7f7b3df..7d99c8c 100644
--- a/pending_on_qos.rb
+++ b/pending_on_qos.rb
@@ -20,25 +20,31 @@ class PendingOnQos
def raid
@partition_thresholds.each do |partition, threshold|
- start_time = (Time.now - @partition_thresholds[:partition])
- .strftime('%Y-%m-:%d')
+ start_time = (Time.now - threshold).strftime('%Y-%m-%d')
squeue_cmd = [
'squeue',
'--format="%A,%R,%V"',
'--noheader',
- '--parsable2',
"--partition=#{partition}",
'--state=PENDING'
].join(' ')
+
+ output = `#{squeue_cmd}`.split('\n')
+
+ puts output
end
@collector.report!(
- name: 'pending_on_qos',
- value: 255,
- help: 'Number of jobs pending for QoS reasons',
- type: 'gauge',
- labels: { partition: 'nodes' }
+ 'pending_on_qos',
+ 255,
+ {
+ help: 'Number of jobs pending for QoS reasons',
+ type: 'gauge',
+ labels: {
+ partition: 'nodes'
+ }
+ }
)
end
end