ToString() public method

public ToString ( ) : string
return string
Beispiel #1
0
        public void Report(Program.Options options)
        {
            var computerSpecifications = new ComputerSpecifications();

            if (options.ShouldPrintComputerSpecifications)
            {
                Console.WriteLine();
                Console.Write(computerSpecifications.ToString());
            }

            if (!options.ShouldGenerateReport)
            {
                return;
            }

            var path = Path.Combine(Environment.CurrentDirectory, _perfTestType.Name + "-" + DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss") + ".html");

            File.WriteAllText(path, BuildReport(computerSpecifications));

            var totalsPath = Path.Combine(Environment.CurrentDirectory, $"Totals-{DateTime.Now:yyyy-MM-dd}.csv");

            File.AppendAllText(totalsPath, $"{DateTime.Now:HH:mm:ss},{_perfTestType.Name},{_results.Max(x => x.Histogram.GetValueAtPercentile(99))}\n");

            if (options.ShouldOpenReport)
            {
                Process.Start(path);
            }
        }
Beispiel #2
0
        public void Report(Program.Options options)
        {
            var computerSpecifications = new ComputerSpecifications();

            if (options.ShouldPrintComputerSpecifications)
            {
                Console.WriteLine();
                Console.Write(computerSpecifications.ToString());
            }

            if (!options.ShouldGenerateReport)
            {
                return;
            }

            var path = Path.Combine(Environment.CurrentDirectory, _perfTestType.Name + "-" + DateTime.UtcNow.ToString("yyyy-MM-dd hh-mm-ss") + ".html");

            File.WriteAllText(path, BuildReport(computerSpecifications));

            var totalsPath = Path.Combine(Environment.CurrentDirectory, $"Totals-{DateTime.Now:yyyy-MM-dd}.csv");
            var average    = _results.Average(x => x.TotalOperationsInRun / x.Duration.TotalSeconds);

            File.AppendAllText(totalsPath, FormattableString.Invariant($"{DateTime.Now:HH:mm:ss},{_perfTestType.Name},{average}\n"));

            if (options.ShouldOpenReport)
            {
                Process.Start(path);
            }
        }
Beispiel #3
0
        public void GenerateAndOpenReport(bool shouldOpen)
        {
            var path = Path.Combine(Environment.CurrentDirectory, _perfTestType.Name + "-" + DateTime.UtcNow.ToString("yyyy-MM-dd hh-mm-ss") + ".html");

            var computerSpecifications = new ComputerSpecifications();

            Console.WriteLine(computerSpecifications.ToString());

            File.WriteAllText(path, BuildReport(computerSpecifications));

            var totalsPath = Path.Combine(Environment.CurrentDirectory, $"Totals-{DateTime.Now:yyyy-MM-dd}.csv");

            File.AppendAllText(totalsPath, $"{DateTime.Now:HH:mm:ss},{_perfTestType.Name},{_results.Average(x => x.TotalOperationsInRun / x.Duration.TotalSeconds)}\n");

            if (shouldOpen)
            {
                Process.Start(path);
            }
        }
        public void GenerateAndOpenReport(bool shouldOpen)
        {
            var path = Path.Combine(Environment.CurrentDirectory, _perfTestType.Name + "-" + DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss") + ".html");

            var computerSpecifications = new ComputerSpecifications();
            Console.WriteLine(computerSpecifications.ToString());

            File.WriteAllText(path, BuildReport(computerSpecifications));

            var totalsPath = Path.Combine(Environment.CurrentDirectory, $"Totals-{DateTime.Now:yyyy-MM-dd}.csv");
            File.AppendAllText(totalsPath, $"{DateTime.Now:HH:mm:ss},{_perfTestType.Name},{_results.Max(x => x.Histogram.GetValueAtPercentile(99))}\n");

            if (shouldOpen)
                Process.Start(path);
        }