Example #1
0
        /// <summary>
        /// Gets readings for associated with a metric.
        /// </summary>
        private static ImmutableArray <MetricReading> GetReadings(this IMetricReadingWriter metric, DateTime timestamp)
        {
            var batch = new ArrayBatch();

            metric.Write(batch, timestamp);
            return(batch.ToImmutableArray());
        }
Example #2
0
        /// <summary>
        /// Gets all readings for all metrics in the specified enumerable of <see cref="MetricSource"/>.
        /// </summary>
        public static ImmutableArray <MetricReading> GetReadings(this IEnumerable <MetricSource> sources, DateTime timestamp)
        {
            var batch = new ArrayBatch();

            sources.WriteReadings(batch, timestamp);
            return(batch.ToImmutableArray());
        }