+import time
+
from PLC.Faults import *
from PLC.Parameter import Parameter
from PLC.Filter import Filter
### uses GetPeerData to gather all info in a single xmlrpc request
+ t_start=time.time()
# xxx see also GetPeerData - peer_id arg unused yet
all_data = self.peer_server.GetPeerData (self.auth,0)
+ t_acquired = time.time()
# refresh sites
plocal_sites = all_data['Sites-local']
all_sites = plocal_sites + all_data['Sites-peer']
all_nodes,
all_slices)
+ t_end=time.time()
### returned as-is by RefreshPeer
return {'plcname':self.api.config.PLC_NAME,
'new_sites':nb_new_sites,
'new_slice_attribute_types':nb_new_slice_attribute_types,
'new_slices':nb_new_slices,
'new_slice_attributes':nb_new_slice_attributes,
+ 'time_gather': all_data['ellapsed'],
+ 'time_transmit':t_acquired-t_start-all_data['ellapsed'],
+ 'time_process':t_end-t_acquired,
+ 'time_all':t_end-t_start,
}
# Thierry Parmentelat - INRIA
#
+import time
+
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
# xxx a peer cannot yet compute it's peer_id under another plc
# so we return all foreign objects by now
- return {
+ t_start = time.time()
+ result = {
'Sites-local' : Sites (self.api,{'peer_id':None}),
'Sites-peer' : Sites (self.api,{'~peer_id':None}),
'Keys-local' : Keys (self.api,{'peer_id':None}),
'SliceAttributes-local': SliceAttributes (self.api,{'peer_id':None}),
'SliceAttributes-peer': SliceAttributes (self.api,{'~peer_id':None}),
}
+ t_end = time.time()
+ result['ellapsed'] = t_end-t_start
+ return result