public override string ToString() { var msg = new StringBuilder(); msg.AppendLine("测试名称:" + Name + Environment.NewLine); msg.AppendLine("重复的次数:" + Iteration + Environment.NewLine); msg.AppendLine("线程的计数:" + ThreadCount + Environment.NewLine); msg.AppendLine("模拟思考的时间:" + MockThinkTime + Environment.NewLine); msg.AppendLine("运行时间(ms):" + TimeElapsed + Environment.NewLine); msg.AppendLine("Cpu 时钟周期(ns):" + CpuCycles.ToString("N0") + Environment.NewLine); msg.AppendLine("执行成功计数:" + SuccessCount + Environment.NewLine); msg.AppendLine("执行失败计数:" + FailureCount + Environment.NewLine); return(msg.ToString()); }
/// <summary> 格式化测试结果 </summary> /// <returns></returns> public override string ToString() { var msg = new StringBuilder(); msg.AppendLine(string.Concat("测试名称:", Name)); msg.AppendLine(string.Concat("单线程重复的次数:", Iteration)); msg.AppendLine(string.Concat("线程的计数:", ThreadCount)); msg.AppendLine(string.Concat("模拟思考的时间:", MockThinkTime)); msg.AppendLine(string.Concat("运行时间(ms):", TimeElapsed)); var tps = Math.Round((Iteration * ThreadCount * 1000D) / TimeElapsed, 3); msg.AppendLine(string.Concat("TPS(act/sec):", tps)); msg.AppendLine(string.Concat("Cpu 时钟周期(ns):", CpuCycles.ToString("N0"))); msg.AppendLine(string.Concat("执行成功计数:", SuccessCount)); msg.AppendLine(string.Concat("执行失败计数:", FailureCount)); return msg.ToString(); }