aboutsummaryrefslogtreecommitdiff
path: root/pending_on_qos.rb
diff options
context:
space:
mode:
Diffstat (limited to 'pending_on_qos.rb')
-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