/// <summary> Record a named metric with the given duration. </summary> /// /// <param name="name"> The name of the metric to record. Only the first 1000 characters are /// retained. </param> /// <param name="value"> The number of seconds to associate with the named attribute. This can be /// negative, 0, or positive. </param> public void RecordMetric(string name, float value) { using (new IgnoreWork()) { var metricName = GetCustomMetricSuffix(name); //throws if name is null or empty var time = TimeSpan.FromSeconds(value); //throws if value is NaN, Neg Inf, or Pos Inf, < TimeSpan.MinValue, > TimeSpan.MaxValue var metric = _metricBuilder.TryBuildCustomTimingMetric(metricName, time); if (metric != null) { _metricAggregator.Collect(metric); } } }