line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::InfluxDB::Row; |
2
|
|
|
|
|
|
|
# ABSTRACT: Result row container |
3
|
|
|
|
|
|
|
$Mojo::InfluxDB::Row::VERSION = '0.1'; |
4
|
1
|
|
|
1
|
|
8
|
use Mojo::Base -base, -signatures; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
5
|
1
|
|
|
1
|
|
670
|
use Mojo::InfluxDB::Point; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
26
|
|
6
|
1
|
|
|
1
|
|
55
|
use Mojo::Collection qw/ c /; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
7
|
1
|
|
|
1
|
|
6
|
use List::MoreUtils qw/ zip /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'time_zone'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has src => sub { die "This result is empty" }; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
for my $field (qw/ names tags columns values partial /) { |
14
|
|
|
|
|
|
|
has $field => sub($self){ $self->src->{$field} }; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has points => sub($self) { |
18
|
|
|
|
|
|
|
c( $self->values->@* )->map(sub { |
19
|
|
|
|
|
|
|
Mojo::InfluxDB::Point->inflate(+{ |
20
|
|
|
|
|
|
|
zip( $self->columns->@*, $_->@* ), |
21
|
|
|
|
|
|
|
( $self->tags ? $self->tags->%* : () ) |
22
|
|
|
|
|
|
|
}); |
23
|
|
|
|
|
|
|
}) |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding UTF-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Mojo::InfluxDB::Row - Result row container |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 0.1 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
See L<InfluxDB> and L<InfluxDB::Result>. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 src |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
this is where L<InfluxDB::Result> will store the raw data retrieved for this row. Most attributes of this class will read from here. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 time_zone |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
an optional time_zone that will be passed into every L<Mojo::InfluxDB::Point> returned by points(). |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 names |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 tags |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 columns |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 values |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 partial |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 points |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
A L<Mojo::Collection> of L<Mojo::InfluxDB::Point>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Gonzalo Radio <gonzalo@gnzl.net> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Gonzalo Radio. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |