public string Report() { StringBuilder sb = new StringBuilder(); sb.Append($" {"Server",30}") .Append($"\t{"AVG",10}") .Append($"\t{"StdDev",10}") .Append($"\t{"Min", 10}") .Append($"\t{"Max",10}") .Append($"\t{"Count",10}") .AppendLine(); foreach (KeyValuePair <string, List <double> > kvp in TimeDiffsPerServer) { sb.Append($" {kvp.Key,30}") .Append($"\t{MathPlus.Average(kvp.Value, 0),10}") .Append($"\t{MathPlus.StdDev(kvp.Value, 2),10}") .Append($"\t{kvp.Value.Min(),10}") .Append($"\t{kvp.Value.Max(),10}") .Append($"\t{kvp.Value.Count,10}") .AppendLine(); } sb.Append($" {"OVERALL",30}") .Append($"\t{MathPlus.Average(AllTimeDiffs, 0),10}") .Append($"\t{MathPlus.StdDev(AllTimeDiffs, 2),10}") .Append($"\t{AllTimeDiffs.Min(),10}") .Append($"\t{AllTimeDiffs.Max(),10}") .Append($"\t{AllTimeDiffs.Count,10}") .AppendLine(); return(sb.ToString()); }
public override string ToString() { return(new StringBuilder().Append($"Overall >>\tAVG: {MathPlus.Average(AllTimeDiffs, 0)}") .Append($"\tStDev: {MathPlus.StdDev(AllTimeDiffs, 2)} ") .Append($"\tMin: {AllTimeDiffs.Min()} ") .Append($"\tMax: {AllTimeDiffs.Max()} ") .Append($"\tSamples: {AllTimeDiffs.Count()} ").ToString()); }