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 : |
98 |
|
else : |
99 |
|
report[protocol][action] = [attempted,succeeded,total_size,total_time,min_time,max_time] |
100 |
|
else : |
101 |
< |
report[protocol] = {'action' : [attempted,succeeded,total_size,total_time,min_time,max_time] } |
101 |
> |
report[protocol] = {action : [attempted,succeeded,total_size,total_time,min_time,max_time] } |
102 |
|
|
103 |
|
if debug : |
104 |
|
for protocol in report.keys() : |
112 |
|
dashboard_report['MonitorID'] = MonitorID |
113 |
|
dashboard_report['MonitorJobID'] = MonitorJobID |
114 |
|
for protocol in report.keys() : |
115 |
< |
if 'read' in report[protocol].keys() : |
116 |
< |
try: |
117 |
< |
size = float(report[protocol]['read'][2]) |
118 |
< |
time = float(report[protocol]['read'][3]) |
119 |
< |
dashboard_report['io_'+protocol] = size/time*1000 |
120 |
< |
except: |
121 |
< |
pass |
115 |
> |
for action in report[protocol].keys() : |
116 |
> |
try: size = float(report[protocol][action][2]) |
117 |
> |
except: size = 'NULL' |
118 |
> |
try: time = float(report[protocol][action][3])/1000 |
119 |
> |
except: time = 'NULL' |
120 |
> |
dashboard_report['io_'+protocol+'_'+action] = str(size)+'_'+str(time) |
121 |
|
|
122 |
|
if debug : |
123 |
< |
print dashboard_report |
123 |
> |
ordered = dashboard_report.keys() |
124 |
> |
ordered.sort() |
125 |
> |
for key in ordered: |
126 |
> |
print key,'=',dashboard_report[key] |
127 |
|
|
128 |
|
# send to DashBoard |
129 |
|
apmonSend(MonitorID, MonitorJobID, dashboard_report) |
134 |
|
for key in dashboard_report.keys() : |
135 |
|
exit_string += ';' + str(key) + '=' + str(dashboard_report[key]) |
136 |
|
|
137 |
+ |
|
138 |
+ |
|
139 |
|
return exit_string |
140 |
|
|
141 |
|
|