Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ WriteMakefile(
PREREQ_PM => {
#'ABC' => 1.6,
#'Foo::Bar::Module' => 5.0401,
'Attribute::Handlers'=>0,
'Clone'=>0,
'InfluxDB::LineProtocol'=>0,
'List::MoreUtils'=>0,
'JSON::MaybeXS'=>0,
'LWP::Protocol::http'=>0,
'LWP::Protocol::https'=>0,
'LWP::UserAgent'=>0,
'Object::Result'=>0,
'Sub::Delete'=>0,
'Switch'=>0,
'URI'=>0
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'InfluxDB-HTTP-*' },
Expand Down
34 changes: 20 additions & 14 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ attribute C<error>:
Furthermore, all result objects provide access to the C<HTTP::Response> object that is returned
by InfluxDB in the attribute C<raw>.

=head2 new host => 'localhost', port => 8086, timeout => 600
=head2 new(host=>'localhost', port=>8086, username=>'zutana', password=>'se¢retØ', ssl=>1, ssl_verify=>0, ssl_opts=>{}, timeout=>600)

Passing C<host>, C<port> and/or C<timeout> is optional, defaulting to the InfluxDB defaults or
to 3 minutes for the timeout. The timeout is in seconds.
Passing C<host>, C<port>, C<username>, C<password>, C<ssl>, C<ssl_verify>, C<ssl_opts>, and/or
C<timeout> is optional, defaulting to the InfluxDB defaults or to 3 minutes for the timeout.
The timeout is in seconds.

Returns an instance of InfluxDB::HTTP.

=head2 ping
=head2 ping()

Pings the InfluxDB instance configured in the constructor (i.e. by C<host> and C<port>).

Expand All @@ -62,7 +63,7 @@ is part of the HTTP response from the pinged InfluxDB instance.
my $ping = $influx->ping();
print $ping->version if ($ping);

=head2 query query, database => "DATABASE", chunk_size => CHUNK_SIZE, epoch => "ns"
=head2 query(query, database=>"DATABASE", chunk_size=>CHUNK_SIZE, epoch=>"ns")

Used to query the InfluxDB instance. All parameters but the first one are optional. The
C<query> parameter can either be a String or a Perl ArrayRef of Strings, where every String
Expand All @@ -74,29 +75,34 @@ hash. Additionally the attribute C<request_id> provides the request identifier a
the HTTP reponse headers by InfluxDB. This can for example be useful for correlating
requests with log files.

=head2 write measurement, database => "DATABASE", precision => "ns", retention_policy => "RP"
=head2 write(data, database=>"DATABASE", precision=>"ns", retention_policy=>"RP", measurement=>"foo", tag_fields=>("tag1", ...))

Writes data into InfluxDB. The parameter C<measurement> can either be a String or an
ArrayRef of Strings, where each String contains one valid InfluxDB LineProtocol
statement. All of those mesaurements are then sent to InfluxDB and the specified
database. The returned object evaluates to true if the write was successful, and otherwise
to false.
Writes data into InfluxDB. The 1ˢᵗ parameter C<data> can either be a String or an
ArrayRef of Strings or Hashes, where each String contains one valid InfluxDB LineProtocol
statement and each Hash represents a point. All of those mesaurements are then sent to
InfluxDB and the specified database. The returned object evaluates to true if the
write was successful, and otherwise to false.

The optional argument precision can be given if a precsion different than "ns" is used in
The optional argument "C<precision>" can be given if a precsion different than "ns" is used in
the line protocol. InfluxDB docs suggest that using a coarser precision than ns can save
space and processing. In many cases "s" or "m" might do.

The optional argument retention_policy can be used to specify a retention policy other than
The optional argument "C<retention_policy>" can be used to specify a retention policy other than
the default retention policy of the selected database.

The optional argument "C<measurement>" is required if the 1ˢᵗ parameter C<data> is an ArrayRef
and contains elements other than Strings.

The optional argument "C<tag_fields>" specifies which field(s) will be stored as tag(s).

=head2 get_lwp_useragent

Returns the internally used LWP::UserAgent instance for possible modifications
(e.g. to configure an HTTP proxy).

=head1 AUTHOR

Raphael Seebacher, C<< <raphael@seebachers.ch> >>
Raphael Seebacher, C<< <raphael@seebachers.ch> >>, modificada por sam80180 C<< <https://github.com/sam80180/InfluxDB-HTTP> >>

=head1 BUGS

Expand Down
Loading