Ejemplo n.º 1
0
        /// <inheritdoc/>
        public IBenchmarkBuilderInSyntax<ISingleBenchmarkBuilderContinuation> Value()
        {
            var metric = new SingleValueMetric("single", data => data.Single()) { Samples = samples };
            metrics.Add(metric);

            return new BenchmarkBuilderInSyntax<ISingleBenchmarkBuilderContinuation>(metric, this);
        }
Ejemplo n.º 2
0
            /// <inheritdoc/>
            public void Visit(SingleValueMetric metric)
            {
                Ensure.ArgumentNotNull(metric, "metric");

                string result = SingleValueFormatter.Output(metric.Name, metric.UnitOfMeasurement, metric.GetValue());
                writer.WriteLine(result);
            }
Ejemplo n.º 3
0
            /// <inheritdoc/>
            public void Visit(SingleValueMetric metric)
            {
                Ensure.ArgumentNotNull(metric, "metric");

                string output = Format(metric.GetValue(), metric.UnitOfMeasurement);
                writer.WriteElementString(metric.Name, output);
            }
        /// <inheritdoc/>
        public IBenchmarkBuilderInSyntax<ISingleBenchmarkBuilderContinuation> Value(string value = null)
        {
            value = value ?? "value";

            var metric = new SingleValueMetric(value, data => data.Single()) { Samples = samples };
            metrics.Add(metric);

            return new BenchmarkBuilderInSyntax<ISingleBenchmarkBuilderContinuation>(metric, this);
        }