bpm_manager 0.9.10 → 0.9.12
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 +13 -3
- data/lib/bpm_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c7da5c736b1f636f350b7140e10af65bdf9b60f
|
4
|
+
data.tar.gz: 6ec59d7dad432a45a9f2133224f822afb49a6976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee7ade62ce2ed0377ad696564a8e8a13cd6d2e01e10206fec449af1166482f84137e639d1e3420aa9ef228d193957efd94964467d5c22e5e464b0a56f66e70fe
|
7
|
+
data.tar.gz: 631948cc229a6ebe8df077b8a19807bfa84470039b5c713d0bb6ef01653b4b9ead6336fc4c7ff403e6115a04e6be3a9fbdf0991975893e0f54e7fe88a500fd29
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -147,8 +147,18 @@ module BpmManager
|
|
147
147
|
|
148
148
|
# Private class methods
|
149
149
|
def self.calculate_sla(start, sla_hours = 0.0, offset = 20)
|
150
|
-
|
151
|
-
sla_hours
|
150
|
+
# Converts to seconds and calculates warning offset
|
151
|
+
sla_hours = sla_hours.to_f * 3600 * ((100 - offset) / 100)
|
152
|
+
|
153
|
+
if sla_hours > 0
|
154
|
+
if start.utc + sla_hours >= Time.now.utc
|
155
|
+
0
|
156
|
+
else
|
157
|
+
start.utc + sla_hours >= Time.now.utc ? 1 : 2
|
158
|
+
end
|
159
|
+
else
|
160
|
+
0
|
161
|
+
end
|
152
162
|
end
|
153
163
|
private_class_method :calculate_sla
|
154
164
|
|
@@ -157,7 +167,7 @@ module BpmManager
|
|
157
167
|
percent = OpenStruct.new
|
158
168
|
total = (Time.now.utc - start.utc).to_f
|
159
169
|
|
160
|
-
percent.green = sla_hours > 0 ? ((start.utc + sla_hours
|
170
|
+
percent.green = sla_hours > 0 ? ((start.utc + (sla_hours * (100 - offset) / 100)).to_f) * 100 / total : 100
|
161
171
|
percent.yellow = sla_hours > 0 ? ((start.utc + sla_hours).to_f * 100 / total) - percent.green : 0
|
162
172
|
percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
|
163
173
|
|
data/lib/bpm_manager/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bpm_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ariel Presa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|