Produced by Araxis Merge on 3/25/2019 8:58:09 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | C:\AraxisMergeCompare\Pri_un\IMAG_Source\VISA\Java\VixServerHealthWebApp\main\src\java\gov\va\med\imaging\vixserverhealth\web | VixServerHealthView.java | Mon Mar 18 20:39:08 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\VixServerHealthWebApp\main\src\java\gov\va\med\imaging\vixserverhealth\web | VixServerHealthView.java | Tue Mar 19 12:04:36 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 1826 |
Changed | 2 | 4 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /** | |
2 | * | |
3 | Package: MAG - Vis tA Imaging | |
4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
5 | Date Cre ated: Jan 15, 2010 | |
6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
7 | Developer: DNS werfej | |
8 | Descript ion: | |
9 | ||
10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
11 | ;; Property of the US Government . | |
12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
16 | ;; telephon e (301) 73 4-0100. | |
17 | ;; | |
18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
19 | ;; a Class I I medical device. A s such, it may not b e changed | |
20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
24 | ||
25 | */ | |
26 | package go v.va.med.i maging.vix serverheal th.web; | |
27 | ||
28 | import jav a.text.Dec imalFormat ; | |
29 | import jav a.text.Par seExceptio n; | |
30 | import jav a.text.Sim pleDateFor mat; | |
31 | import jav a.util.Arr ayList; | |
32 | import jav a.util.Cal endar; | |
33 | import jav a.util.Dat e; | |
34 | import jav a.util.Lis t; | |
35 | import jav a.util.Map ; | |
36 | ||
37 | import org .apache.lo gging.log4 j.LogManag er; | |
38 | import org .apache.lo gging.log4 j.Logger; | |
39 | ||
40 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
41 | import gov .va.med.im aging.heal th.VixServ erHealth; | |
42 | import gov .va.med.im aging.heal th.VixServ erHealthPr operties; | |
43 | import gov .va.med.im aging.heal th.VixSite ServerHeal th; | |
44 | import gov .va.med.im aging.vixs erverhealt h.configur ation.VixS erverHealt hWebAppCon figuration ; | |
45 | ||
46 | /** | |
47 | * @author DNS werfej | |
48 | * | |
49 | */ | |
50 | public cla ss VixServ erHealthVi ew | |
51 | implements Comparabl e<VixServe rHealthVie w> | |
52 | { | |
53 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(VixS erverHealt hView.clas s); | |
54 | ||
55 | pr ivate fina l Site sit e; | |
56 | pr ivate fina l VixServe rHealth vi xHealth; | |
57 | pr ivate fina l String s erverName; | |
58 | pr ivate fina l String j vmUptime; | |
59 | pr ivate fina l String j vmStartTim e; | |
60 | pr ivate fina l Calendar dateHealt hUpdated; | |
61 | pr ivate fina l String v ixVersion; | |
62 | pr ivate fina l String e rrorMessag e; | |
63 | pr ivate fina l boolean healthErro r; | |
64 | ||
65 | ||
66 | pr ivate fina l String v ixTomcatLo gsDir; | |
67 | pr ivate fina l String v ixTomcatLo gsDirSize; | |
68 | ||
69 | pr ivate fina l String v ixCacheDir ; | |
70 | pr ivate fina l String v ixCacheDir Size; | |
71 | pr ivate fina l String v ixCacheDir Capacity; | |
72 | pr ivate fina l String v ixCacheDir Available; | |
73 | pr ivate fina l String v ixCacheOpe rationsIni tiated; | |
74 | pr ivate fina l String v ixCacheOpe rationsSuc cessful; | |
75 | pr ivate fina l String v ixCacheOpe rationsErr or; | |
76 | pr ivate fina l String v ixCacheOpe rationsNot Found; | |
77 | ||
78 | pr ivate fina l String r ealmVistaS erver; | |
79 | pr ivate fina l String r ealmVistaP ort; | |
80 | ||
81 | pr ivate fina l String h ttp8080Thr eadPoolSiz e; | |
82 | pr ivate fina l String h ttp8080Thr eadsBusy; | |
83 | ||
84 | pr ivate fina l String h ttp8442Thr eadPoolSiz e; | |
85 | pr ivate fina l String h ttp8442Thr eadsBusy; | |
86 | ||
87 | pr ivate fina l String h ttp8443Thr eadPoolSiz e; | |
88 | pr ivate fina l String h ttp8443Thr eadsBusy; | |
89 | ||
90 | pr ivate fina l String t ransaction LogStatsTr ansactions Written; | |
91 | pr ivate fina l String t ransaction LogStatsTr ansactions Queried; | |
92 | pr ivate fina l String t ransaction LogStatsTr ansactions Purged; | |
93 | pr ivate fina l String t ransaction LogStatsTr ansactions PerMinute; | |
94 | pr ivate fina l String t ransaction LogStatsTr ansactionW riteErrors ; | |
95 | pr ivate fina l String t ransaction LogStatsTr ansactionR eadErrors; | |
96 | ||
97 | pr ivate fina l String t ransaction LogDirecto ry; | |
98 | pr ivate fina l String t ransaction LogDirecto rySize; | |
99 | ||
100 | pr ivate fina l String s iteService Url; | |
101 | pr ivate fina l String s iteService UpdatedDat e; | |
102 | ||
103 | pr ivate fina l boolean roiPeriodi cProcessin gEnabled; | |
104 | pr ivate fina l boolean roiImmedia teProcessi ngEnabled; | |
105 | ||
106 | pr ivate fina l List<Vix DicomSendF ailures> d icomServic eStats; | |
107 | pr ivate fina l static S tring Dico mServicesS tats = "_V ixDicomSer vicesActiv ity_VixDic omServices Stats"; | |
108 | pr ivate fina l static S tring Send Failures_D icomServic eStats = " _VixSendTo AEFailures _VixDicomS ervicesSta ts_"; | |
109 | ||
110 | ||
111 | ||
112 | pu blic VixSe rverHealth View(VixSi teServerHe alth vixHe alth) | |
113 | { | |
114 | supe r(); | |
115 | this .vixHealth = vixHeal th.getVixS erverHealt h(); | |
116 | this .errorMess age = vixH ealth.getE rrorMessag e(); | |
117 | this .dateHealt hUpdated = vixHealth .getLastRe freshed(); | |
118 | this .site = vi xHealth.ge tSite(); | |
119 | this .healthErr or = vixHe alth.isErr or(); | |
120 | ||
121 | Map< String, St ring> prop erties = t his.health Error ? nu ll : vixHe alth.getVi xServerHea lth().getV ixServerHe althProper ties(); | |
122 | ||
123 | this .serverNam e = (prope rties == n ull ? null : propert ies.get(Vi xServerHea lthPropert ies.VIX_SE RVER_HEALT H_VIX_HOST NAME)); | |
124 | Stri ng jvmStar tTimeRaw = (properti es == null ? null : properties .get(VixSe rverHealth Properties .VIX_SERVE R_HEALTH_V IX_JVM_STA RTTIME)); | |
125 | Stri ng jvmUpti meRaw = (p roperties == null ? null : pro perties.ge t(VixServe rHealthPro perties.VI X_SERVER_H EALTH_VIX_ JVM_UPTIME )); | |
126 | ||
127 | jvmS tartTime = convertMS ToTimeStri ng(jvmStar tTimeRaw); | |
128 | jvmU ptime = co nvertRawUp timeToTime String(jvm UptimeRaw) ; | |
129 | ||
130 | vixV ersion = ( properties == null ? null : pr operties.g et(VixServ erHealthPr operties.V IX_SERVER_ HEALTH_VIX _VERSION)) ; | |
131 | vixT omcatLogsD ir = (prop erties == null ? nul l : proper ties.get(V ixServerHe althProper ties.VIX_S ERVER_HEAL TH_VIX_TOM CAT_LOGS_D IR)); | |
132 | ||
133 | vixT omcatLogsD irSize = ( properties == null ? null : pr operties.g et(VixServ erHealthPr operties.V IX_SERVER_ HEALTH_VIX _TOMCAT_LO GS_DIR_SIZ E)); | |
134 | ||
135 | vixC acheDir = (propertie s == null ? null : p roperties. get(VixSer verHealthP roperties. VIX_SERVER _HEALTH_VI X_CACHE_DI R_KEY)); | |
136 | vixC acheDirSiz e = (prope rties == n ull ? null : propert ies.get(Vi xServerHea lthPropert ies.VIX_SE RVER_HEALT H_VIX_CACH E_DIR_SIZE )); | |
137 | vixC acheDirCap acity = (p roperties == null ? null : pro perties.ge t(VixServe rHealthPro perties.VI X_SERVER_H EALTH_VIX_ CACHE_DIR_ ROOT_DRIVE _TOTAL)); | |
138 | vixC acheDirAva ilable = ( properties == null ? null : pr operties.g et(VixServ erHealthPr operties.V IX_SERVER_ HEALTH_VIX _CACHE_DIR _ROOT_DRIV E_AVAILABL E)); | |
139 | ||
140 | vixC acheOperat ionsInitia ted = (pro perties == null ? nu ll : prope rties.get( VixServerH ealthPrope rties.VIX_ SERVER_HEA LTH_VIX_JM X_CACHE_OP ERATIONS_I NITIATED)) ; | |
141 | vixC acheOperat ionsSucces sful = (pr operties = = null ? n ull : prop erties.get (VixServer HealthProp erties.VIX _SERVER_HE ALTH_VIX_J MX_CACHE_O PERATIONS_ SUCCESSFUL )); | |
142 | vixC acheOperat ionsError = (propert ies == nul l ? null : propertie s.get(VixS erverHealt hPropertie s.VIX_SERV ER_HEALTH_ VIX_JMX_CA CHE_OPERAT IONS_ERROR )); | |
143 | vixC acheOperat ionsNotFou nd = (prop erties == null ? nul l : proper ties.get(V ixServerHe althProper ties.VIX_S ERVER_HEAL TH_VIX_JMX _CACHE_OPE RATIONS_IN STANCE_NOT _FOUND)); | |
144 | ||
145 | real mVistaServ er = (prop erties == null ? nul l : proper ties.get(V ixServerHe althProper ties.VIX_S ERVER_HEAL TH_REALM_J MX_VISTA_S ERVER)); | |
146 | real mVistaPort = (proper ties == nu ll ? null : properti es.get(Vix ServerHeal thProperti es.VIX_SER VER_HEALTH _REALM_JMX _VISTA_POR T)); | |
147 | ||
148 | http 8080Thread PoolSize = (properti es == null ? null : properties .get("Cata linaThread PoolThread Count_\"ht tp-nio-808 0\"_Thread Pool")); | |
149 | http 8080Thread sBusy = (p roperties == null ? null : pro perties.ge t("Catalin aThreadPoo lThreadsBu sy_\"http- nio-8080\" _ThreadPoo l")); | |
150 | http 8442Thread PoolSize = (properti es == null ? null : properties .get("Cata linaThread PoolThread Count_\"ht tp-nio-844 2\"_Thread Pool")); | |
151 | http 8442Thread sBusy = (p roperties == null ? null : pro perties.ge t("Catalin aThreadPoo lThreadsBu sy_\"http- nio-8442\" _ThreadPoo l")); | |
152 | http 8443Thread PoolSize = (properti es == null ? null : properties .get("Cata linaThread PoolThread Count_\"ht tp-bio-844 3\"_Thread Pool")); | |
153 | http 8443Thread sBusy = (p roperties == null ? null : pro perties.ge t("Catalin aThreadPoo lThreadsBu sy_\"http- bio-8443\" _ThreadPoo l")); | |
154 | ||
155 | tran sactionLog StatsTrans actionsWri tten = (pr operties = = null ? n ull : prop erties.get (VixServer HealthProp erties.VIX _SERVER_HE ALTH_TRANS ACTION_LOG _STATISTIC S_TRANSACT IONS_WRITT EN)); | |
156 | tran sactionLog StatsTrans actionsPur ged = (pro perties == null ? nu ll : prope rties.get( VixServerH ealthPrope rties.VIX_ SERVER_HEA LTH_TRANSA CTION_LOG_ STATISTICS _TRANSACTI ONS_PURGED )); | |
157 | tran sactionLog StatsTrans actionsQue ried = (pr operties = = null ? n ull : prop erties.get (VixServer HealthProp erties.VIX _SERVER_HE ALTH_TRANS ACTION_LOG _STATISTIC S_TRANSACT IONS_QUERI ED)); | |
158 | tran sactionLog StatsTrans actionRead Errors = (propertie s == null ? null : p roperties. get(VixSer verHealthP roperties. VIX_SERVER _HEALTH_TR ANSACTION_ LOG_STATIS TICS_TRANS ACTION_REA D_ERRORS)) ; | |
159 | tran sactionLog StatsTrans actionWrit eErrors = (properti es == null ? null : properties .get(VixSe rverHealth Properties .VIX_SERVE R_HEALTH_T RANSACTION _LOG_STATI STICS_TRAN SACTION_WR ITE_ERRORS )); | |
160 | ||
161 | tran sactionLog StatsTrans actionsPer Minute = c alculateTr ansactions PerMinute( jvmUptimeR aw, | |
162 | transact ionLogStat sTransacti onsWritten ); | |
163 | ||
164 | ||
165 | tran sactionLog Directory = (propert ies == nul l ? null : propertie s.get(VixS erverHealt hPropertie s.VIX_SERV ER_HEALTH_ VIX_TRANSA CTIONLOGS_ DIR)); | |
166 | tran sactionLog DirectoryS ize = (pro perties == null ? nu ll : prope rties.get( VixServerH ealthPrope rties.VIX_ SERVER_HEA LTH_VIX_TR ANSACTIONL OGS_DIR_SI ZE)); | |
167 | ||
168 | site ServiceUrl = (proper ties == nu ll ? null : properti es.get(Vix ServerHeal thProperti es.VIX_SIT E_SERVICE_ URL)); | |
169 | site ServiceUpd atedDate = (properti es == null ? null : properties .get(VixSe rverHealth Properties .VIX_SITE_ SERVICE_LA ST_UPDATED )); | |
170 | ||
171 | Stri ng roiProc essWorkIte msImmediat ely = (pro perties == null ? nu ll : prope rties.get( VixServerH ealthPrope rties.VIX_ SERVER_HEA LTH_ROI_PR OCESS_WORK _ITEMS_IMM EDIATELY)) ; | |
172 | if(r oiProcessW orkItemsIm mediately == null || roiProces sWorkItems Immediatel y.length() <= 0) | |
173 | roiImm ediateProc essingEnab led = fals e; | |
174 | else | |
175 | roiImm ediateProc essingEnab led = Bool ean.parseB oolean(roi ProcessWor kItemsImme diately); | |
176 | ||
177 | Stri ng ROIPeri odicProces singEnable d = (prope rties == n ull ? null : propert ies.get(Vi xServerHea lthPropert ies.VIX_SE RVER_HEALT H_ROI_PERI ODIC_PROCE SSING_ENAB LED)); | |
178 | if(R OIPeriodic Processing Enabled == null || R OIPeriodic Processing Enabled.le ngth() <= 0) | |
179 | roiPer iodicProce ssingEnabl ed = false ; | |
180 | else | |
181 | roiPer iodicProce ssingEnabl ed = Boole an.parseBo olean(ROIP eriodicPro cessingEna bled); | |
182 | ||
183 | dico mServiceSt ats = new ArrayList< VixDicomSe ndFailures >(); | |
184 | fill DicomSendF ailures(pr operties); | |
185 | ||
186 | ||
187 | } | |
188 | ||
189 | pr otected fi nal static String pa ssedImage = "../imag es/passed. gif"; | |
190 | pr otected fi nal static String fa iledImage = "../imag es/failed. gif"; | |
191 | ||
192 | pu blic Strin g getVIXSt atusIcon() | |
193 | { | |
194 | if(t his.isHeal thError()) | |
195 | { | |
196 | return "<img src =\"" + pas sedImage + "\" alt=\ "Passed\" title=\"Pa ssed\" />" ; | |
197 | } | |
198 | else | |
199 | { | |
200 | return "<img src =\"" + fai ledImage + "\" alt=\ "Failed\" title=\"Fa iled\" />" + getErro rMessage() ; | |
201 | } | |
202 | } | |
203 | ||
204 | pr ivate Stri ng calcula teTransact ionsPerMin ute(String uptimeStr ing, | |
205 | String transacti onsWritten ) | |
206 | { | |
207 | if(u ptimeStrin g == null) | |
208 | return null; | |
209 | long ms = Long .parseLong (uptimeStr ing); | |
210 | if(m s < 1000) | |
211 | return null; | |
212 | ||
213 | long sec = (lo ng)(ms / 1 000); | |
214 | if(s ec < 60) | |
215 | return null; | |
216 | long minutes = (long)(se c / 60); | |
217 | ||
218 | if(t ransaction sWritten = = null || transactio nsWritten. length() < = 0) | |
219 | return null; | |
220 | long transacti ons = Long .parseLong (transacti onsWritten ); | |
221 | ||
222 | doub le transPe rMinute = ((double)t ransaction s)/((doubl e)minutes) ; | |
223 | Deci malFormat df = new D ecimalForm at("###,## #.##"); | |
224 | retu rn df.form at(transPe rMinute); | |
225 | } | |
226 | ||
227 | pu blic Map<S tring, Str ing> getRa wHealthAtt ributes() | |
228 | { | |
229 | if(t his.vixHea lth != nul l) | |
230 | return this.vixH ealth.getV ixServerHe althProper ties(); | |
231 | retu rn null; | |
232 | } | |
233 | ||
234 | pr ivate VixS erverHealt hWebAppCon figuration getConfig uration() | |
235 | { | |
236 | retu rn VixServ erHealthWe bAppConfig uration.ge tVixServer HealthWebA ppConfigur ation(); | |
237 | } | |
238 | ||
239 | pu blic boole an isHealt hy() | |
240 | { | |
241 | if(i sHealthErr or()) | |
242 | return false; | |
243 | //if (!isHttp80 80ThreadPo olBelowThr eshold()) | |
244 | // return false; | |
245 | //if (!isHttp84 43ThreadPo olBelowThr eshold()) | |
246 | // return false; | |
247 | //if (!isVixCac heBelowCri ticalLimit ()) | |
248 | // return false; | |
249 | //if (!isNoVixC acheErrors ()) | |
250 | // return false; | |
251 | if(g etThreadsP rocessingA boveCritic alLimit() > 0) | |
252 | return false; | |
253 | if(! isVixRealm VistaServe rConfigure dProperly( )) | |
254 | return false; | |
255 | if(! isVixRealm VistaPortC onfiguredP roperly()) | |
256 | return false; | |
257 | if(! isSiteServ iceDateUpd atedOk()) | |
258 | return false; | |
259 | if(! isSiteServ iceUrlConf iguredProp erly()) | |
260 | return false; | |
261 | if(! is8442Requ estsOk()) | |
262 | return false; | |
263 | if(! is8443Requ estsOk()) | |
264 | return false; | |
265 | if(! is8080Requ estsOk()) | |
266 | return false; | |
267 | if(! isROIProce ssingEnabl ed()) | |
268 | return false; | |
269 | retu rn true; | |
270 | } | |
271 | ||
272 | pu blic boole an isVixRe almVistaSe rverConfig uredProper ly() | |
273 | { | |
274 | if(( realmVista Server != null) && ( realmVista Server.len gth() > 0) ) | |
275 | { | |
276 | String server = realmVista Server; | |
277 | return server.eq ualsIgnore Case(site. getVistaSe rver()); | |
278 | } | |
279 | retu rn true; | |
280 | } | |
281 | ||
282 | pu blic boole an isVixRe almVistaPo rtConfigur edProperly () | |
283 | { | |
284 | if(( realmVista Port != nu ll) && (re almVistaPo rt.length( ) > 0)) | |
285 | { | |
286 | int po rt = Integ er.parseIn t(realmVis taPort); | |
287 | return (port == site.getVi staPort()) ; | |
288 | } | |
289 | retu rn true; | |
290 | } | |
291 | ||
292 | pu blic int g etThreadsP rocessingA boveCritic alLimit() | |
293 | { | |
294 | if(g etConfigur ation().ge tThreadPro cessingTim eCriticalL imit() == null) | |
295 | return 0; | |
296 | if(v ixHealth = = null) | |
297 | return -1; | |
298 | Map< String, St ring> prop erties = v ixHealth.g etVixServe rHealthPro perties(); | |
299 | int count = 0; | |
300 | for( String key : propert ies.keySet ()) | |
301 | { | |
302 | if(key .startsWit h("Catalin aRequestPr ocessingTi me")) | |
303 | { | |
304 | long timeRunni ng = Long. parseLong( properties .get(key)) ; | |
305 | if ( timeRunnin g > getThr eadProcess ingTimeCri ticalLimit ()) | |
306 | { | |
307 | count++; | |
308 | } | |
309 | } | |
310 | } | |
311 | retu rn count; | |
312 | } | |
313 | ||
314 | pu blic int g etThreadPr ocessingTi meCritical Limit() | |
315 | { | |
316 | retu rn getConf iguration( ).getThrea dProcessin gTimeCriti calLimit() ; | |
317 | } | |
318 | ||
319 | pu blic boole an isNoVix CacheError s() | |
320 | { | |
321 | if(( vixCacheOp erationsEr ror != nul l) && (vix CacheOpera tionsError .length() > 0)) | |
322 | { | |
323 | int vi xCacheErro rs = Integ er.parseIn t(vixCache Operations Error); | |
324 | if(vix CacheError s > 0) | |
325 | return f alse; | |
326 | } | |
327 | retu rn true; | |
328 | } | |
329 | ||
330 | pu blic Strin g getVixCa cheDirPerc entUsedStr ing() | |
331 | { | |
332 | doub le percent Used = get VixCacheDi rPercentUs ed(); | |
333 | if(p ercentUsed >= 0) | |
334 | { | |
335 | percen tUsed *= 1 00; | |
336 | Decima lFormat df = new Dec imalFormat ("##0.00") ; | |
337 | return df.format (percentUs ed); | |
338 | } | |
339 | retu rn ""; | |
340 | } | |
341 | ||
342 | pu blic doubl e getVixCa cheDirPerc entUsed() | |
343 | { | |
344 | if(( vixCacheDi rCapacity != null) & & (vixCach eDirCapaci ty.length( ) > 0) | |
345 | && (vixC acheDirAva ilable != null) && ( vixCacheDi rAvailable .length() > 0)) | |
346 | { | |
347 | if(getCo nfiguratio n().getDri veCapacity CriticalLi mit() != n ull) | |
348 | { | |
349 | long capac ity = Long .parseLong (vixCacheD irCapacity ); | |
350 | long avail able = Lon g.parseLon g(vixCache DirAvailab le); | |
351 | long used = capacity - availab le; | |
352 | double per centUsed = (double)u sed/capaci ty; | |
353 | return per centUsed; | |
354 | } | |
355 | } | |
356 | return -1d; | |
357 | } | |
358 | ||
359 | pr ivate long getCacheD riveAvaila ble() | |
360 | { | |
361 | if(( vixCacheDi rAvailable != null) && (vixCac heDirAvail able.lengt h() > 0)) | |
362 | { | |
363 | long a vailable = Long.pars eLong(vixC acheDirAva ilable); | |
364 | return available ; | |
365 | } | |
366 | retu rn -1l; | |
367 | } | |
368 | ||
369 | pu blic boole an isVixCa cheBelowCr iticalLimi t() | |
370 | { | |
371 | ||
372 | doub le percent Used = get VixCacheDi rPercentUs ed(); | |
373 | if(p ercentUsed >= 0) | |
374 | { | |
375 | if(per centUsed > getConfig uration(). getDriveCa pacityCrit icalLimit( )) | |
376 | { | |
377 | long cac heDriveAva ilable = g etCacheDri veAvailabl e(); | |
378 | if(cache DriveAvail able > 0) | |
379 | { | |
380 | double gbA vailable = convertBy tesToGB(ca cheDriveAv ailable); | |
381 | if(gbAvail able < get Configurat ion().getD riveFreeSp aceCritica lLimit()) | |
382 | re turn false ; | |
383 | } | |
384 | } | |
385 | } | |
386 | retu rn true; | |
387 | } | |
388 | ||
389 | pu blic boole an isHttp8 080ThreadP oolBelowTh reshold() | |
390 | { | |
391 | if(( http8080Th readPoolSi ze != null ) && (http 8080Thread PoolSize.l ength() > 0)) | |
392 | { | |
393 | int th readPoolSi ze = Integ er.parseIn t(http8080 ThreadPool Size); | |
394 | if(get Configurat ion().getT hreadPoolT hreshold() != null) | |
395 | { | |
396 | if(threa dPoolSize > getConfi guration() .getThread PoolThresh old()) | |
397 | return fal se; | |
398 | } | |
399 | } | |
400 | retu rn true; | |
401 | } | |
402 | ||
403 | pu blic boole an isHttp8 443ThreadP oolBelowTh reshold() | |
404 | { | |
405 | if(( http8443Th readPoolSi ze != null ) && (http 8443Thread PoolSize.l ength() > 0)) | |
406 | { | |
407 | int th readPoolSi ze = Integ er.parseIn t(http8443 ThreadPool Size); | |
408 | if(get Configurat ion().getT hreadPoolT hreshold() != null) | |
409 | { | |
410 | if(threa dPoolSize > getConfi guration() .getThread PoolThresh old()) | |
411 | return fal se; | |
412 | } | |
413 | } | |
414 | retu rn true; | |
415 | } | |
416 | ||
417 | pu blic boole an isHttp8 442ThreadP oolBelowTh reshold() | |
418 | { | |
419 | if(( http8442Th readPoolSi ze != null ) && (http 8442Thread PoolSize.l ength() > 0)) | |
420 | { | |
421 | int th readPoolSi ze = Integ er.parseIn t(http8442 ThreadPool Size); | |
422 | if(get Configurat ion().getT hreadPoolT hreshold() != null) | |
423 | { | |
424 | if(threa dPoolSize > getConfi guration() .getThread PoolThresh old()) | |
425 | return fal se; | |
426 | } | |
427 | } | |
428 | retu rn true; | |
429 | } | |
430 | ||
431 | pr ivate doub le convert BytesToGB( long bytes ) | |
432 | { | |
433 | doub le kb = (d ouble)byte s / 1024.0 f; | |
434 | do uble mb = kb / 1024. 0f; | |
435 | do uble gb = mb / 1024. 0f; | |
436 | re turn gb; | |
437 | } | |
438 | ||
439 | pr ivate Stri ng convert RawBytesTo String(Str ing rawByt es) | |
440 | { | |
441 | if(( rawBytes = = null) || (rawBytes .length() <= 0)) | |
442 | return ""; | |
443 | long bytes = L ong.parseL ong(rawByt es); | |
444 | if ( bytes < 10 24) | |
445 | { | |
446 | return b ytes + " b ytes"; | |
447 | } | |
448 | do uble kb = (double)by tes / 1024 .0f; | |
449 | do uble mb = kb / 1024. 0f; | |
450 | do uble gb = mb / 1024. 0f; | |
451 | do uble tb = gb / 1024. 0f; | |
452 | De cimalForma t df = new DecimalFo rmat("#,## #.00"); | |
453 | if (tb > 1.0 ) | |
454 | { | |
455 | return d f.format(t b) + " TB" ; | |
456 | } | |
457 | el se if (gb > 1.0) | |
458 | { | |
459 | return d f.format(g b) + " GB" ; | |
460 | } | |
461 | el se if (mb > 1.0) | |
462 | { | |
463 | return d f.format(m b) + " MB" ; | |
464 | } | |
465 | el se | |
466 | { | |
467 | return d f.format(k b) + " KB" ; | |
468 | } | |
469 | } | |
470 | ||
471 | pr ivate Stri ng convert RawUptimeT oTimeStrin g(String u ptimeStrin g) | |
472 | { | |
473 | if(u ptimeStrin g == null) | |
474 | return null; | |
475 | long ms = Long .parseLong (uptimeStr ing); | |
476 | ||
477 | Stri ngBuilder sb = new S tringBuild er(); | |
478 | Stri ng prefix = ""; | |
479 | int sec = 1000 ; | |
480 | int min = sec * 60; | |
481 | int hour = min * 60; | |
482 | int days = hou r * 24; | |
483 | ||
484 | if(m s > days) | |
485 | { | |
486 | long d = (long)( ms / days) ; | |
487 | ms -= d * days; | |
488 | sb.app end(prefix ); | |
489 | sb.app end(d + " days"); | |
490 | prefix = ", "; | |
491 | } | |
492 | if(m s > hour) | |
493 | { | |
494 | long d = (long)( ms / hour) ; | |
495 | ms -= d * hour; | |
496 | sb.app end(prefix ); | |
497 | sb.app end(d + " hours"); | |
498 | prefix = ", "; | |
499 | } | |
500 | if(m s > min) | |
501 | { | |
502 | long d = (long)( ms / min); | |
503 | ms -= d * min; | |
504 | sb.app end(prefix ); | |
505 | sb.app end(d + " minutes"); | |
506 | prefix = ", "; | |
507 | } | |
508 | if(m s > sec) | |
509 | { | |
510 | long d = (long)( ms / sec); | |
511 | ms -= d * sec; | |
512 | sb.app end(prefix ); | |
513 | sb.app end(d + " seconds"); | |
514 | prefix = ", "; | |
515 | } | |
516 | if(m s > 0) | |
517 | { | |
518 | sb.app end(prefix ); | |
519 | sb.app end(ms + " ms"); | |
520 | prefix = ", "; | |
521 | } | |
522 | retu rn sb.toSt ring(); | |
523 | } | |
524 | ||
525 | pr ivate Stri ng convert MSToTimeSt ring(Strin g time) | |
526 | { | |
527 | if(t ime == nul l) | |
528 | return null; | |
529 | Cale ndar c = C alendar.ge tInstance( ); | |
530 | c.se tTimeInMil lis(Long.p arseLong(t ime)); | |
531 | ||
532 | Simp leDateForm at formatt er = getDa teFormat() ; | |
533 | retu rn formatt er.format( c.getTime( )); | |
534 | } | |
535 | ||
536 | pr ivate Simp leDateForm at getDate Format() | |
537 | { | |
538 | retu rn new Sim pleDateFor mat("MMM d , yyyy h:m m:ss aa"); | |
539 | } | |
540 | ||
541 | /* * | |
542 | * @return t he site | |
543 | * / | |
544 | pu blic Site getSite() { | |
545 | retu rn site; | |
546 | } | |
547 | ||
548 | /* * | |
549 | * @return t he serverN ame | |
550 | * / | |
551 | pu blic Strin g getServe rName() { | |
552 | retu rn serverN ame; | |
553 | } | |
554 | ||
555 | /* * | |
556 | * @return t he jvmUpti me | |
557 | * / | |
558 | pu blic Strin g getJvmUp time() { | |
559 | retu rn jvmUpti me; | |
560 | } | |
561 | ||
562 | /* * | |
563 | * @return t he jvmStar tTime | |
564 | * / | |
565 | pu blic Strin g getJvmSt artTime() { | |
566 | retu rn jvmStar tTime; | |
567 | } | |
568 | ||
569 | /* * | |
570 | * @return t he dateHea lthUpdated | |
571 | * / | |
572 | pu blic Strin g getDateH ealthUpdat ed() | |
573 | { | |
574 | retu rn getDate Format().f ormat(date HealthUpda ted.getTim e()); | |
575 | } | |
576 | ||
577 | /* * | |
578 | * @return t he vixVers ion | |
579 | * / | |
580 | pu blic Strin g getVixVe rsion() { | |
581 | retu rn vixVers ion; | |
582 | } | |
583 | ||
584 | /* * | |
585 | * @return t he vixTomc atLogsDir | |
586 | * / | |
587 | pu blic Strin g getVixTo mcatLogsDi r() { | |
588 | retu rn vixTomc atLogsDir; | |
589 | } | |
590 | ||
591 | /* * | |
592 | * @return t he vixTomc atLogsDirS ize | |
593 | * / | |
594 | pu blic Strin g getVixTo mcatLogsDi rSize() { | |
595 | retu rn convert RawBytesTo String(vix TomcatLogs DirSize); | |
596 | } | |
597 | ||
598 | /* * | |
599 | * @return t he vixCach eDir | |
600 | * / | |
601 | pu blic Strin g getVixCa cheDir() { | |
602 | retu rn vixCach eDir; | |
603 | } | |
604 | ||
605 | /* * | |
606 | * @return t he vixCach eDirSize | |
607 | * / | |
608 | pu blic Strin g getVixCa cheDirSize () { | |
609 | retu rn convert RawBytesTo String(vix CacheDirSi ze); | |
610 | } | |
611 | ||
612 | /* * | |
613 | * @return t he vixCach eDirCapaci ty | |
614 | * / | |
615 | pu blic Strin g getVixCa cheDirCapa city() { | |
616 | retu rn convert RawBytesTo String(vix CacheDirCa pacity); | |
617 | } | |
618 | ||
619 | /* * | |
620 | * @return t he vixCach eDirAvaila ble | |
621 | * / | |
622 | pu blic Strin g getVixCa cheDirAvai lable() { | |
623 | retu rn convert RawBytesTo String(vix CacheDirAv ailable); | |
624 | } | |
625 | ||
626 | /* * | |
627 | * @return t he vixCach eOperation sInitiated | |
628 | * / | |
629 | pu blic Strin g getVixCa cheOperati onsInitiat ed() { | |
630 | retu rn vixCach eOperation sInitiated ; | |
631 | } | |
632 | ||
633 | /* * | |
634 | * @return t he vixCach eOperation sSuccessfu l | |
635 | * / | |
636 | pu blic Strin g getVixCa cheOperati onsSuccess ful() { | |
637 | retu rn vixCach eOperation sSuccessfu l; | |
638 | } | |
639 | ||
640 | /* * | |
641 | * @return t he vixCach eOperation sError | |
642 | * / | |
643 | pu blic Strin g getVixCa cheOperati onsError() { | |
644 | retu rn vixCach eOperation sError; | |
645 | } | |
646 | ||
647 | /* * | |
648 | * @return t he vixCach eOperation sNotFound | |
649 | * / | |
650 | pu blic Strin g getVixCa cheOperati onsNotFoun d() { | |
651 | retu rn vixCach eOperation sNotFound; | |
652 | } | |
653 | ||
654 | /* * | |
655 | * @return t he realmVi staServer | |
656 | * / | |
657 | pu blic Strin g getRealm VistaServe r() { | |
658 | retu rn realmVi staServer; | |
659 | } | |
660 | ||
661 | /* * | |
662 | * @return t he realmVi staPort | |
663 | * / | |
664 | pu blic Strin g getRealm VistaPort( ) { | |
665 | retu rn realmVi staPort; | |
666 | } | |
667 | ||
668 | /* * | |
669 | * @return t he http808 0ThreadPoo lSize | |
670 | * / | |
671 | pu blic Strin g getHttp8 080ThreadP oolSize() { | |
672 | retu rn http808 0ThreadPoo lSize; | |
673 | } | |
674 | ||
675 | /* * | |
676 | * @return t he http808 0ThreadsBu sy | |
677 | * / | |
678 | pu blic Strin g getHttp8 080Threads Busy() { | |
679 | retu rn http808 0ThreadsBu sy; | |
680 | } | |
681 | ||
682 | /* * | |
683 | * @return t he http844 2ThreadPoo lSize | |
684 | * / | |
685 | pu blic Strin g getHttp8 442ThreadP oolSize() { | |
686 | retu rn http844 2ThreadPoo lSize; | |
687 | } | |
688 | ||
689 | /* * | |
690 | * @return t he http844 2ThreadsBu sy | |
691 | * / | |
692 | pu blic Strin g getHttp8 442Threads Busy() { | |
693 | retu rn http844 2ThreadsBu sy; | |
694 | } | |
695 | ||
696 | /* * | |
697 | * @return t he http844 3ThreadPoo lSize | |
698 | * / | |
699 | pu blic Strin g getHttp8 443ThreadP oolSize() { | |
700 | retu rn http844 3ThreadPoo lSize; | |
701 | } | |
702 | ||
703 | /* * | |
704 | * @return t he http844 3ThreadsBu sy | |
705 | * / | |
706 | pu blic Strin g getHttp8 443Threads Busy() { | |
707 | retu rn http844 3ThreadsBu sy; | |
708 | } | |
709 | ||
710 | pu blic Strin g getTrans actionLogS tatisticsT ransaction sWritten() | |
711 | { | |
712 | if(t ransaction LogStatsTr ansactions Written != null) | |
713 | return transacti onLogStats Transactio nsWritten; | |
714 | retu rn "?"; | |
715 | } | |
716 | ||
717 | pu blic Strin g getTrans actionLogS tatisticsT ransaction sQueried() | |
718 | { | |
719 | if(t ransaction LogStatsTr ansactions Queried != null) | |
720 | return transacti onLogStats Transactio nsQueried; | |
721 | retu rn "?"; | |
722 | } | |
723 | ||
724 | pu blic Strin g getTrans actionLogS tatsTransa ctionsPerM inute() | |
725 | { | |
726 | if(t ransaction LogStatsTr ansactions PerMinute != null) | |
727 | return transacti onLogStats Transactio nsPerMinut e; | |
728 | retu rn "?"; | |
729 | } | |
730 | ||
731 | pu blic Strin g getTrans actionLogS tatsTransa ctionWrite Errors() | |
732 | { | |
733 | if(t ransaction LogStatsTr ansactionW riteErrors != null) | |
734 | return transacti onLogStats Transactio nWriteErro rs; | |
735 | retu rn "?"; | |
736 | } | |
737 | ||
738 | pu blic Strin g getTrans actionLogS tatsTransa ctionReadE rrors() | |
739 | { | |
740 | if(t ransaction LogStatsTr ansactionR eadErrors != null) | |
741 | return transacti onLogStats Transactio nReadError s; | |
742 | retu rn "?"; | |
743 | } | |
744 | ||
745 | pu blic Strin g getTrans actionLogS tatisticsT ransaction sPurged() | |
746 | { | |
747 | if(t ransaction LogStatsTr ansactions Purged != null) | |
748 | return transacti onLogStats Transactio nsPurged; | |
749 | retu rn "?"; | |
750 | } | |
751 | ||
752 | pu blic Strin g getTrans actionLogD irectory() | |
753 | { | |
754 | retu rn transac tionLogDir ectory; | |
755 | } | |
756 | ||
757 | pu blic Strin g getTrans actionLogD irectorySi ze() { | |
758 | retu rn convert RawBytesTo String(tra nsactionLo gDirectory Size); | |
759 | } | |
760 | ||
761 | pu blic Strin g getError Message() | |
762 | { | |
763 | retu rn errorMe ssage; | |
764 | } | |
765 | ||
766 | pu blic boole an isHealt hError() | |
767 | { | |
768 | retu rn healthE rror; | |
769 | } | |
770 | ||
771 | pu blic Strin g getSiteS erviceUrl( ) | |
772 | { | |
773 | retu rn siteSer viceUrl; | |
774 | } | |
775 | ||
776 | pu blic Strin g getSiteS erviceUpda tedDate() | |
777 | { | |
778 | retu rn siteSer viceUpdate dDate; | |
779 | } | |
780 | ||
781 | pu blic boole an isSiteS erviceUrlC onfiguredP roperly() | |
782 | { | |
783 | retu rn (siteSe rviceUrl ! = null) && (siteServ iceUrl.len gth() > 0) ; | |
784 | } | |
785 | ||
786 | pu blic boole an isSiteS erviceDate UpdatedOk( ) | |
787 | { | |
788 | if(s iteService UpdatedDat e == null || siteSer viceUpdate dDate.leng th() <= 0) | |
789 | return false; | |
790 | ||
791 | Stri ng format = "MM/dd/y yyy HH:mm: ss.SSS"; | |
792 | Simp leDateForm at dateFor mat = new SimpleDate Format(for mat); | |
793 | try | |
794 | { | |
795 | Date d ate = date Format.par se(siteSer viceUpdate dDate); | |
796 | Calend ar now = C alendar.ge tInstance( ); | |
797 | now.ad d(Calendar .DAY_OF_YE AR, -2); | |
798 | ||
799 | Date t woDaysAgo = now.getT ime(); | |
800 | if(dat e.before(t woDaysAgo) ) | |
801 | return f alse; | |
802 | return true; | |
803 | ||
804 | } | |
805 | catc h (ParseEx ception e) | |
806 | { | |
807 | logger .error("Er ror parsin g site ser vice updat ed date, " + e.getMe ssage(), e ); | |
808 | return false; | |
809 | } | |
810 | } | |
811 | ||
812 | pu blic boole an is8080R equestsOk( ) | |
813 | { | |
814 | int threshold = getConfi guration() .getActive 8080Reques tsThreshol d(); | |
815 | int busyThread s = 0; | |
816 | if ( getHttp808 0ThreadsBu sy() != nu ll) | |
817 | busyTh reads = In teger.pars eInt(getHt tp8080Thre adsBusy()) ; | |
818 | ||
819 | if(b usyThreads >= thresh old) | |
820 | return false; | |
821 | retu rn true; | |
822 | } | |
823 | ||
824 | pu blic boole an is8443R equestsOk( ) | |
825 | { | |
826 | int threshold = getConfi guration() .getActive 8443Reques tsThreshol d(); | |
827 | int busyThread s = 0; | |
828 | if ( getHttp844 3ThreadsBu sy() != nu ll) | |
829 | busyTh reads = In teger.pars eInt(getHt tp8443Thre adsBusy()) ; | |
830 | if(b usyThreads >= thresh old) | |
831 | return false; | |
832 | retu rn true; | |
833 | } | |
834 | ||
835 | pu blic boole an is8442R equestsOk( ) | |
836 | { | |
837 | int threshold = getConfi guration() .getActive 8442Reques tsThreshol d(); | |
838 | int busyThread s = 0; | |
839 | if ( getHttp844 2ThreadsBu sy() != nu ll) | |
840 | busyTh reads = In teger.pars eInt(getHt tp8442Thre adsBusy()) ; | |
841 | if(b usyThreads >= thresh old) | |
842 | return false; | |
843 | retu rn true; | |
844 | } | |
845 | ||
846 | pu blic int g etMaximum8 080Request s() | |
847 | { | |
848 | retu rn getConf iguration( ).getMaxim um8080Acti veRequests (); | |
849 | } | |
850 | ||
851 | pu blic int g etMaximum8 442Request s() | |
852 | { | |
853 | retu rn getConf iguration( ).getMaxim um8442Acti veRequests (); | |
854 | } | |
855 | ||
856 | pu blic int g etMaximum8 443Request s() | |
857 | { | |
858 | retu rn getConf iguration( ).getMaxim um8443Acti veRequests (); | |
859 | } | |
860 | ||
861 | pu blic boole an isRoiPe riodicProc essingEnab led() | |
862 | { | |
863 | retu rn roiPeri odicProces singEnable d; | |
864 | } | |
865 | ||
866 | pu blic boole an isRoiIm mediatePro cessingEna bled() | |
867 | { | |
868 | retu rn roiImme diateProce ssingEnabl ed; | |
869 | } | |
870 | ||
871 | pu blic boole an isROIPr ocessingEn abled() | |
872 | { | |
873 | retu rn isRoiIm mediatePro cessingEna bled() || isRoiPerio dicProcess ingEnabled (); | |
874 | } | |
875 | ||
876 | @O verride | |
877 | pu blic int c ompareTo(V ixServerHe althView o ) | |
878 | { | |
879 | retu rn this.si te.getSite Name().com pareToIgno reCase(o.g etSite().g etSiteName ()); | |
880 | } | |
881 | ||
882 | pr ivate void fillDicom SendFailur es(Map<Str ing, Strin g> propert ies) { | |
883 | int index = 0; | |
884 | ||
885 | whil e (propert ies | |
886 | .get(Vix ServerHeal thProperti es.VIX_DIC OM_SERVICE S_STORE_SC U_AETITLE | |
887 | + SendFailur es_DicomSe rviceStats + index) != null) { | |
888 | VixDic omSendFail ures failu re = new V ixDicomSen dFailures( ); | |
889 | failur e | |
890 | .setAeTitl e(properti es | |
891 | .get (VixServer HealthProp erties.VIX _DICOM_SER VICES_STOR E_SCU_AETI TLE | |
892 | + SendFa ilures_Dic omServiceS tats | |
893 | + index) ); | |
894 | failur e | |
895 | .setSopCla ss(propert ies | |
896 | .get (VixServer HealthProp erties.VIX _DICOM_SER VICES_STOR E_SCU_SOPC LASS | |
897 | + SendFa ilures_Dic omServiceS tats | |
898 | + index) ); | |
899 | failur e | |
900 | .setTotalV ixSendToAE Failures(p roperties | |
901 | .get (VixServer HealthProp erties.VIX _DICOM_SER VICES_STOR E_SCU_TOTA L_VIX_SEND _TO_AE_FAI LURES | |
902 | + SendFa ilures_Dic omServiceS tats | |
903 | + index) ); | |
904 | dicomS erviceStat s.add(fail ure); | |
905 | index+ +; | |
906 | } | |
907 | } | |
908 | ||
909 | pu blic List< VixDicomSe ndFailures > getDicom ServiceSta ts() { | |
910 | retu rn dicomSe rviceStats ; | |
911 | } | |
912 | ||
913 | ||
914 | ||
915 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.