Beispiel #1
0
 public StatsPerType(string name, BuildXLStats stats)
 {
     Total   = stats.GetValue($"PipStats.{name}_Total");
     Done    = stats.GetValue($"PipStats.{name}_Done");
     Failed  = stats.GetValue($"PipStats.{name}_Failed");
     Skipped = stats.GetValue($"PipStats.{name}_Skipped ");
     Ignored = stats.GetValue($"PipStats.{name}_Ignored");
 }
Beispiel #2
0
        protected BuildXLStats GetStats(string sessionId)
        {
            var invocation = GetInvocation(sessionId);
            var filePath   = Path.Combine(invocation.LogsFolder, LogNamePrefix + ".stats");

            return(Cache.GetOrCreate(
                       "build/" + sessionId + "/stats",
                       newEntry =>
            {
                if (!System.IO.File.Exists(filePath))
                {
                    throw new ExplorerException("Stats file not found");
                }

                if (!BuildXLStats.TryLoadStatsFile(filePath, out var stats))
                {
                    throw new ExplorerException("Error reading stats file");
                }

                newEntry.SlidingExpiration = TimeSpan.FromMinutes(30);
                return stats;
            }
                       ));
        }
Beispiel #3
0
        private BuildState GetState(BuildXLStats stats)
        {
            if (stats.GetBoolean("ErrorWasLogged"))
            {
                return(BuildState.Failed);
            }

            if (stats.GetBoolean("WarningWasLogged"))
            {
                return(BuildState.PassedWithWarnings);
            }

            if (!stats.Contains("TimeToEngineRunCompleteMs"))
            {
                if (stats.Contains("TimeToFirstPipSyntheticMs"))
                {
                    return(BuildState.Runningpips);
                }

                return(BuildState.ConstructingGraph);
            }

            return(BuildState.Passed);
        }
Beispiel #4
0
        public PipStats(BuildXLStats stats)
        {
            ProcessPipCacheHits       = stats.GetValue("ProcessPipCacheHits");
            ProcessPipCacheMisses     = stats.GetValue("ProcessPipCacheMisses");
            ProcessDelayedBySemaphore = stats.GetValue("ProcessDelayedBySemaphore");
            ProcessPipsSkippedDueToFailedDependencies = stats.GetValue("ProcessPipsSkippedDueToFailedDependencies");
            Total = new StatsPerType
            {
                Total   = stats.GetValue("TotalPips"),
                Done    = stats.GetValue("PipsSucceeded"),
                Failed  = stats.GetValue("PipsFailed"),
                Ignored = stats.GetValue("PipsIgnored"),
            };

            Process        = new StatsPerType("Process", stats);
            CopyFile       = new StatsPerType("CopyFile", stats);
            WriteFile      = new StatsPerType("WriteFile", stats);
            SealDirectory  = new StatsPerType("SealDirectory", stats);
            Ipc            = new StatsPerType("Ipc", stats);
            Value          = new StatsPerType("Value", stats);
            SpecFile       = new StatsPerType("SpecFile", stats);
            Module         = new StatsPerType("Module", stats);
            HashSourceFile = new StatsPerType("HashSourceFile", stats);
        }