The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::ProcTrends::Cron - The great new App::ProcTrends::Cron!

VERSION

Version 0.03

SYNOPSIS

    use App::ProcTrends::Cron;

    my $ref = {
        rrd_dir => '/foo',
    };
    my $obj = App::ProcTrends::Cron->new( $ref );
    my $data = $obj->run_ps();
    my $rc = $obj->store_rrd( $data );

SUBROUTINES/METHODS

new

    The constructor.  Takes a hashref to override defaults.

DESTROY

    Destructor.  Alarm should be cleared upon exit.

run_ps

    Driver method to execute ps, parses the output and return data structure

sanitize_cmd

    Parses a command and turns into a valid RRD DS name.

trim_below_threshold

    Trims metrics <= threshold for cpu, rss

calc_rss_divisor

    Returns what to divide the ps RSS output by.  For example, if the unit is MB then we would divide KB by 1024.

store_rrd

    Driver method to:
        1. create directories if they don't already exist.
        2. get a list of RRDs I already have (so that I can fill in with 0's to
            avoid spotty graphs)
        3. go through the current list of metrics
            a. create RRD if needed
            b. update RRD
            c. pop them from my list if exists
        4. go through the remaining RRDs from my list then fill with 0's 

create_rrd

    Creates an RRD file.

update_rrd

    Updates an rrd file

alrm_handler

    Signal handler for alarm().  It is an instance method because I need access
    to the attributes.

set_signal_handlers

    Set signal handlers.  The only one I'm expecting is SIGALRM.

AUTHOR

Satoshi Yagi, <satoshi.yagi at yahoo.com>

BUGS

Please report any bugs or feature requests to bug-app-proctrends-cron at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-ProcTrends-Cron. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc App::ProcTrends::Cron

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2013 Satoshi Yagi.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.