The Iperf Expressions

This module holds a set of regular expressions to help with lexing the iperf input.

The ExpressionBase

The ExpressionBase is an Abstract Base Class that provides a logger for children and requires that they implement an expression property.

ExpressionBase -|> BaseClass
ExpressionBase : String expression
ExpressionBase : re.RegexObject regex

ExpressionBase() An Abstract Base class for regular expression containers

The HumanExpression

This is a concrete implementation of the ExpressionBase.

HumanExpression -|> ExpressionBase
HumanExpression : String thread_column
HumanExpression : String expression
HumanExpression : re.RegexObject regex

HumanExpression() The Human Expression matches the human-readable iperf output

The expression is composed of parts from Oatbran so I will not re-define the base components. The following is an approximation of the expression (all the parts that are in all-capital letters are from oatbran, as are the number classes which are used because the latex output is not that easy to read in sphinx):

threads &\gets L\_BRACKET + OPTIONAL\_SPACES + \mathbb{Z} + R\_BRACKET\\
interval &\gets \mathbb{R} + OPTIONAL\_SPACES + DASH + \mathbb{R} + SPACES + `sec'\\
transfer &\gets \mathbb{R} + SPACES + [`GKM'] + ? + `Bytes'\\
bandwidth &\gets \mathbb{R} + SPACES + [`GKM'] + ? + (`bits'| `bytes') + `/sec'\\
expression  &\gets threads + SPACES + interval + SPACES + transfer + SPACES + bandwidth\\

The CSV Expression

The CSVExpression matches csv-output format (-y c).

CsvExpression -|> ExpressionBase
CsvExpression : re.RegexObject regex

CsvExpression() The Csv Expression holds the expression to match iperf’s csv format

As with the above, the main regular expressions are defined in the oatbran module and the following is just a rough approximation of the regular expression used:

thread &\gets \mathbb{N}\\
timestamp &\gets \mathbb{Z}\\
sender\_ip &\gets IP\_ADDRESS\\
sender\_port &\gets \mathbb{Z}\\
receiver\_ip &\gets IP\_ADDRESS\\
receiver\_port &\gets \mathbb{Z}\\
start &\gets \mathbb{R}\\
end &\gets \mathbb{R}\\
interval &\gets start + DASH + end\\
transfer &\gets \mathbb{Z}\\
bandwidth &\gets \mathbb{Z}\\
expression &\gets timestamp + COMMA + sender\_ip + COMMA + sender\_port + COMMA + receiver\_ip + COMMA + receiver\_port + COMMA + thread + COMMA + interval + COMMA + transfer + bandwidth\\

CombinedExpression

This does not look like it was actually implemented. I think it was a stillborn idea.

Parser Keys

The ParserKeys holds the keys for the re.match group dictionaries.

ParserKeys : units
ParserKeys : thread
ParserKeys : start
ParserKeys : end
ParserKeys : transfer
ParserKeys : bandwidth

ParserKeys : timestamp
ParserKeys : sender_ip
ParserKeys : sender_port
ParserKeys : receiver_ip
ParserKeys : receiver_port

ParserKeys : human
ParserKeys : csv