The IperfParser

This is the class that performs the work of extracting the data-column.

The IperfParser extracts a column from the iperf-output. Currently it only extracts bandwidth. Either it needs to be made more flexible (or a better idea might be to create a family of column extractors). The IperfParser is differentiated from the SumParser in that it re-adds adds the parallel threads and in-fills zeros for missing time-intervals.

Warning

The intervals and transfer_intervals are defaultdict objects. This was done so that if an expected interval is missing then a 0 will be returned. As a side, effect, though, if you ask for an interval that didn’t exist, you will always get 0, even if it is outside of the range of the data.

IperfParser -|> BaseClass
IperfParser : bandwidths
IperfParser : regex
IperfParser : intervals
IperfParser : conversion
IperfParser : filename(basename)
IperfParser : reset()
IperfParser : pipe(target)
IperfParser : search(line)
IperfParser : __call__(line)
IperfParser : bandwidth(match)
IperfParser : valid(match)

IperfParser([expected_interval, ...]) The Iperf Parser extracts bandwidth and other information from the output
IperfParser.bandwidths Traverses self.interval’s keys in sorted order and generates their bandwidths.
IperfParser.transfers generator of transfer values
IperfParser.regex A dictionary holding the regular expressions for the 2 formats
IperfParser.intervals
IperfParser.conversion
IperfParser.valid(match)
param:
IperfParser.bandwidth(match)
param:
IperfParser.__call__(line)
param:
IperfParser.search(line)
param:
IperfParser.pipe(*args, **kwargs)
IperfParser.reset() Resets the attributes set during parsing

Properties

bandwidths

This is a generator of values from IperfParser.intervals in the sorted order of the keys (intervals). It is based on the premise that IperfParser.intervals is a dictionary whose keys are the start of the iperf sample intervals. e.g if the samples are reported at 1-second intervals then the keys are traversed 0.0, 1.0,\ldots.

Note

The name of the property suggests that the dictionary values are bandwidths but if this class is generalized to extract other columns then this will no longer be true and should be changed.

regex

This is a dictionary holding the regular expressions for the csv-format and the human-readable format. The keys should be accessed through iperfexpressions.ParserKeys (e.g. self.regex[ParserKeys.human] to get the regular expression for the human-readable iperf output).