bpm_manager 0.9.2 → 0.9.3
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 +22 -19
- 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: ca6203af6d88f9c3a5259a336d30eeff87365c0d
|
4
|
+
data.tar.gz: 7fa8319f2a329a531dbcee3efb425f765e2e3f3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdb4cae15cdd26269654fb54e61a76a77224c26cfd474c702a1ced7db66090b99ef8c5a6d48cf796d40efc5d55da447c02742996e912f13a2d02457731162dc9
|
7
|
+
data.tar.gz: 80c11efb85f5d6502a52655de09572fdcd44d006d0a97b3a6b22831c5eb50f1c232a40de971b99c527720fdd71073b778f758d744f0785252d3dc064101cbca1
|
data/lib/bpm_manager/red_hat.rb
CHANGED
@@ -145,6 +145,28 @@ module BpmManager
|
|
145
145
|
return sla
|
146
146
|
end
|
147
147
|
|
148
|
+
# Private class methods
|
149
|
+
def self.calculate_sla(start, sla_hours=0, offset=20)
|
150
|
+
unless sla_hours > 0
|
151
|
+
(start.to_f + ((sla_hours.to_f * 7*24*60*60))*((100-offset)/100)) <= Time.now.utc.to_f ? 0 : ((start.to_f + (sla_hours.to_f * 7*24*60*60) <= Time.now.utc.to_f) ? 1 : 2)
|
152
|
+
else
|
153
|
+
0
|
154
|
+
end
|
155
|
+
end
|
156
|
+
private_class_method :calculate_sla
|
157
|
+
|
158
|
+
def self.calculate_sla_percent(start, sla_hours=0, offset=20)
|
159
|
+
percent = OpenStruct.new
|
160
|
+
total = Time.now.utf.to_f - start.to_f
|
161
|
+
|
162
|
+
percent.green = sla_hours > 0 ? (start.to_f + ((sla_hours.to_f * 7*24*60*60)) * ((100-offset)/100)) / total * 100 : 100
|
163
|
+
percent.yellow = sla_hours > 0 ? (start.to_f + ((sla_hours.to_f * 7*24*60*60)) / total * 100) - green : 0
|
164
|
+
percent.red = sla_hours > 0 ? 100 - yellow - green : 0
|
165
|
+
|
166
|
+
return percent
|
167
|
+
end
|
168
|
+
private_class_method :calculate_sla_percent
|
169
|
+
|
148
170
|
private
|
149
171
|
def self.structure_task_data(input)
|
150
172
|
tasks = []
|
@@ -181,24 +203,5 @@ module BpmManager
|
|
181
203
|
|
182
204
|
return tasks
|
183
205
|
end
|
184
|
-
|
185
|
-
def calculate_sla(start, sla_hours=0, offset=20)
|
186
|
-
unless sla_hours > 0
|
187
|
-
(start.to_f + ((sla_hours.to_f * 7*24*60*60))*((100-offset)/100)) <= Time.now.utc.to_f ? 0 : ((start.to_f + (sla_hours.to_f * 7*24*60*60) <= Time.now.utc.to_f) ? 1 : 2)
|
188
|
-
else
|
189
|
-
0
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
def calculate_sla_percent(start, sla_hours=0, offset=20)
|
194
|
-
percent = OpenStruct.new
|
195
|
-
total = Time.now.utf.to_f - start.to_f
|
196
|
-
|
197
|
-
percent.green = sla_hours > 0 ? (start.to_f + ((sla_hours.to_f * 7*24*60*60)) * ((100-offset)/100)) / total * 100 : 100
|
198
|
-
percent.yellow = sla_hours > 0 ? (start.to_f + ((sla_hours.to_f * 7*24*60*60)) / total * 100) - green : 0
|
199
|
-
percent.red = sla_hours > 0 ? 100 - yellow - green : 0
|
200
|
-
|
201
|
-
return percent
|
202
|
-
end
|
203
206
|
end
|
204
207
|
end
|
data/lib/bpm_manager/version.rb
CHANGED