Point defines values of a single measurement.

Constructors

  • Create a new Point with specified a measurement name.

    Parameters

    • OptionalmeasurementName: string

      the measurement name

    Returns Point

Properties

fields: { [key: string]: string } = {}

escaped field values

Methods

  • Adds a number field.

    Parameters

    • name: string

      field name

    • value: any

      field value

    Returns Point

    this

    NaN/Infinity/-Infinity is supplied

  • Adds an integer field.

    Parameters

    • name: string

      field name

    • value: any

      field value

    Returns Point

    this

    NaN or out of int64 range value is supplied

  • Adds a tag. The caller has to ensure that both name and value are not empty and do not end with backslash.

    Parameters

    • name: string

      tag name

    • value: string

      tag value

    Returns Point

    this

  • Sets point timestamp. Timestamp can be specified as a Date (preferred), number, string or an undefined value. An undefined value instructs to assign a local timestamp using the client's clock. An empty string can be used to let the server assign the timestamp. A number value represents time as a count of time units since epoch, the exact time unit then depends on the precision of the API that writes the point.

    Beware that the current time in nanoseconds can't precisely fit into a JS number, which can hold at most 2^53 integer number. Nanosecond precision numbers are thus supplied as a (base-10) string. An application can also use ES2020 BigInt to represent nanoseconds, BigInt's toString() returns the required high-precision string.

    Note that InfluxDB requires the timestamp to fit into int64 data type.

    Parameters

    • value: undefined | string | number | Date

      point time

    Returns Point

    this

  • Creates an InfluxDB protocol line out of this instance.

    Parameters

    • Optionalsettings: Partial<PointSettings>

      settings control serialization of a point timestamp and can also add default tags, nanosecond timestamp precision is used when no settings or no settings.convertTime is supplied.

    Returns undefined | string

    an InfluxDB protocol line out of this instance

  • Adds an unsigned integer field.

    Parameters

    • name: string

      field name

    • value: any

      field value

    Returns Point

    this

    NaN out of range value is supplied

MMNEPVFCICPMFPCPTTAAATR