RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtctk::componentFramework::InfluxPoint Struct Reference

Represents a single data point for InfluxDB. More...

#include <rtctk/componentFramework/telegrafAdapter.hpp>

Public Member Functions

std::string ToLineProtocol () const
 Encodes data to InfluxDB line protocol format.
 

Public Attributes

std::string table_name
 Name of the table.
 
std::map< std::string, std::string > tags
 Tags are indexed key–value pairs used for efficient filtering.
 
std::map< std::string, FieldValuefields
 Fields hold the measured data values.
 
std::optional< std::chrono::nanoseconds > timestamp = std::nullopt
 Optional timestamp of the measurement.
 

Detailed Description

Represents a single data point for InfluxDB.

This structure models one point record compatible with the InfluxDB line protocol. Each point consists of a table name (measurement), a set of key–value tags, a set of numeric fields, and an optional timestamp with nanosecond precision.

Member Function Documentation

◆ ToLineProtocol()

std::string rtctk::componentFramework::InfluxPoint::ToLineProtocol ( ) const

Encodes data to InfluxDB line protocol format.

Converts the contents of this structure into a valid InfluxDB line protocol string.

Example output:

metrics,hostname=elthost,metric_type=frequency_estimate value_hz=0 1761206196967207602
Returns
A string containing the encoded line protocol.
See also
https://docs.influxdata.com/influxdb3/core/reference/line-protocol

Member Data Documentation

◆ fields

std::map<std::string, FieldValue> rtctk::componentFramework::InfluxPoint::fields

Fields hold the measured data values.

They are not indexed.

Example: { "value_hz": 3.2 }.

◆ table_name

std::string rtctk::componentFramework::InfluxPoint::table_name

Name of the table.

Example: metrics, state, cpu_usage.

◆ tags

std::map<std::string, std::string> rtctk::componentFramework::InfluxPoint::tags

Tags are indexed key–value pairs used for efficient filtering.

Example: { "hostname": "server01", "metric_type": "frequency_estimate" }.

◆ timestamp

std::optional<std::chrono::nanoseconds> rtctk::componentFramework::InfluxPoint::timestamp = std::nullopt

Optional timestamp of the measurement.

If not specified, the current server time will be used. Expressed in nanoseconds since the UNIX epoch.


The documentation for this struct was generated from the following files: