bpm_manager 0.9.13 → 0.9.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bpm_manager/red_hat.rb +7 -7
- data/lib/bpm_manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16dbf474090e8666a761ab34711919b30b4f5857
|
4
|
+
data.tar.gz: 245372ec47a9bbdb3f81fb499fdceab8940f417b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da1ff1eec46fe57e7848c13d8a14c6f3e7082802da1f1111cf71fb1b773fa076c227b0adf47096008b9d8c1714e90e091ba820624d8eeb5ec3d20f18f73c7482
|
7
|
+
data.tar.gz: 2e0a0b72aa597a50cb990a3cbc0fc18e18d656b48b7285d6a72b9f2fe0c35b72af47d4a45b98818e9cc6d08098232ba86922e2c4cba4a96420c420a8a3ca7984
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -132,12 +132,12 @@ module BpmManager
|
|
132
132
|
# Calculates the process sla
|
133
133
|
sla.process.status = calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent)
|
134
134
|
sla.process.status_name = (calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
|
135
|
-
sla.process.
|
135
|
+
sla.process.percentages = calculate_sla_percent(my_task.process.start_on, process_sla_hours, warning_offset_percent)
|
136
136
|
|
137
137
|
# Calculates the task sla
|
138
138
|
sla.task.status = calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent)
|
139
139
|
sla.task.status_name = (calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
|
140
|
-
sla.task.
|
140
|
+
sla.task.percentages = calculate_sla_percent(my_task.created_on, task_sla_hours, warning_offset_percent)
|
141
141
|
else
|
142
142
|
sla = nil
|
143
143
|
end
|
@@ -159,13 +159,13 @@ module BpmManager
|
|
159
159
|
def self.calculate_sla_percent(start, sla_hours = 0.0, offset = 20)
|
160
160
|
total = (Time.now.utc - start.utc).to_f
|
161
161
|
sla_hours = sla_hours.to_f * 3600 # converts to seconds
|
162
|
-
|
162
|
+
percent = OpenStruct.new
|
163
163
|
|
164
|
-
|
165
|
-
|
166
|
-
|
164
|
+
percent.green = sla_hours > 0 ? (start.utc + (sla_hours * (100 - offset) / 100)).to_f * 100 / total : 100
|
165
|
+
percent.yellow = sla_hours > 0 ? ((start.utc + sla_hours).to_f * 100 / total) - percent.green : 0
|
166
|
+
percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
|
167
167
|
|
168
|
-
return
|
168
|
+
return percent
|
169
169
|
end
|
170
170
|
private_class_method :calculate_sla_percent
|
171
171
|
|
data/lib/bpm_manager/version.rb
CHANGED