Beispiel #1
0
        public string ToString(bool verbose, bool skipName = false)
        {
            var builder = new FluentString()
                          .If(Name != null && !skipName, $"{Name,-40}");

            if (DurationInSec <= 0d || TotalNodes <= 0)
            {
                return(builder.Append($"{TotalNodes,12:#,##0} nodes"));
            }

            builder.When(verbose, then =>
                         then.If(TotalDead >= 0, () => $" Dead={TotalDead:#,##0}:{TotalDead * 100 / TotalNodes:0}%")
                         .If(Duplicates >= 0, () => $" Dup={Duplicates:#,##0}:{Duplicates * 100 / TotalNodes:0}%")
                         .If(DepthCurrent >= 0, () => $" Depth={DepthCurrent:#,##0}:{DepthMax:#,##0}")
                         .If(DepthCompleted >= 0, () => $" DepthComplete={DepthCompleted:#,##0}")
                         )
            .Append($"{TotalNodes,11:#,##0} nodes at {TotalNodes / DurationInSec,7:#,##0}/s in {Elapsed.Humanize()}");

            return(builder);
        }