|new() method||Creates a new, empty Usage object.|
|addUsage() method and deepCopy() method||
# $usage1 is 4 messages of 100 bytes Received # $usage2 is 1 message of 35 bytes Received my $usageTotal = $usage1 -> deepCopy(); # $usageTotal is 4 messages of 100 bytes Received $usageTotal -> addUsage($usage2); # $usageTotal is 5 messages of 135 bytes Received
Note that because we used deepCopy, $usage1 is still 4 messages of 100 bytes.
|registerBroadcast, registerSend, registerReceive methods|
|getBroadcastVolume, getSendVolume, getReceiveVolume methods||Returns deep copy of the applicable SyslogScan::Volume objects.|
|static deepCopy method||Returns deep copy of the whole SyslogScan::Usage object.|
|static dump||Returns a string containing (Message,Bytes) pairs for Broadcast, Send, and Receive volumes.|
new() method Creates a new Volume object of 0 messages, 0 bytes. deepCopy() method Creates a new Volume object with the same number of messages and bytes as the current Volume object. addVolume(), addSize() methods addVolume() adds the volume of a second Volume object onto the volume of the current Volume object.
addSize() adds on one message of the given size.
use SyslogScan::Volume; my $volume1 = new SyslogScan::Volume(); $volume1 -> addSize(512); my $volume2 = $volume1 -> deepCopy(); # $volume2 is 1 message, 512 bytes $volume2 -> addSize(31); # $volume2 is 2 messages, 543 bytes $volume2 -> addVolume($volume1); # $volume2 is 3 messages, 1055 bytes $volume2 -> addVolume($volume2); # $volume2 is 6 messages, 2110 bytes
getMessageCount, getByteCount Gets the number of messages and the total number of bytes, respectively. dump() Returns the string getMessageCount(),getByteCount()
A Volume is simply a two-element array of ($messages, $bytes).
$$volume is the number of messages $$volume is the number of bytes
The author (Rolf Harold Nelson) can currently be e-mailed as email@example.com.
This code is Copyright (C) SatelLife, Inc. 1996. All rights reserved. This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
In no event shall SatelLife be liable to any party for direct, indirect, special, incidental, or consequential damages arising out of the use of this software and its documentation (including, but not limited to, lost profits) even if the authors have been advised of the possibility of such damage.
|perl v5.20.3||SYSLOGSCAN::USAGE (3)||1996-09-18|