Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Perl Modules

    PBS::Logs::Acct 0.02

    Download button

    No screenshots available
    Downloads: 364  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.3/5)
    3 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dr R K Owen | More programs
    LGPL / FREE
    November 28th, 2007, 07:38 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    PBS::Logs::Acct description

    PBS::Logs::Acct parses the PBS accounting log files and inherits from PBS::Logs.

    PBS::Logs::Acct parses the PBS accounting log files and inherits from PBS::Logs.

    SYNOPSIS

    See the sections below: use PBS::Logs::Acct;

    The only non-inheritable function is the class level debug() PBS::Logs::Acct::debug()

    You must use PBS::Logs::debug()

    to read or set global debugging. However, the instance version works just fine: $pl->debug()

    Other than that PBS::Logs::Acct inherits all the methods that are available from PBS::Logs, plus adds the methods listed below.

    new

    Create a PBS::Logs::Acct object. It takes only one argument which is either a filename, array reference, or a FILE glob reference.
    See PBS::Logs::new for examples and specifics.

    get()

    Get the next accounting log entry. Extends PBS::Logs::get() by filtering based on record_types. See PBS::Logs::Acct::filter_records() below for more info on this filtering, and PBS::Logs::get() for info on return values.

    Special Arrays

    The following special associative arrays (hashes) are provided by this package, which may be useful for translating between arrays returned by the get() method to/from hashes returned by the get_hash() method, or for selecting a subset of the log entry.

    %PBS::Logs::Acct::num2keys

    Relates array position (number) to the keys (or field descriptions) of a get_hash() generated hash.

    %num2keys = (
    0 => 'datetime',
    1 => 'record_type',
    2 => 'id',
    3 => 'message'
    );

    %PBS::Logs::Acct::keys

    Relates keys (field descriptions) as used by the get_hash() method to array positions (number) as returned from the get() method. Essentially, just the inverse of %PBS::Logs::Acct::num2keys above.

    %PBS::Logs::Acct::record_type

    Describes the record types, which are keys to this hash array. %record_type = ( 'A' => 'job aborted by server', 'B' => 'resource reservation period begin', 'C' => 'job checkpointed and held', 'D' => 'job deleted by request', 'E' => 'job ended', 'F' => 'resource reservation period finish', 'K' => 'removal of resource reservation by sheduler or server', 'k' => 'removal of resource reservation by client', 'Q' => 'job queued', 'R' => 'job rerun', 'S' => 'job execution started', 'T' => 'job restarted from checkpoint', 'U' => 'unconfirmed resource reservation created by server', 'Y' => 'confirmed resource reservation created by scheduler', );

    get_hash()

    Like the PBS::Logs::Acct::get() method; however, instead of returning an array reference, it (obviously) returns a hash where the keys are the same keys as given by %PBS::Logs::Acct::keys .

    The accounting log entry looks like this with respect to the keys: datetime;record_type;id;message

    where the message field can have several key=value pairs depending on the record_type and all the new-lines have been replaced with spaces.
    If in a scalar mode it will return a hash reference else it returns a hash.

    filter_records(@array_reference_list_of_record_types)
    filter_records(@array_list_of_record_types)

    Sets or reads the record_type filter for the get() method.

    get() or get_hash() will only retrieve lines that have a record_type in the list given.

    Sending an empty array reference will clear the record_type filtering.
    It will return '1' if successful, else undef if some warning occurs.
    If no arguments are given then the method will return an array of record_types filtered.

    message_hash($message_text)

    Parses an accounting log message and returns an associatvie array (hash) containing the key/value pairs. And for certain fields, such as: Resource_List and resources_used, the value is another hash array containing the resource key and value. Can be called either as a method of an instantiated object, or as a class function.

    An example of the mesage text with resources_used dotted field: ... resources_used.cpupercent=0 resources_used.cput=00:00:00 resources_used.mem=2880kb resources_used.ncpus=4 resources_used.vmem=6848kb resources_used.walltime=00:00:00 ...
    Results in a hash array of: ... resources_used => { cpupercent => 0, cput => 00:00:00, mem => 2880kb, ncpus => 4, vmem => 6848kb, walltime => 00:00:00 }, ...

    message_hash_dump($message_hash)

    Takes the hash returned by message_hash() and recursively dumps the keys and values into a string suitable for viewing or evaluation. Can be called either as a method of an instantiated object, or as a class function.

    Example of evaluating the output: my $m = PBS::Logs::Acct::message_hash($some_message); my $t = PBS::Logs::Acct::message_hash_dump($m); my $x; eval "$x = $t"; # $x is now a HASH reference, equivalent to $m

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    PBS accounting | log parser | Perl module | PBS | accounting | log



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM