2
0
mirror of synced 2025-01-29 01:36:16 +00:00

41 lines
965 B
C#
Raw Normal View History

2023-04-18 13:22:41 +02:00
using KubernetesWorkflow;
2023-04-25 11:31:15 +02:00
using Logging;
2023-04-18 13:22:41 +02:00
namespace DistTestCore
{
public class BaseStarter
{
protected readonly TestLifecycle lifecycle;
protected readonly WorkflowCreator workflowCreator;
private Stopwatch? stopwatch;
public BaseStarter(TestLifecycle lifecycle, WorkflowCreator workflowCreator)
{
this.lifecycle = lifecycle;
this.workflowCreator = workflowCreator;
}
protected void LogStart(string msg)
{
Log(msg);
stopwatch = Stopwatch.Begin(lifecycle.Log, GetClassName());
}
protected void LogEnd(string msg)
{
stopwatch!.End(msg);
stopwatch = null;
}
protected void Log(string msg)
{
lifecycle.Log.Log($"{GetClassName()} {msg}");
2023-04-18 13:22:41 +02:00
}
private string GetClassName()
{
return $"({GetType().Name})";
2023-04-18 13:22:41 +02:00
}
}
}