@@ -57,10 +57,12 @@ sites_with_open_transfers = []
5757records = collections .defaultdict (set )
5858
5959sites_ongoings = []
60- sites_total = []
61- sites_copied = []
62- sites_total_stuck = []
63- sites_copied_stuck = []
60+ sites_total = [] # only requests with copied != total
61+ sites_copied = [] # only requests with copied != total
62+ sites_total_stuck = [] # only datasets with copied != total
63+ sites_copied_stuck = [] # only datasets with copied != total
64+ sites_total_ongoing = [] # only datasets with copied != total
65+ sites_copied_ongoing = [] # only datasets with copied != total
6466
6567# Get all sites with ongoing transfers
6668
@@ -124,10 +126,12 @@ def exec_get(sitename):
124126 debug_counter = 0
125127
126128 ongoings = []
127- site_total = 0
128- site_copied = 0
129- site_total_stuck = 0
130- site_copied_stuck = 0
129+ site_total = 0 # request level
130+ site_copied = 0 # request level
131+ site_total_stuck = 0 # dataset level
132+ site_copied_stuck = 0 # dataset level
133+ site_total_ongoing = 0 # dataset level
134+ site_copied_ongoing = 0 # dataset level
131135
132136 rrd_filepath = rrd_dir + '/' + sitename
133137
@@ -203,6 +207,8 @@ def exec_get(sitename):
203207 ongoings .append ([request_id ,dataset ,copied ,total ,is_stuck ])
204208 site_total_stuck += is_stuck * total
205209 site_copied_stuck += is_stuck * copied
210+ site_total_ongoing += total
211+ site_copied_ongoing += copied
206212 rrdtool .update (rrd_file , '%d:%d:%d' % (timestamp , copied , total ))
207213 else :
208214 try :
@@ -225,6 +231,8 @@ def exec_get(sitename):
225231 sites_copied .append ([sitename ,site_copied ])
226232 sites_total_stuck .append ([sitename ,site_total_stuck ])
227233 sites_copied_stuck .append ([sitename ,site_copied_stuck ])
234+ sites_total_ongoing .append ([sitename ,site_total_ongoing ])
235+ sites_copied_ongoing .append ([sitename ,site_copied_ongoing ])
228236
229237 with open ("%s/filelist.txt" % rrd_filepath , "w" ) as csvfilelist :
230238 fieldnames = ["id" ,"name" ,"copied" ,"total" ,"stuck" ]
@@ -255,8 +263,8 @@ with open("%s/overview.txt" % rrd_dir, "w") as overview:
255263 for site in sites_with_open_transfers :
256264 if sum (x [1 ] for x in sites_total if x [0 ] == site ) == 0 :
257265 continue
258- writer .writerow ({"sitename" : site , "ongoing" : sum (x [1 ] for x in sites_ongoings if x [0 ] == site ), "total" : sum (x [1 ] for x in sites_total if x [0 ] == site ),
259- "copied" : sum (x [1 ] for x in sites_copied if x [0 ] == site ), "total_stuck" : sum (x [1 ] for x in sites_total_stuck if x [0 ] == site ), "copied_stuck" : sum (x [1 ] for x in sites_copied_stuck if x [0 ] == site )})
266+ writer .writerow ({"sitename" : site , "ongoing" : sum (x [1 ] for x in sites_ongoings if x [0 ] == site ), "total" : sum (x [1 ] for x in sites_total_ongoing if x [0 ] == site ),
267+ "copied" : sum (x [1 ] for x in sites_copied_ongoing if x [0 ] == site ), "total_stuck" : sum (x [1 ] for x in sites_total_stuck if x [0 ] == site ), "copied_stuck" : sum (x [1 ] for x in sites_copied_stuck if x [0 ] == site )})
260268
261269total_volume = sum ((x [1 ] for x in sites_total ))
262270copied_volume = sum ((x [1 ] for x in sites_copied ))
0 commit comments