Skip to content

Commit

Permalink
refactor: Show more stats from task data in Bench and HtcMock (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
aneojgurhem authored Mar 8, 2023
2 parents bf681ef + 40e2c0a commit 83fa3c5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tests/Common/Client/src/GrpcChannelExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ public static async Task LogStatsFromSessionAsync(this ChannelBase channel,
timeSpentList.Max(),
timeSpentList.Average());

timeSpentList = taskDependencies.Values.Select(raw => (raw.EndedAt - raw.AcquiredAt).ToTimeSpan()
.TotalMilliseconds / 1000)
.ToList();
logger.LogInformation("Time spent between {status1} and {status2} : {min}s, {max}s, {avg}s",
TaskStatus.Dispatched,
TaskStatus.Completed,
timeSpentList.Min(),
timeSpentList.Max(),
timeSpentList.Average());

var sessionStart = taskDependencies.Values.Min(raw => raw.CreatedAt);
var sessionEnd = taskDependencies.Values.Max(raw => raw.EndedAt);
var sessionDuration = (sessionEnd - sessionStart).ToTimeSpan();
Expand Down

0 comments on commit 83fa3c5

Please sign in to comment.