bpm_manager 0.9.6 → 0.9.7
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 +8 -9
- 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: 32df44da9683da124d48f2e91ddc01a29a063879
|
4
|
+
data.tar.gz: 0db0e19a356e36f03f1cc8a2ee43d600a32f6d18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5650cdb0ebf13ac4b5bfb05cf12ddf03f442561f7f9572bd51cc0b5786aaf4c95590772de799312226b49b721504de229b48e5bfe1f1fd875295e6be498cd6e9
|
7
|
+
data.tar.gz: e876beb1fcf85e101a119cb986ef5b1f4e9d6c6c7fa9081462f660ed0430333965f35f81142f130a20efd6ce35a74d92eaf8053b05e64baef5e847198fac6466
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -146,22 +146,21 @@ module BpmManager
|
|
146
146
|
end
|
147
147
|
|
148
148
|
# Private class methods
|
149
|
-
def self.calculate_sla(start, sla_hours=0, offset=20)
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
0
|
154
|
-
end
|
149
|
+
def self.calculate_sla(start, sla_hours = 0.0, offset = 20)
|
150
|
+
sla_hours = sla_hours.to_f * 3600 # converts to seconds
|
151
|
+
|
152
|
+
sla_hours > 0 ? (start.to_f + sla_hours) * ((100 - offset) / 100) <= Time.now.utc.to_f ? 0 : (start.to_f + sla_hours <= Time.now.utc.to_f ? 1 : 2) : 0
|
155
153
|
end
|
156
154
|
private_class_method :calculate_sla
|
157
155
|
|
158
156
|
def self.calculate_sla_percent(start, sla_hours=0, offset=20)
|
157
|
+
sla_hours = sla_hours.to_f * 3600 # converts to seconds
|
159
158
|
percent = OpenStruct.new
|
160
159
|
total = Time.now.utc.to_f - start.to_f
|
161
160
|
|
162
|
-
percent.green
|
163
|
-
percent.yellow = sla_hours > 0 ? (start.to_f +
|
164
|
-
percent.red
|
161
|
+
percent.green = sla_hours > 0 ? ((start.to_f + sla_hours) * (100 - offset) / 100) * 100 / total : 100
|
162
|
+
percent.yellow = sla_hours > 0 ? ((start.to_f + sla_hours) * 100 / total) - percent.green : 0
|
163
|
+
percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
|
165
164
|
|
166
165
|
return percent
|
167
166
|
end
|
data/lib/bpm_manager/version.rb
CHANGED