CAIDA::Traffic2::FlowCounter - Storage object for flows
use CAIDA::Traffic2::FlowCounter;
$counter = new CAIDA::Traffic2::FlowCounter($packets, $bytes, $flows,
$first, $latest);
or
$counter = new CAIDA::Traffic2::FlowCounter;
$counter->pkts($packets);
$counter->bytes($bytes);
$counter->flows($flows);
$counter->first($first);
$counter->latest($latest);
FlowCounter is a container for holding flow information. It has the
following functions:
- new (LIST)
- new ()
-
Creates a new FlowCounter. Initialization values can be specified in LIST
instead of using the accessor functions. The order is pkts, bytes,
flows, first and latest. All values are optional.
- pkts (PACKETS)
- pkts ()
-
Sets and returns the number of packets. PACKETS is the new value; if
omitted, the previous value is returned.
- bytes (BYTES)
- bytes ()
-
Sets and returns the number of bytes. BYTES is the new value; if
omitted, the previous value is returned.
- flows (FLOWS)
- flows ()
-
Sets and returns the number of flows. FLOWS is the new value; if
omitted, the previous value is returned.
- first (FIRST)
- first ()
-
Sets and returns the first timestamp. FIRST is the new value; if
omitted, the previous value is returned.
- latest (LATEST)
- latest ()
-
Sets and returns the most recent timestamp. LATEST is the new value; if
omitted, the previous value is returned.
- duration ()
-
Returns latest - first.
- add (COUNTER)
- nadd (COUNTER)
-
Adds another COUNTER to the current one. pkts, bytes, and
flows are added arithmetically, first is the minimum of the
two values, and latest is the maximum.
nadd()
is the same
as add()
, but it is free to do destructive operations on COUNTER.
COUNTER should not be used again for anything after calling nadd()
.
- LD_LIBRARY_PATH
-
If using the C++ backend, it might be necessary to set your
LD_LIBRARY_PATH to find the proper libraries, such as libstdc++.
Ryan Koga <rkoga@caida.org>, David Moore <dmoore@caida.org>