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

NAME

GrwothForecast::Aggregator::DB - Aggregate from RDBMS

SYNOPSIS

    my $aggregator = GrowthForecast::Aggregator::DBMulti->new(
        names        => ['count',                'count_unique'],
        descriptions => ['Total count of posts', 'Posted bloggers'],
        query => 'SELECT COUNT(*), COUNT(DISTINCT member_id) FROM entry',
    );
    my $res = $aggregator->run();

DESCRIPTION

This aggregator aggregates data from RDBMS, and post it to GrowthForecast.

CONSTRUCTOR ARGUMENTS

section: Str, required

Section name.

This module send request to "/api/$service/$section/$name"

names : ArrayRef[Str], required

Names of the metrics.

This module send request to "/api/$service/$section/$name->[0]", "/api/$service/$section/$name->[1]", ....

descriptions: ArrayRef[Str], required

Description of the query. The module post it as 'description' parameter.

query: Str, required

This is a SQL query, to execute.

binds: ArrayRef, optional

Bind parameters for the query.

ARGUMENTS FOR 'run' METHOD

dbh

Data source database handle.

service

Service name.

This module send request to "/api/$service/$section/$name"

endpoint

Endpoint URL, contains '/api'.

E.g. http://example.com/api/

ua

Instance of HTTP client. I tested on Furl.