2 |
|
|
3 |
|
import sys, getopt, string |
4 |
|
|
5 |
< |
from FwkJobRep.ReportParser import readJobReport |
5 |
> |
from ProdCommon.FwkJobRep.ReportParser import readJobReport |
6 |
|
from DashboardAPI import apmonSend, apmonFree |
7 |
|
|
8 |
|
|
58 |
|
# load FwkJobRep |
59 |
|
jobReport = readJobReport(input)[0] |
60 |
|
|
61 |
< |
exit_satus = '' |
61 |
> |
exit_status = '' |
62 |
|
|
63 |
< |
# get ExitStatus of last error |
64 |
< |
if len(jobReport.errors) != 0 : |
65 |
< |
exit_status = str(jobReport.errors[-1]['ExitStatus']) |
66 |
< |
else : |
67 |
< |
exit_status = str(0) |
63 |
> |
##### temporary fix for FJR incomplete #### |
64 |
> |
fjr = open (input) |
65 |
> |
len_fjr = len(fjr.readlines()) |
66 |
> |
if (len_fjr <= 6): |
67 |
> |
### 50115 - cmsRun did not produce a valid/readable job report at runtime |
68 |
> |
exit_status = str(50115) |
69 |
> |
else: |
70 |
> |
# get ExitStatus of last error |
71 |
> |
if len(jobReport.errors) != 0 : |
72 |
> |
exit_status = str(jobReport.errors[-1]['ExitStatus']) |
73 |
> |
else : |
74 |
> |
exit_status = str(0) |
75 |
|
|
76 |
|
# get i/o statistics |
77 |
|
storageStatistics = str(jobReport.storageStatistics) |
122 |
|
for action in report[protocol].keys() : |
123 |
|
try: size = float(report[protocol][action][2]) |
124 |
|
except: size = 'NULL' |
125 |
< |
try: time = float(report[protocol][action][3])*1000 |
125 |
> |
try: time = float(report[protocol][action][3])/1000 |
126 |
|
except: time = 'NULL' |
127 |
|
dashboard_report['io_'+protocol+'_'+action] = str(size)+'_'+str(time) |
128 |
|
|
141 |
|
for key in dashboard_report.keys() : |
142 |
|
exit_string += ';' + str(key) + '=' + str(dashboard_report[key]) |
143 |
|
|
144 |
+ |
|
145 |
+ |
|
146 |
|
return exit_string |
147 |
|
|
148 |
|
|