diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2018-05-30 16:22:56 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-06-05 10:09:20 +0200 |
commit | 0baf4da9e699170fc64a9436f7fb2498c0599081 (patch) | |
tree | 1b5d500f979be8e59c28fbdfac03c5dad04de834 /rumba/storyboard.py | |
parent | a389849c5b827fa5aac8ff93a1241c642cd300e6 (diff) | |
download | rumba-0baf4da9e699170fc64a9436f7fb2498c0599081.tar.gz rumba-0baf4da9e699170fc64a9436f7fb2498c0599081.zip |
storyboard: Add function to export flows stats
This adds a function to export the bytes sent by flows in a certain
DIF. It is implemented within the storyboard, which calls an abstract
function in the Experiment class so that every prototype can implement
it in its own specific way. This commit adds the implementation for
Ouroboros. It exports it to a csv, with the first item the source
IPCP, the second the destination IPCP and then the bytes sent on the
flow.
Diffstat (limited to 'rumba/storyboard.py')
-rw-r--r-- | rumba/storyboard.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rumba/storyboard.py b/rumba/storyboard.py index 56be7e0..beadf91 100644 --- a/rumba/storyboard.py +++ b/rumba/storyboard.py @@ -1035,6 +1035,24 @@ class StoryBoard(_SBEntity): logger.debug('Log list is:\n%s', logs_list) node.fetch_files(logs_list, dst_dir) + def schedule_export_dif_bandwidth(self, t, filename, dif): + """ + Schedules the generation of a csv file of the bandwidth used by + flows in a certain DIF at a certain time. + + :param filename: The output csv filename. + :param dif: The DIF to export + """ + if self.experiment is None: + raise ValueError("An experiment is needed to schedule commands.") + + if self._script is None: + self._script = _Script(self) + + action = functools.partial(self.experiment.export_dif_bandwidth, + filename, dif) + self._script.add_event(Event(action, ev_time=t)) + def schedule_link_state(self, t, dif, state): """ Schedules a link's (`rumba.model.ShimEthDIF`) state to go |