Exemplo n.º 1
0
        /// <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) });
        }
Exemplo n.º 2
0
        /// <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();
            }
        }
Exemplo n.º 3
0
        /// <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) });
        }