GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TAIL::STAT::PLUGIN (3)

.ds Aq ’

NAME

Tail::Stat::Plugin - Abstract plugin class

CONTENTS

SYNOPSIS



    package Tail::Stat::Plugin::apache;

    use strict;
    use warnings qw(all);

    use base qw(Tail::Stat::Plugin);

    sub regex { qr/^(\d+)\s+(\d+)/ }

    sub process_data {
        my ($self,$lref,$pub,$win) = @_;

        $pub->{param1} += $lref->[0];
        $win->{param2} += $lref->[1];
        $win->{count}++;
    }

    sub process_window {
        my ($self,$pub,$prv,$wins) = @_;

        $pub->{last_param2} = sum ( map { $_->{param2} || 0 } @$wins ) || 0;
    }



METHODS

    new

Plugin instance constructor. Usually you don’t need to override it’s default behavior.

    regex

Accessor to main regular expression. Called once during initialization (from constructor).

    init_zone($zone,\%public,\%private,\%window)

Called once on zone creating. Usually you can assigns some default values in public statistics.

    process_line($line)

Parse single log line and returns array of successfully captured values. Method must returns true value in scalar context, otherwise message will be logged about unprocessed line.

    process_data(\@ref,\%public,\%private,\%window)

Receives reference to array of captured values and modify public, private or current window statistics.

    process_window(\%public,\%private,\@windows)

Called during closing current window. Common usage is calculate averages from complete windows and save results in public or private statistics.

    process_timer($name,\%public,\%private,\@windows)

Processing named timer. Receives timer name and zone statistics. Timer will be renewed unless handler returns false value.

    dump_zone($zone,\%public,\%private,\@windows)

Stringify accumulated statistics.

    stats_zone($zone,\%public,\%private,\@windows)

Optionally preprocess, and stringify accumulated statistics.

    parse_error

Returns default logging level for unparsed lines.

AUTHOR

Oleg A. Mamontov, <oleg@mamontov.net>

COPYRIGHT

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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TAIL::STAT::PLUGIN (3) 2015-10-21

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.