GrowthForecast::Aggregator::Declare - Declarative interface for GrowthForecast client
use GrowthForecast::Aggregator::Declare; my @queries = gf { section member => sub { # post to member/count db( name => 'count', description => 'The number of members', query => 'SELECT COUNT(*) FROM member', ); }; section entry => sub { # post to entry/count, entry/count_unique db_multi( names => ['count', 'count_unique'], descriptions => ['Total count of posts', 'Posted bloggers'], query => 'SELECT COUNT(*), COUNT(DISTINCT member_id) FROM entry', ); }; }; for my $query (@queries) { $query->run( dbh => $dbh, ua => $ua, service => 'blog_service', endpoint => 'http://exapmle.com/api/', ); }
GrowthForecast::Aggregator::Declare is a declarative client library for GrowthForecast
This makes a scope to declare GrowthForecast metrics.
This function returns list of Aggregators.
section 'member' => sub { ... };
This function defines section. Under this function, db() and db_multi() function use the section name automatically.
Create GrowthForecast::Aggregator::DB object using %args.
%args
Create GrowthForecast::Aggregator::DBMulti object using %args.
Create GrowthForecast::Aggregator::Callback object using %args.
Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
This library is client for GrowthForecast.
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install GrowthForecast::Aggregator::Declare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GrowthForecast::Aggregator::Declare
CPAN shell
perl -MCPAN -e shell install GrowthForecast::Aggregator::Declare
For more information on module installation, please visit the detailed CPAN module installation guide.