/// <summary> /// Creates a new InfluxDB report that uses the Line Protocol syntax. /// </summary> /// <param name="config">The InfluxDB configuration object.</param> public InfluxdbBaseReport(InfluxConfig config = null) { this.config = GetDefaultConfig(config) ?? new InfluxConfig(); this.converter = config.Converter; this.formatter = config.Formatter; this.writer = config.Writer; ValidateConfig(this.config); }
/// <summary> /// Sets the GlobalTags on this instance to the specified value and returns this <see cref="InfluxdbConverter"/> instance. /// </summary> /// <param name="converter">The InfluxDB metric converter.</param> /// <param name="globalTags">The global tags that are added to all created <see cref="InfluxRecord"/> instances.</param> /// <returns>This <see cref="InfluxdbConverter"/> instance.</returns> public static InfluxdbConverter WithGlobalTags(this InfluxdbConverter converter, MetricTags globalTags) { converter.GlobalTags = globalTags; return(converter); }
/// <summary> /// Sets the Converter on the InfluxDB reporter configuration and returns the same instance. /// </summary> /// <param name="config">The InfluxDB reporter configuration.</param> /// <param name="converter">The InfluxDB metric converter.</param> /// <param name="configFunc">A lambda expression that allows further configuration of the <see cref="InfluxdbConverter"/> using fluent syntax.</param> /// <returns>This <see cref="InfluxConfig"/> instance.</returns> public static InfluxConfig WithConverter(this InfluxConfig config, InfluxdbConverter converter, Action <InfluxdbConverter> configFunc = null) { configFunc?.Invoke(converter); config.Converter = converter; return(config); }