iperflexer.sumparser.SumParser

class iperflexer.sumparser.SumParser(*args, **kwargs)[source]

The SumParser emits bandwidth sum lines

__init__(*args, **kwargs)[source]

Methods

__init__(*args, **kwargs)
bandwidth(match)
param:
filename(basename) Changes the extension of the basename to .csv
pipe(*args, **kwargs)
reset() Resets the attributes set during parsing
search(line)
param:
valid(match)
param:

Attributes

bandwidths Traverses self.interval’s keys in sorted order and generates their bandwidths.
SumParser.conversion
SumParser.intervals
logger
return:A logging object.
regex
return:a dictionary of compiled regular expressions
bandwidth(match)
Param:
  • match: A parsed match group dictionary
Return type:

float

Returns:

the bandwidth in the self.units

filename(basename)

Changes the extension of the basename to .csv

Param:
  • basename: a the raw-iperf filename (without path)
Returns:

the filename with the extension changed to .csv

reset()

Resets the attributes set during parsing

search(line)
Param:
  • line: a string of iperf output
Returns:

match dict or None

transfer(match)
Param:
  • match: A parsed match group dictionary
Return type:

float

Returns:

the transfer in the self.units

traverse(intervals)

traverses the intervals, infilling missing intervals

Param:
  • intervals: default dict of interval:value
Yield:

next value for the interval

valid(match)
Param:
  • match: a groupdict containing parsed iperf fields
Returns:

True if the end-start interval is valid (within tolerance)

bandwidths

Traverses self.interval’s keys in sorted order and generates their bandwidths.

Yield:self.interval’s values in the sorted order of the intervals
logger
Returns:A logging object.
regex[source]
Returns:a dictionary of compiled regular expressions
transfer_units

a hack to handle the fact that only the bandwidth units are being specified

transfers

generator of transfer values

Yield:converted transfer interval values