bpm_manager 0.9.7 → 0.9.8
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 -4
- 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: 622fff9c4c04954799ef7c8f3ddf1803d7a000e8
|
4
|
+
data.tar.gz: deec1eefb19be045200bfc3936b5bde59ef3cc44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2744792511bc0734d427abe0a235ce4836d6ab666b17de00e241cebcc65ad5d5f03df013e10d1345fa1e144e1e8b7567ebb272557d5183790a3b21821a7ba45a
|
7
|
+
data.tar.gz: 2b23b86efe59884ecf7e3a996003ba6fbe3a6258cae0007bbed0d525d1e389d602235b51bf6566a21a3e2c2564dfb1db1388d954a03dcc2eb0d6495e3eab5f9d
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -149,17 +149,17 @@ module BpmManager
|
|
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
151
|
|
152
|
-
sla_hours > 0 ? (start
|
152
|
+
sla_hours > 0 ? (start + sla_hours) * ((100 - offset) / 100) <= Time.now.utc ? 0 : (start + sla_hours <= Time.now.utc ? 1 : 2) : 0
|
153
153
|
end
|
154
154
|
private_class_method :calculate_sla
|
155
155
|
|
156
156
|
def self.calculate_sla_percent(start, sla_hours=0, offset=20)
|
157
157
|
sla_hours = sla_hours.to_f * 3600 # converts to seconds
|
158
158
|
percent = OpenStruct.new
|
159
|
-
total = Time.now.utc
|
159
|
+
total = Time.now.utc - start
|
160
160
|
|
161
|
-
percent.green = sla_hours > 0 ? ((start
|
162
|
-
percent.yellow = sla_hours > 0 ? ((start
|
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
|
163
163
|
percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
|
164
164
|
|
165
165
|
return percent
|
data/lib/bpm_manager/version.rb
CHANGED