Exemple #1
0
    def get_dico(self):
        self.compute_processing_time()
        to_ret = objToDictionnary(self)

        # sum
        to_ret['bytes_in'] = self._bytes_in.get_sum()
        to_ret['bytes_out'] = self._bytes_out.get_sum()
        to_ret['flowItem_in'] = self._flowItem_in.get_sum()
        to_ret['flowItem_out'] = self._flowItem_out.get_sum()

        # history
        to_ret['bytes_in_history'] = self._bytes_in.get_history(
            self.timerange_history)
        to_ret['bytes_out_history'] = self._bytes_out.get_history(
            self.timerange_history)
        to_ret['flowItem_in_history'] = self._flowItem_in.get_history(
            self.timerange_history)
        to_ret['flowItem_out_history'] = self._flowItem_out.get_history(
            self.timerange_history)

        # speed: sum/resolution
        to_ret['bytes_in_speed'] = [[t, elem / self.timeSpannedResolution]
                                    for t, elem in to_ret['bytes_in_history']]
        to_ret['bytes_out_speed'] = [[t, elem / self.timeSpannedResolution]
                                     for t, elem in to_ret['bytes_out_history']
                                     ]
        to_ret['flowItem_in_speed'] = [[
            t, elem / self.timeSpannedResolution
        ] for t, elem in to_ret['flowItem_in_history']]
        to_ret['flowItem_out_speed'] = [[
            t, elem / self.timeSpannedResolution
        ] for t, elem in to_ret['flowItem_out_history']]

        return to_ret
Exemple #2
0
 def get_representation(self, full=False):
     pInfo = objToDictionnary(self, full=full, to_ignore=['logger'])
     dStat = self._processStat.get_dico()
     dStat.update(self.get_system_info())
     pInfo['stats'] = dStat
     pInfo['representationTimestamp'] = time.time()
     return pInfo
Exemple #3
0
 def get_buffers_info(self):
     self.logger.debug('Getting buffers info')
     info = []
     for buuid in self.buffers_uuid:
         binfo = objToDictionnary(self.buffers[buuid])
         realtime_binfo = self._buffer_metadata_interface.get_info(
             buuid)  # realtime info
         binfo['stats'] = realtime_binfo
         info.append(binfo)
     return info
Exemple #4
0
 def __repr__(self):
     return json.dumps(objToDictionnary(self))
Exemple #5
0
 def __repr__(self):
     return json.dumps(objToDictionnary(self, full=False))
Exemple #6
0
 def gen_buffer_config(self):
     return objToDictionnary(self, full=False)
Exemple #7
0
 def gen_process_config(self):
     return objToDictionnary(self, full=False)