From a6b9f001648c1a989993ed635ef34a047ce13c9b Mon Sep 17 00:00:00 2001 From: Michael Pysson Date: Wed, 9 Feb 2022 23:55:45 +0000 Subject: [PATCH] Merged PR 647702: Add remotely run processes to the console Add remotely run processes to the console ```[0:06] 100.00% Processes:[413 done (412 hit), 0 executing, 0 waiting] Files:[1800/1800] [0:07] -- Cache savings: 99.76% of 413 included processes. 1487 excluded via filtering. [0:07] -- Cache misses run remotely: 1 of 1. Build Succeeded Log Directory: F:\src\BuildXL.Internal.mpysson\Out\Logs\20220203-104238``` --- Public/Src/Engine/Scheduler/Scheduler.cs | 7 +++++++ Public/Src/Engine/Scheduler/Tracing/Log.cs | 9 +++++++++ Public/Src/Engine/Scheduler/Tracing/LogEventId.cs | 1 + 3 files changed, 17 insertions(+) diff --git a/Public/Src/Engine/Scheduler/Scheduler.cs b/Public/Src/Engine/Scheduler/Scheduler.cs index 7ef060538..c5ff3f904 100644 --- a/Public/Src/Engine/Scheduler/Scheduler.cs +++ b/Public/Src/Engine/Scheduler/Scheduler.cs @@ -1827,6 +1827,13 @@ namespace BuildXL.Scheduler } } + var runRemoteProcesses = PipExecutionCounters.GetCounterValue(PipExecutorCounter.TotalRunRemoteProcesses); + var runRemoteFallback = PipExecutionCounters.GetCounterValue(PipExecutorCounter.TotalRemoteFallbackRetries); + if (runRemoteProcesses - runRemoteFallback > 0) + { + Logger.Log.RemoteBuildSavingsSummary(loggingContext, runRemoteProcesses, cacheMisses: totalProcessesNotIgnoredOrService - m_numProcessPipsSatisfiedFromCache); + } + if (m_configuration.Engine.Converge && cacheRate < 1 && m_configuration.Logging.ExecutionLog.IsValid) { Logger.Log.SchedulerDidNotConverge( diff --git a/Public/Src/Engine/Scheduler/Tracing/Log.cs b/Public/Src/Engine/Scheduler/Tracing/Log.cs index 73077e9ab..b47bad8eb 100644 --- a/Public/Src/Engine/Scheduler/Tracing/Log.cs +++ b/Public/Src/Engine/Scheduler/Tracing/Log.cs @@ -1077,6 +1077,15 @@ namespace BuildXL.Scheduler.Tracing Message = EventConstants.PhasePrefix + "Shared cache usage: Downloaded {remoteProcesses} processes [{relativeCacheRate:P} of cache hits] and {contentDownloaded} of outputs.")] internal abstract void IncrementalBuildSharedCacheSavingsSummary(LoggingContext loggingContext, double relativeCacheRate, long remoteProcesses, string contentDownloaded); + [GeneratedEvent( + (ushort)LogEventId.RemoteBuildSavingsSummary, + EventGenerators = EventGenerators.LocalOnly, + EventLevel = Level.Informational, + Keywords = (int)(Keywords.UserMessage), + EventTask = (ushort)Tasks.Scheduler, + Message = EventConstants.PhasePrefix + "Cache misses run remotely: {runRemoteProcesses} of {cacheMisses}.")] + internal abstract void RemoteBuildSavingsSummary(LoggingContext loggingContext, long runRemoteProcesses, long cacheMisses); + [GeneratedEvent( (ushort)LogEventId.SchedulerDidNotConverge, EventGenerators = EventGenerators.LocalOnly, diff --git a/Public/Src/Engine/Scheduler/Tracing/LogEventId.cs b/Public/Src/Engine/Scheduler/Tracing/LogEventId.cs index 269aa8894..9123e3395 100644 --- a/Public/Src/Engine/Scheduler/Tracing/LogEventId.cs +++ b/Public/Src/Engine/Scheduler/Tracing/LogEventId.cs @@ -135,6 +135,7 @@ namespace BuildXL.Scheduler.Tracing IncrementalBuildSharedCacheSavingsSummary = 1513, RemoteCacheHitsGreaterThanTotalCacheHits = 1514, SchedulerDidNotConverge = 1515, + RemoteBuildSavingsSummary = 1516, PipMaterializeDependenciesFailureUnrelatedToCache = 2102,