public void LogCost(StoreTaskDetails storeDetail, IOperationCost operationCost, int groupLevel) { Console.WriteLine("{0}{1,-20} {2:F1} {3:F2} msecs", new object[4] { (object)"-> ".PadLeft(groupLevel * 2), (object)operationCost.Operation, (object)operationCost.Cost, (object)operationCost.ElapsedMSecs }); }
private void VisitCosts(StoreTaskDetails storeDetail, IOperationCost operationCost, int groupLevel, IResultLogger[] loggers) { Write(loggers, logger => logger.LogCost(storeDetail, operationCost, groupLevel)); var isGroupLevel = operationCost is GroupOperationCost; if (isGroupLevel) { foreach (IOperationCost stepCost in ((GroupOperationCost)operationCost).StepCosts) { VisitCosts(storeDetail, stepCost, groupLevel + 1, loggers); } } }
public void LogCost(StoreTaskDetails storeDetail, IOperationCost operationCost, int groupLevel) { EnsureHeadings(); WriteLine( storeDetail.Store.Name, storeDetail.Command.GetType().Name, $"{storeDetail.Elapsed.TotalSeconds:F2}", storeDetail.Success ? "Successful" : "Failed", groupLevel.ToString(), operationCost.Operation, $"{operationCost.Cost:F2}", $"{operationCost.ElapsedMSecs:F2}"); }