toLineProtocol method

String toLineProtocol(
  1. WritePrecision precision, {
  2. Map? defaultTags,
})

Creates an InfluxDB protocol line out of this instance. |measurement,tag_set field_set timestamp

Implementation

String toLineProtocol(WritePrecision precision, {Map? defaultTags}) {
  var sb = StringBuffer();

  _escapeKey(sb, name, false);
  _appendTags(sb, defaultTags: defaultTags);
  var appendedFields = _appendFields(sb);
  if (!appendedFields) {
    return '';
  }
  _appendTime(sb, precision);

  return sb.toString();
}