bpm_manager 0.9.8 → 0.9.9
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 +4 -5
- 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: f7f876541b39e60726f2644add52fa577b12028d
|
4
|
+
data.tar.gz: 096681dcbc632614fb2effe487c0f135143f0098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 612ceebb30f46fc50ffb6f2f45f0ffd19d28bc6b9c723ed70ce377260ed50f203b2ac6792e5680e3c022987b4d8c3f0bffa2f886a75220ebbb699a4b8f1a9bdc
|
7
|
+
data.tar.gz: dd91fa634f1a5ca1265cdced29443e30bed2eb0443b8745f932139f78f3310bda563b2a263b970d515fe664bf1b03c12c1e0e0a266d5a65732e59650374df8bd
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -148,18 +148,17 @@ module BpmManager
|
|
148
148
|
# Private class methods
|
149
149
|
def self.calculate_sla(start, sla_hours = 0.0, offset = 20)
|
150
150
|
sla_hours = sla_hours.to_f * 3600 # converts to seconds
|
151
|
-
|
152
|
-
sla_hours > 0 ? (start + sla_hours) * ((100 - offset) / 100) <= Time.now.utc ? 0 : (start + sla_hours <= Time.now.utc ? 1 : 2) : 0
|
151
|
+
sla_hours > 0 ? Time.at((start.utc + sla_hours).to_f * ((100 - offset) / 100)) <= Time.now.utc ? 0 : (start.utc + sla_hours <= Time.now.utc ? 1 : 2) : 0
|
153
152
|
end
|
154
153
|
private_class_method :calculate_sla
|
155
154
|
|
156
155
|
def self.calculate_sla_percent(start, sla_hours=0, offset=20)
|
157
156
|
sla_hours = sla_hours.to_f * 3600 # converts to seconds
|
158
157
|
percent = OpenStruct.new
|
159
|
-
total = Time.now.utc - start
|
158
|
+
total = Time.now.utc - start.utc
|
160
159
|
|
161
|
-
percent.green = sla_hours > 0 ? ((start + sla_hours) * (100 - offset) / 100) * 100 / total : 100
|
162
|
-
percent.yellow = sla_hours > 0 ? ((start + sla_hours) * 100 / total) - percent.green : 0
|
160
|
+
percent.green = sla_hours > 0 ? ((start.utc + sla_hours).to_f * (100 - offset) / 100) * 100 / total : 100
|
161
|
+
percent.yellow = sla_hours > 0 ? ((start.utc + sla_hours).to_f * 100 / total) - percent.green : 0
|
163
162
|
percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
|
164
163
|
|
165
164
|
return percent
|
data/lib/bpm_manager/version.rb
CHANGED