This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package CloudForecast::Data::Ucastpkts; | |
use CloudForecast::Data -base; | |
use CloudForecast::Log; | |
rrds map { [ $_, 'COUNTER' ] } qw /in out/; | |
graphs 'traffic' => 'Packets per sec'; | |
title { | |
my $c = shift; | |
my $ifname = $c->args->[1] || $c->args->[0] || '0'; return "Unicast Packets ($ifname)"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Scope::Container; | |
use strict; | |
use warnings; | |
use Guard; | |
use Log::Minimal; | |
use base qw/Exporter/; | |
our @EXPORT = /start_scope_container scope_container/; | |
our $CONTEXT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::Socket; | |
use AnyEvent::Handle; | |
use List::Util qw/max sum/; | |
use Getopt::Long; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Connector; | |
use strict; | |
use warnings; | |
use Carp; | |
use Data::Util qw/is_array_ref/; | |
use List::Util qw/shuffle/; | |
use Log::Minimal; | |
use Scope::Container; | |
use DBIx::Connector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Connector; | |
use strict; | |
use warnings; | |
use Carp; | |
use Data::Util qw/is_array_ref/; | |
use List::Util qw/shuffle/; | |
use Log::Minimal; | |
use Scope::Container; | |
use DBIx::Connector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Text::Xslate; | |
use Plack::Request; | |
my $bs = '\\'; | |
my %e = ( | |
q!\\! => $bs, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Encode; | |
use utf8; | |
use JSON; | |
use Text::Xslate; | |
use Plack::Request; | |
use Data::Rmap qw//; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warnings; | |
use Text::Xslate; | |
my $tx = Text::Xslate->new( | |
syntax => 'TTerse', | |
function => { | |
'sprintf' => sub { | |
my $format = shift; | |
sprintf($format,@_); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use DBI 1.615; | |
use Test::More; | |
my $callback = sub { | |
my ($obj,$query,$attr,@binds) = @_; | |
my $i=0; | |
map { ! defined $_ && die("undefined bind value found at \#$i, in query \x27$query\x27"); $i++ } @binds; | |
return; | |
}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ひつようない | |
my ($scheme, $driver, $attr_string, $attr_hash, $driver_dsn) = DBI->parse_dsn($dsn); | |
if ( 0 && $driver eq 'mysql' ) { | |
my %driver_dsn = map { | |
if ( $_ !~ /=/ ) { | |
( $_, undef ); | |
} | |
else { | |
split /=/, $_, 2; |