/// <summary> Will send the given metric in the specified format. </summary> /// <exception cref="ArgumentNullException"> Thrown when the metric is null. </exception> /// <param name="metric"> The metric. </param> public void Send(IMetric metric) { if (null == metric) { throw new ArgumentNullException("metric"); } _messenger.SendMetrics(new[] { metric.ToString(_key, _format) }); }
/// <summary> /// Writes the specified IMetric as tab separated values to a line of the file. /// </summary> /// <param name="metric">IMetric to write.</param> public void Write(IMetric metric) { if (metric == null) { throw new ArgumentNullException("metric"); } if (this.streamWriter == null) { throw new InvalidOperationException(Properties.Resources.FILE_NOT_OPENED); } this.streamWriter.WriteLine(metric.ToString()); if (this.AutoFlush) { this.streamWriter.Flush(); } }