The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojo::InfluxDB::Point - Data point dynamic container

VERSION

version 0.1

SYNOPSIS

You won't usually deal with this objects, but get it from InfluxDB::Row or InfluxDB::Result points() methods.

Anyway, given the dynamical nature of this object, if you need to manually contruct one, you need to use the inflate() method:

    use Mojo::InfluxDB::Point;

    my $point = Mojo::InfluxDB::Point->inflate({
        time   => '2020-09-19T07:00:00Z', # required!
        tags   => [qw/ one two seven /],
        status => "SECONDARY"
    });

DESCRIPTION

This class is a dynamic container of data points coming from InfluxDB::Row. It only requires to have a time and will dinamically create object attributes for the rest of the retrieved columns.

ATTRIBUTES

time

this is the string as it comes from InfluxDB and is the only required one.

time_zone

an optional time zone. See at().

at

A DateTime object representing the time() on the optionally given time_zone().

fields

Fields will be filled by inflate() at build time and will contain an array of dynamically added attributes.

METHODS

inflate

this is the constructor for this class. Internally it will call new(). This class method handles the "magic" of dinamically detecting fields and adding an attribute for those.

Methods

AUTHOR

Gonzalo Radio <gonzalo@gnzl.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Gonzalo Radio.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.