MATSUNO★Tokuhiro > GrowthForecast-Aggregator-Declare-v0.1.1 > GrowthForecast::Aggregator::DB

Download:
GrowthForecast-Aggregator-Declare-v0.1.1.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

GrwothForecast::Aggregator::DB - Aggregate from RDBMS

SYNOPSIS ^

    my $aggregator = GrowthForecast::Aggregator::DB->new(
        service => 'blog',
        section => 'entry',
        name    => 'count',
        query   => q{SELECT COUNT(*) FROM entry WHERE status=?},
        binds   => [1],
    );
    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"

name : Str, required

Name of the metrics.

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

description: 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.

syntax highlighting: