line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Environ::ClickHouse; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.2'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
522
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
7
|
1
|
|
|
1
|
|
9
|
use v5.10; |
|
1
|
|
|
|
|
3
|
|
8
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
315
|
use App::Environ; |
|
1
|
|
|
|
|
538
|
|
|
1
|
|
|
|
|
24
|
|
11
|
1
|
|
|
1
|
|
257
|
use App::Environ::Config; |
|
1
|
|
|
|
|
7548
|
|
|
1
|
|
|
|
|
33
|
|
12
|
1
|
|
|
1
|
|
343
|
use HTTP::ClickHouse; |
|
1
|
|
|
|
|
51452
|
|
|
1
|
|
|
|
|
175
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $INSTANCE; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
App::Environ->register( __PACKAGE__, postfork => sub { undef $INSTANCE } ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
App::Environ::Config->register(qw(clickhouse.yml)); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub instance { |
21
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
unless ($INSTANCE) { |
24
|
0
|
|
|
|
|
|
my $config = App::Environ::Config->instance; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$INSTANCE = HTTP::ClickHouse->new( |
27
|
|
|
|
|
|
|
host => $config->{clickhouse}{host}, |
28
|
|
|
|
|
|
|
port => $config->{clickhouse}{port}, |
29
|
|
|
|
|
|
|
nb_timeout => $config->{clickhouse}{timeout}, |
30
|
0
|
|
|
|
|
|
database => '', |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $INSTANCE; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |