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
Tail::Stat::Plugin(3) User Contributed Perl Documentation Tail::Stat::Plugin(3)

Tail::Stat::Plugin - Abstract plugin class

    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;
    }

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

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

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

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.

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

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

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

Stringify accumulated statistics.

Optionally preprocess, and stringify accumulated statistics.

Returns default logging level for unparsed lines.

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

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.

2015-10-21 perl v5.32.1

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

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