Merged PR 652285: Make stats tracing a bit more explicit

Make stats tracing a bit more explicit
This commit is contained in:
Sergey Tepliakov 2022-03-22 18:42:52 +00:00
Родитель 0cbcf00ec4
Коммит a4ef6e381f
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -316,12 +316,14 @@ namespace BuildXL.Cache.ContentStore.Tracing
{ {
if (string.IsNullOrEmpty(prefix)) if (string.IsNullOrEmpty(prefix))
{ {
// Trace(Severity.Debug, context, message); // Always prepend the messages with 'Shutdown stats' to simplify filtering.
counterSet.LogOrderedNameValuePairs(s => Trace(Severity.Debug, context, s, operation: nameof(TraceStatisticsAtShutdown))); // It's possible to filter based on the operation name, but seeing a prefix like this one in every message
// makes the filtering and analysis easier.
counterSet.LogOrderedNameValuePairs(s => Trace(Severity.Debug, context, $"Shutdown stats: {s}", operation: nameof(TraceStatisticsAtShutdown)));
} }
else else
{ {
counterSet.LogOrderedNameValuePairs(s => Trace(Severity.Debug, context, $"{prefix}.{s}", operation: nameof(TraceStatisticsAtShutdown))); counterSet.LogOrderedNameValuePairs(s => Trace(Severity.Debug, context, $"Shutdown stats: {prefix}.{s}", operation: nameof(TraceStatisticsAtShutdown)));
} }
} }
} }