Ejemplo n.º 1
0
 internal static ClientRunData GetClientRunData(ClientRun clientRun)
 {
    switch (clientRun.Parent.FahLogType)
    {
       case FahLogType.Legacy:
          return GetClientRunDataLegacy(clientRun);
       case FahLogType.FahClient:
          return GetClientRunDataFahClient(clientRun);
    }
    throw new ArgumentException("ClientRun FahLogType unknown", "clientRun");
 }
Ejemplo n.º 2
0
        internal static ClientRunData GetClientRunData(ClientRun clientRun)
        {
            switch (clientRun.Parent.FahLogType)
            {
            case FahLogType.Legacy:
                return(GetClientRunDataLegacy(clientRun));

            case FahLogType.FahClient:
                return(GetClientRunDataFahClient(clientRun));
            }
            throw new ArgumentException("ClientRun FahLogType unknown", "clientRun");
        }
Ejemplo n.º 3
0
      /// <summary>
      /// Aggregate Data and return UnitInfo Dictionary.
      /// </summary>
      public DataAggregatorResult AggregateData(ClientRun clientRun, UnitCollection unitCollection, Info info, Options options,
                                                SlotOptions slotOptions, UnitInfo currentUnitInfo, int slotId)
      {
         if (clientRun == null) throw new ArgumentNullException("clientRun");
         if (unitCollection == null) throw new ArgumentNullException("unitCollection");
         if (options == null) throw new ArgumentNullException("options");
         if (slotOptions == null) throw new ArgumentNullException("slotOptions");
         if (currentUnitInfo == null) throw new ArgumentNullException("currentUnitInfo");

         var result = new DataAggregatorResult();
         result.CurrentUnitIndex = -1;

         SlotRun slotRun = null;
         if (clientRun.SlotRuns.ContainsKey(slotId))
         {
            slotRun = clientRun.SlotRuns[slotId];
         }
         result.StartTime = clientRun.Data.StartTime;
         result.Arguments = clientRun.Data.Arguments;
         result.ClientVersion = clientRun.Data.ClientVersion;
         result.UserID = clientRun.Data.UserID;
         result.MachineID = clientRun.Data.MachineID;
         result.Status = slotRun != null ? slotRun.Data.Status : SlotStatus.Unknown;

         if (Logger.IsDebugEnabled)
         {
            foreach (var s in clientRun.Where(x => x.LineType == LogLineType.Error))
            {
               Logger.DebugFormat(Constants.ClientNameFormat, ClientName, String.Format("Failed to parse log line: {0}", s));
            }
         }

         GenerateUnitInfoDataFromQueue(result, slotRun, unitCollection, options, slotOptions, currentUnitInfo, slotId);
         result.Queue = BuildClientQueue(unitCollection, info, slotOptions, slotId);

         if (result.UnitInfos.ContainsKey(result.CurrentUnitIndex) && result.UnitInfos[result.CurrentUnitIndex].LogLines != null)
         {
            result.CurrentLogLines = result.UnitInfos[result.CurrentUnitIndex].LogLines;
         }
         else if (slotRun != null)
         {
            result.CurrentLogLines = slotRun.ToList();
         }
         else
         {
            result.CurrentLogLines = clientRun.ToList();
         }

         return result;
      }
Ejemplo n.º 4
0
        internal static void AreEqual(ClientRun expectedRun, ClientRun actualRun, bool assertUnitRunData = false)
        {
            Assert.AreEqual(expectedRun.ClientStartIndex, actualRun.ClientStartIndex);
            Assert.AreEqual(expectedRun.Data.StartTime, actualRun.Data.StartTime);

            Assert.AreEqual(expectedRun.SlotRuns.Count, actualRun.SlotRuns.Count);
            foreach (int slotRunKey in expectedRun.SlotRuns.Keys)
            {
                var expectedSlotRun = expectedRun.SlotRuns[slotRunKey];
                var actualSlotRun   = actualRun.SlotRuns[slotRunKey];
                Assert.AreEqual(expectedSlotRun.Data.CompletedUnits, actualSlotRun.Data.CompletedUnits);
                Assert.AreEqual(expectedSlotRun.Data.FailedUnits, actualSlotRun.Data.FailedUnits);

                Assert.AreEqual(expectedSlotRun.UnitRuns.Count, actualSlotRun.UnitRuns.Count);
                for (int i = 0; i < expectedSlotRun.UnitRuns.Count; i++)
                {
                    var expectedUnitRun = expectedSlotRun.UnitRuns.ElementAt(i);
                    var actualUnitRun   = actualSlotRun.UnitRuns.ElementAt(i);
                    Assert.AreEqual(expectedUnitRun.QueueIndex, actualUnitRun.QueueIndex);
                    Assert.AreEqual(expectedUnitRun.StartIndex, actualUnitRun.StartIndex);
                    Assert.AreEqual(expectedUnitRun.EndIndex, actualUnitRun.EndIndex);
                    if (assertUnitRunData)
                    {
                        Assert.AreEqual(expectedUnitRun.Data.UnitStartTimeStamp, actualUnitRun.Data.UnitStartTimeStamp);
                        Assert.AreEqual(expectedUnitRun.Data.CoreVersion, actualUnitRun.Data.CoreVersion);
                        Assert.AreEqual(expectedUnitRun.Data.FramesObserved, actualUnitRun.Data.FramesObserved);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectID, actualUnitRun.Data.ProjectID);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectRun, actualUnitRun.Data.ProjectRun);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectClone, actualUnitRun.Data.ProjectClone);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectGen, actualUnitRun.Data.ProjectGen);
                        Assert.AreEqual(expectedUnitRun.Data.WorkUnitResult, actualUnitRun.Data.WorkUnitResult);
                        if (expectedUnitRun.Data.Frames != null && actualUnitRun.Data.Frames != null)
                        {
                            Assert.AreEqual(expectedUnitRun.Data.Frames.Count, actualUnitRun.Data.Frames.Count);
                            foreach (int frameDataKey in expectedUnitRun.Data.Frames.Keys)
                            {
                                var expectedFrames = expectedUnitRun.Data.Frames[frameDataKey];
                                var actualFrames   = actualUnitRun.Data.Frames[frameDataKey];
                                Assert.AreEqual(expectedFrames.ID, actualFrames.ID);
                                Assert.AreEqual(expectedFrames.RawFramesComplete, actualFrames.RawFramesComplete);
                                Assert.AreEqual(expectedFrames.RawFramesTotal, actualFrames.RawFramesTotal);
                                Assert.AreEqual(expectedFrames.TimeStamp, actualFrames.TimeStamp);
                                Assert.AreEqual(expectedFrames.Duration, actualFrames.Duration);
                            }
                        }
                    }
                }
            }
        }
            protected override ClientRunData OnGetClientRunData(ClientRun clientRun)
            {
                var baseData   = base.OnGetClientRunData(clientRun);
                var customData = new CustomClientRunData(baseData);

                customData.StartTime        = baseData.StartTime;
                customData.UniqueProjectIDs =
                    clientRun.SlotRuns
                    .Select(x => x.Value)
                    .SelectMany(x => x.UnitRuns)
                    .Select(x => x.Data.ProjectID)
                    .Distinct()
                    .ToList();
                return(customData);
            }
Ejemplo n.º 6
0
        private static ClientRunData GetClientRunDataFahClient(ClientRun clientRun)
        {
            var clientRunData = new ClientRunData();

            foreach (var line in clientRun.LogLines)
            {
                switch (line.LineType)
                {
                case LogLineType.LogOpen:
                    clientRunData.StartTime = (DateTime)line.LineData;
                    break;
                }
            }

            return(clientRunData);
        }
Ejemplo n.º 7
0
      private static ClientRunData GetClientRunDataFahClient(ClientRun clientRun)
      {
         var clientRunData = new ClientRunData();

         foreach (var line in clientRun.LogLines)
         {
            switch (line.LineType)
            {
               case LogLineType.LogOpen:
                  clientRunData.StartTime = (DateTime)line.LineData;
                  break;
            }
         }

         return clientRunData;
      }
        /// <summary>
        /// Creates a new <see cref="ClientRunData"/> object from the information contained in the <see cref="ClientRun"/> object.
        /// </summary>
        protected override ClientRunData OnGetClientRunData(ClientRun clientRun)
        {
            var clientRunData = new FahClientClientRunData();

            int count = clientRun.LogLines.Count;

            for (int i = 0; i < count; i++)
            {
                var line = clientRun.LogLines[i];
                switch (line.LineType)
                {
                case LogLineType.LogOpen:
                    clientRunData.StartTime = (DateTime)line.Data;
                    break;
                }
            }

            return(clientRunData);
        }
Ejemplo n.º 9
0
        internal static void AreEqual(ClientRun expectedRun, ClientRun actualRun, bool assertUnitRunData = false)
        {
            Assert.AreEqual(expectedRun.ClientStartIndex, actualRun.ClientStartIndex);
            Assert.AreEqual(expectedRun.Data.StartTime, actualRun.Data.StartTime);
            Assert.AreEqual(expectedRun.Data.Arguments, actualRun.Data.Arguments);
            Assert.AreEqual(expectedRun.Data.ClientVersion, actualRun.Data.ClientVersion);
            Assert.AreEqual(expectedRun.Data.FoldingID, actualRun.Data.FoldingID);
            Assert.AreEqual(expectedRun.Data.Team, actualRun.Data.Team);
            Assert.AreEqual(expectedRun.Data.UserID, actualRun.Data.UserID);
            Assert.AreEqual(expectedRun.Data.MachineID, actualRun.Data.MachineID);

            Assert.AreEqual(expectedRun.SlotRuns.Count, actualRun.SlotRuns.Count);
            foreach (int key in expectedRun.SlotRuns.Keys)
            {
                var expectedSlotRun = expectedRun.SlotRuns[key];
                var actualSlotRun   = actualRun.SlotRuns[key];
                Assert.AreEqual(expectedSlotRun.Data.CompletedUnits, actualSlotRun.Data.CompletedUnits);
                Assert.AreEqual(expectedSlotRun.Data.FailedUnits, actualSlotRun.Data.FailedUnits);
                Assert.AreEqual(expectedSlotRun.Data.TotalCompletedUnits, actualSlotRun.Data.TotalCompletedUnits);
                Assert.AreEqual(expectedSlotRun.Data.Status, actualSlotRun.Data.Status);

                Assert.AreEqual(expectedSlotRun.UnitRuns.Count, actualSlotRun.UnitRuns.Count);
                for (int i = 0; i < expectedSlotRun.UnitRuns.Count; i++)
                {
                    var expectedUnitRun = expectedSlotRun.UnitRuns.ElementAt(i);
                    var actualUnitRun   = actualSlotRun.UnitRuns.ElementAt(i);
                    Assert.AreEqual(expectedUnitRun.QueueIndex, actualUnitRun.QueueIndex);
                    Assert.AreEqual(expectedUnitRun.StartIndex, actualUnitRun.StartIndex);
                    Assert.AreEqual(expectedUnitRun.EndIndex, actualUnitRun.EndIndex);
                    if (assertUnitRunData)
                    {
                        Assert.AreEqual(expectedUnitRun.Data.UnitStartTimeStamp, actualUnitRun.Data.UnitStartTimeStamp);
                        Assert.AreEqual(expectedUnitRun.Data.CoreVersion, actualUnitRun.Data.CoreVersion);
                        Assert.AreEqual(expectedUnitRun.Data.FramesObserved, actualUnitRun.Data.FramesObserved);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectID, actualUnitRun.Data.ProjectID);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectRun, actualUnitRun.Data.ProjectRun);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectClone, actualUnitRun.Data.ProjectClone);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectGen, actualUnitRun.Data.ProjectGen);
                        Assert.AreEqual(expectedUnitRun.Data.WorkUnitResult, actualUnitRun.Data.WorkUnitResult);
                    }
                }
            }
        }
Ejemplo n.º 10
0
      internal static void AreEqual(ClientRun expectedRun, ClientRun actualRun, bool assertUnitRunData = false)
      {
         Assert.AreEqual(expectedRun.ClientStartIndex, actualRun.ClientStartIndex);
         Assert.AreEqual(expectedRun.Data.StartTime, actualRun.Data.StartTime);
         Assert.AreEqual(expectedRun.Data.Arguments, actualRun.Data.Arguments);
         Assert.AreEqual(expectedRun.Data.ClientVersion, actualRun.Data.ClientVersion);
         Assert.AreEqual(expectedRun.Data.FoldingID, actualRun.Data.FoldingID);
         Assert.AreEqual(expectedRun.Data.Team, actualRun.Data.Team);
         Assert.AreEqual(expectedRun.Data.UserID, actualRun.Data.UserID);
         Assert.AreEqual(expectedRun.Data.MachineID, actualRun.Data.MachineID);

         Assert.AreEqual(expectedRun.SlotRuns.Count, actualRun.SlotRuns.Count);
         foreach (int key in expectedRun.SlotRuns.Keys)
         {
            var expectedSlotRun = expectedRun.SlotRuns[key];
            var actualSlotRun = actualRun.SlotRuns[key];
            Assert.AreEqual(expectedSlotRun.Data.CompletedUnits, actualSlotRun.Data.CompletedUnits);
            Assert.AreEqual(expectedSlotRun.Data.FailedUnits, actualSlotRun.Data.FailedUnits);
            Assert.AreEqual(expectedSlotRun.Data.TotalCompletedUnits, actualSlotRun.Data.TotalCompletedUnits);
            Assert.AreEqual(expectedSlotRun.Data.Status, actualSlotRun.Data.Status);

            Assert.AreEqual(expectedSlotRun.UnitRuns.Count, actualSlotRun.UnitRuns.Count);
            for (int i = 0; i < expectedSlotRun.UnitRuns.Count; i++)
            {
               var expectedUnitRun = expectedSlotRun.UnitRuns.ElementAt(i);
               var actualUnitRun = actualSlotRun.UnitRuns.ElementAt(i);
               Assert.AreEqual(expectedUnitRun.QueueIndex, actualUnitRun.QueueIndex);
               Assert.AreEqual(expectedUnitRun.StartIndex, actualUnitRun.StartIndex);
               Assert.AreEqual(expectedUnitRun.EndIndex, actualUnitRun.EndIndex);
               if (assertUnitRunData)
               {
                  Assert.AreEqual(expectedUnitRun.Data.UnitStartTimeStamp, actualUnitRun.Data.UnitStartTimeStamp);
                  Assert.AreEqual(expectedUnitRun.Data.CoreVersion, actualUnitRun.Data.CoreVersion);
                  Assert.AreEqual(expectedUnitRun.Data.FramesObserved, actualUnitRun.Data.FramesObserved);
                  Assert.AreEqual(expectedUnitRun.Data.ProjectID, actualUnitRun.Data.ProjectID);
                  Assert.AreEqual(expectedUnitRun.Data.ProjectRun, actualUnitRun.Data.ProjectRun);
                  Assert.AreEqual(expectedUnitRun.Data.ProjectClone, actualUnitRun.Data.ProjectClone);
                  Assert.AreEqual(expectedUnitRun.Data.ProjectGen, actualUnitRun.Data.ProjectGen);
                  Assert.AreEqual(expectedUnitRun.Data.WorkUnitResult, actualUnitRun.Data.WorkUnitResult);
               }
            }
         }
      }
Ejemplo n.º 11
0
      private static ClientRunData GetClientRunDataLegacy(ClientRun clientRun)
      {
         var clientRunData = new ClientRunData();

         foreach (var line in clientRun.LogLines)
         {
            if (line.LineType == LogLineType.LogOpen)
            {
               clientRunData.StartTime = (DateTime)line.LineData;
            }
            else if (line.LineType == LogLineType.ClientVersion)
            {
               clientRunData.ClientVersion = line.LineData.ToString();
            }
            else if (line.LineType == LogLineType.ClientArguments)
            {
               clientRunData.Arguments = line.LineData.ToString();
            }
            else if (line.LineType == LogLineType.ClientUserNameTeam)
            {
               var userAndTeam = (Tuple<string, int>)line.LineData;
               clientRunData.FoldingID = userAndTeam.Item1;
               clientRunData.Team = userAndTeam.Item2;
            }
            else if (line.LineType == LogLineType.ClientUserID ||
                     line.LineType == LogLineType.ClientReceivedUserID)
            {
               clientRunData.UserID = line.LineData.ToString();
            }
            else if (line.LineType == LogLineType.ClientMachineID)
            {
               clientRunData.MachineID = (int)line.LineData;
            }
         }

         return clientRunData;
      }
Ejemplo n.º 12
0
        private static ClientRunData GetClientRunDataLegacy(ClientRun clientRun)
        {
            var clientRunData = new ClientRunData();

            foreach (var line in clientRun.LogLines)
            {
                if (line.LineType == LogLineType.LogOpen)
                {
                    clientRunData.StartTime = (DateTime)line.LineData;
                }
                else if (line.LineType == LogLineType.ClientVersion)
                {
                    clientRunData.ClientVersion = line.LineData.ToString();
                }
                else if (line.LineType == LogLineType.ClientArguments)
                {
                    clientRunData.Arguments = line.LineData.ToString();
                }
                else if (line.LineType == LogLineType.ClientUserNameTeam)
                {
                    var userAndTeam = (Tuple <string, int>)line.LineData;
                    clientRunData.FoldingID = userAndTeam.Item1;
                    clientRunData.Team      = userAndTeam.Item2;
                }
                else if (line.LineType == LogLineType.ClientUserID ||
                         line.LineType == LogLineType.ClientReceivedUserID)
                {
                    clientRunData.UserID = line.LineData.ToString();
                }
                else if (line.LineType == LogLineType.ClientMachineID)
                {
                    clientRunData.MachineID = (int)line.LineData;
                }
            }

            return(clientRunData);
        }
Ejemplo n.º 13
0
      public void LegacyLog_Read_Standard_5_Test() // verbosity 9
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\Standard_5\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 3 Positions
         var expectedRun = new ClientRun(null, 788);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 820, 926));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 3, 24, 0, 28, 52, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-oneunit -forceasm -verbosity 9";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "borden.b";
         expectedRun.Data.Team = 131;
         expectedRun.Data.UserID = "722723950C6887C2";
         expectedRun.Data.MachineID = 3;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 0;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = null;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.ElementAt(1);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Check Run 4 Positions
         expectedRun = new ClientRun(null, 927);
         expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 961, 1014));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 3, 24, 0, 41, 07, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-forceasm -verbosity 9 -oneunit";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "borden.b";
         expectedRun.Data.Team = 131;
         expectedRun.Data.UserID = "722723950C6887C2";
         expectedRun.Data.MachineID = 3;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 0;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = null;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.AreEqual(1, actualRun.SlotRuns[0].UnitRuns.Count); // no previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(4, unitRun.LogLines[6].LineData);
         Assert.AreEqual(23f, unitRun.LogLines[17].LineData);
         Assert.That(unitRun.LogLines[2].ToString().Contains("Project: 6501 (Run 13, Clone 0, Gen 0)"));
         Assert.That(unitRun.LogLines[10].ToString().Contains("Project: 6501 (Run 15, Clone 0, Gen 0)"));
         Assert.That(unitRun.LogLines[45].ToString().Contains("Project: 10002 (Run 19, Clone 0, Gen 51)"));

         unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(new TimeSpan(0, 41, 7), unitRun.Data.UnitStartTimeStamp);
         //Assert.AreEqual(5, unitRun.Data.FrameDataList.Count);
         Assert.AreEqual(5, unitRun.Data.FramesObserved);
         Assert.AreEqual(23f, unitRun.Data.CoreVersion);
         Assert.AreEqual(null, unitRun.Data.ProjectInfoIndex);
         Assert.AreEqual(3, unitRun.Data.ProjectInfoList.Count);
         Assert.AreEqual(10002, unitRun.Data.ProjectID);
         Assert.AreEqual(19, unitRun.Data.ProjectRun);
         Assert.AreEqual(0, unitRun.Data.ProjectClone);
         Assert.AreEqual(51, unitRun.Data.ProjectGen);
         Assert.AreEqual(unitRun.Data.ProjectID, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectID);
         Assert.AreEqual(unitRun.Data.ProjectRun, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectRun);
         Assert.AreEqual(unitRun.Data.ProjectClone, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectClone);
         Assert.AreEqual(unitRun.Data.ProjectGen, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectGen);
         Assert.AreEqual(WorkUnitResult.Unknown, unitRun.Data.WorkUnitResult);
      }
Ejemplo n.º 14
0
      public void LegacyLog_Read_Standard_6_Test() // verbosity normal / Gromacs 3.3
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\Standard_6\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 27, 293));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 294, 553));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 554, 813));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 814, 1073));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 1074, 1337));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 1338, 1601));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 1602, 1869));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 1870, 2129));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 2130, 2323));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 3, 10, 15, 48, 32, DateTimeKind.Utc);
         expectedRun.Data.Arguments = null;
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "DrSpalding";
         expectedRun.Data.Team = 48083;
         expectedRun.Data.UserID = "1E19BD450434A6ED";
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 8;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 229;
         expectedSlotRun.Data.Status = SlotStatus.Paused;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - Current UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(7, unitRun.LogLines[3].LineData);
         Assert.AreEqual(1.90f, unitRun.LogLines[8].LineData);
         Assert.That(unitRun.LogLines[17].ToString().Contains("Project: 4461 (Run 886, Clone 3, Gen 56)"));

         // Special Check to be sure the reader is catching the Pause For Battery line
         Assert.AreEqual(LogLineType.WorkUnitPausedForBattery, unitRun.LogLines[193].LineType);
      }
Ejemplo n.º 15
0
      public void LegacyLog_Read_GPU3_2_Test() // verbosity 9 / OPENMMGPU v2.19
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\GPU3_2\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 27, 169));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 170, 218));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 2, 17, 17, 19, 31, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-gpu 0 -verbosity 9 -local -verbosity 9";
         expectedRun.Data.ClientVersion = "6.41r2";
         expectedRun.Data.FoldingID = "HayesK";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "37114EB5198643C1";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 847;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(3, unitRun.LogLines[7].LineData);
         Assert.AreEqual(2.19f, unitRun.LogLines[14].LineData);
         Assert.That(unitRun.LogLines[29].ToString().Contains("Project: 10634 (Run 11, Clone 24, Gen 14)"));

         unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(new TimeSpan(17, 31, 22), unitRun.Data.UnitStartTimeStamp);
         //Assert.AreEqual(12, unitRun.Data.FrameDataList.Count);
         Assert.AreEqual(12, unitRun.Data.FramesObserved);
         Assert.AreEqual(2.19f, unitRun.Data.CoreVersion);
         Assert.AreEqual(null, unitRun.Data.ProjectInfoIndex);
         Assert.AreEqual(1, unitRun.Data.ProjectInfoList.Count);
         Assert.AreEqual(10634, unitRun.Data.ProjectID);
         Assert.AreEqual(8, unitRun.Data.ProjectRun);
         Assert.AreEqual(24, unitRun.Data.ProjectClone);
         Assert.AreEqual(24, unitRun.Data.ProjectGen);
         Assert.AreEqual(unitRun.Data.ProjectID, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectID);
         Assert.AreEqual(unitRun.Data.ProjectRun, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectRun);
         Assert.AreEqual(unitRun.Data.ProjectClone, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectClone);
         Assert.AreEqual(unitRun.Data.ProjectGen, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectGen);
         Assert.AreEqual(WorkUnitResult.Unknown, unitRun.Data.WorkUnitResult);
      }
Ejemplo n.º 16
0
      public void LegacyLog_Read_Standard_1_Test() // verbosity 9
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\Standard_1\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 18, 2, 15, 30, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-configonly";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "4E34332601E26450";
         expectedRun.Data.MachineID = 5;
         expectedSlotRun.Data = new SlotRunData();

         var actualRun = fahLog.ClientRuns.ElementAt(2);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Check Run 1 Positions
         expectedRun = new ClientRun(null, 30);
         expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 179, 592));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 593, 838));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 18, 2, 17, 46, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-verbosity 9 -forceasm";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "4E34332601E26450";
         expectedRun.Data.MachineID = 5;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = null; // TODO: not capturing line "+ Starting local stats count at 1"
         expectedSlotRun.Data.Status = SlotStatus.Stopped;

         actualRun = fahLog.ClientRuns.ElementAt(1);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Check Run 2 Positions
         expectedRun = new ClientRun(null, 839);
         expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 874, 951));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 20, 4, 17, 29, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-verbosity 9 -forceasm -oneunit";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "4E34332601E26450";
         expectedRun.Data.MachineID = 5;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 2;
         expectedSlotRun.Data.Status = SlotStatus.Stopped;

         actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.AreEqual(1, actualRun.SlotRuns[0].UnitRuns.Count); // no previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (ClientRun 1 - First UnitRun)
         var unitRun = fahLog.ClientRuns.ElementAt(1).SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(1, unitRun.LogLines[3].LineData);
         Assert.AreEqual(1.90f, unitRun.LogLines[10].LineData);
         Assert.That(unitRun.LogLines[18].ToString().Contains("Project: 4456 (Run 173, Clone 0, Gen 31)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[254].LineData);
      }
Ejemplo n.º 17
0
 /// <summary>
 /// Creates a new <see cref="ClientRunData"/> object from the information contained in the <see cref="ClientRun"/> object.
 /// </summary>
 protected abstract ClientRunData OnGetClientRunData(ClientRun clientRun);
Ejemplo n.º 18
0
      public void LegacyLog_Read_GPU2_7_Test() // verbosity (normal) / Project String After "+ Processing work unit"
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\GPU2_7\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 0);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 24, 82));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 1, 31, 1, 57, 21, DateTimeKind.Utc);
         expectedRun.Data.Arguments = null;
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "Zagen30";
         expectedRun.Data.Team = 46301;
         expectedRun.Data.UserID = "xxxxxxxxxxxxxxxxxxx";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 0;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 1994;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.AreEqual(1, actualRun.SlotRuns[0].UnitRuns.Count); // no previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(0, unitRun.LogLines[4].LineData);
         Assert.AreEqual(1.31f, unitRun.LogLines[13].LineData);
         Assert.That(unitRun.LogLines[26].ToString().Contains("Project: 5781 (Run 2, Clone 700, Gen 2)"));

         unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(new TimeSpan(1, 57, 21), unitRun.Data.UnitStartTimeStamp);
         //Assert.AreEqual(5, unitRun.Data.FrameDataList.Count);
         Assert.AreEqual(5, unitRun.Data.FramesObserved);
         Assert.AreEqual(1.31f, unitRun.Data.CoreVersion);
         Assert.AreEqual(null, unitRun.Data.ProjectInfoIndex);
         Assert.AreEqual(2, unitRun.Data.ProjectInfoList.Count);
         Assert.AreEqual(5781, unitRun.Data.ProjectID);
         Assert.AreEqual(2, unitRun.Data.ProjectRun);
         Assert.AreEqual(700, unitRun.Data.ProjectClone);
         Assert.AreEqual(2, unitRun.Data.ProjectGen);
         Assert.AreEqual(unitRun.Data.ProjectID, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectID);
         Assert.AreEqual(unitRun.Data.ProjectRun, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectRun);
         Assert.AreEqual(unitRun.Data.ProjectClone, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectClone);
         Assert.AreEqual(unitRun.Data.ProjectGen, unitRun.Data.ProjectInfoList[unitRun.Data.ProjectInfoList.Count - 1].ProjectGen);
         Assert.AreEqual(WorkUnitResult.Unknown, unitRun.Data.WorkUnitResult);
      }
Ejemplo n.º 19
0
        private static void PopulateUnitInfoFromLogs(ClientRun currentClientRun, FahLogUnitData fahLogUnitData, 
            UnitInfoLogData unitInfoLogData, UnitInfo unit)
        {
            Debug.Assert(currentClientRun != null);
             Debug.Assert(fahLogUnitData != null);
             // unitInfoLogData can be null
             Debug.Assert(unit != null);

             /* Project (R/C/G) (Could have already been read through Queue) */
             if (unit.ProjectIsUnknown())
             {
            unit.ProjectID = fahLogUnitData.ProjectID;
            unit.ProjectRun = fahLogUnitData.ProjectRun;
            unit.ProjectClone = fahLogUnitData.ProjectClone;
            unit.ProjectGen = fahLogUnitData.ProjectGen;
             }

             if (fahLogUnitData.Threads > 1)
             {
            unit.SlotType = SlotType.CPU;
             }

             if (unitInfoLogData != null)
             {
            unit.ProteinName = unitInfoLogData.ProteinName;

            /* Tag (Could have already been read through Queue) */
            if (unit.ProteinTag.Length == 0)
            {
               unit.ProteinTag = unitInfoLogData.ProteinTag;
            }

            /* DownloadTime (Could have already been read through Queue) */
            if (unit.DownloadTime.IsUnknown())
            {
               unit.DownloadTime = unitInfoLogData.DownloadTime;
            }

            /* DueTime (Could have already been read through Queue) */
            if (unit.DueTime.IsUnknown())
            {
               unit.DueTime = unitInfoLogData.DueTime;
            }

            /* FinishedTime (Not available in unitinfo log) */

            /* Project (R/C/G) (Could have already been read through Queue) */
            if (unit.ProjectIsUnknown())
            {
               unit.ProjectID = unitInfoLogData.ProjectID;
               unit.ProjectRun = unitInfoLogData.ProjectRun;
               unit.ProjectClone = unitInfoLogData.ProjectClone;
               unit.ProjectGen = unitInfoLogData.ProjectGen;
            }
             }

             /* FoldingID and Team from Last Client Run (Could have already been read through Queue) */
             if (unit.FoldingID.Equals(Constants.DefaultFoldingID) &&
            !String.IsNullOrEmpty(currentClientRun.FoldingID))
             {
            unit.FoldingID = currentClientRun.FoldingID;
             }
             if (unit.Team == Constants.DefaultTeam)
             {
            unit.Team = currentClientRun.Team;
             }

             // Possibly check the currentClientRun from the log file.
             // The queue will have the ID and Team that was set when the work unit was received.
             //if (unit.FoldingID.Equals(Default.FoldingID) ||
             //   !unit.FoldingID.Equals(currentClientRun.FoldingID))
             //{
             //   unit.FoldingID = currentClientRun.FoldingID;
             //}
             //if (unit.Team == Default.Team ||
             //    unit.Team != currentClientRun.Team)
             //{
             //   unit.Team = currentClientRun.Team;
             //}
        }
Ejemplo n.º 20
0
      private static UnitInfo BuildUnitInfo(QueueEntry queueEntry, ClientRun clientRun, UnitRun unitRun, UnitInfoLogData unitInfoLogData, bool matchOverride = false)
      {
         // queueEntry can be null
         Debug.Assert(clientRun != null);
         // unitInfoLogData can be null

         var unit = new UnitInfo();

         UnitRunData unitRunData;
         if (unitRun == null)
         {
            if (matchOverride)
            {
               unitRunData = new UnitRunData();
            }
            else
            {
               return null;
            }
         }
         else
         {
            unit.LogLines = unitRun.ToList();
            unitRunData = unitRun.Data;
         }
         unit.UnitStartTimeStamp = unitRunData.UnitStartTimeStamp ?? TimeSpan.MinValue;
         unit.FramesObserved = unitRunData.FramesObserved;
         unit.CoreVersion = unitRunData.CoreVersion;
         unit.UnitResult = unitRunData.WorkUnitResult;

         if (queueEntry != null)
         {
            UpdateUnitInfoFromQueueData(unit, queueEntry);
            SearchFahLogUnitDataProjects(unit, unitRunData);
            UpdateUnitInfoFromLogData(unit, clientRun.Data, unitRunData, unitInfoLogData);

            if (!ProjectsMatch(unit, unitRunData) && !ProjectsMatch(unit, unitInfoLogData) && !matchOverride)
            {
               return null;
            }
         }
         else
         {
            UpdateUnitInfoFromLogData(unit, clientRun.Data, unitRunData, unitInfoLogData);
         }

         return unit;
      }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SlotRun"/> class.
 /// </summary>
 /// <param name="parent">The parent <see cref="ClientRun"/> object.</param>
 /// <param name="foldingSlot">The folding slot number.</param>
 public SlotRun(ClientRun parent, int foldingSlot)
 {
     Parent      = parent;
     FoldingSlot = foldingSlot;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Creates and returns a <see cref="LogLineEnumerable"/> from an <see cref="ClientRun"/> source.
 /// </summary>
 /// <param name="source">The enumeration source.</param>
 /// <returns>A <see cref="LogLineEnumerable"/> from an <see cref="ClientRun"/> source.</returns>
 public static LogLineEnumerable Create(ClientRun source)
 {
     return(new ClientRunLogLineEnumerable(source));
 }
Ejemplo n.º 23
0
      public void LegacyLog_Read_SMP_1_Test() // verbosity 9
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\SMP_1\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 30, 149));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 150, 273));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 7, 30, 0, 40, 27, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-smp -verbosity 9";
         expectedRun.Data.ClientVersion = "6.24beta";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "5131EA752EB60547";
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 261;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.ElementAt(1);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Check Run 1 Positions
         expectedRun = new ClientRun(null, 274);
         expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 302, 401));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 402, 752));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 7, 31, 0, 7, 43, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-smp -verbosity 9";
         expectedRun.Data.ClientVersion = "6.24beta";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "5131EA752EB60547";
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 2;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 263;
         expectedSlotRun.Data.Status = SlotStatus.GettingWorkPacket;

         actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (First ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Last().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(5, unitRun.LogLines[3].LineData);
         Assert.AreEqual(2.08f, unitRun.LogLines[10].LineData);
         Assert.That(unitRun.LogLines[21].ToString().Contains("Project: 2677 (Run 10, Clone 29, Gen 28)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[79].LineData);
      }
Ejemplo n.º 24
0
      public void LegacyLog_Read_SMP_10_Test() // -smp 8 -bigadv verbosity 9 / Corrupted Log Section in Client Run Index 5
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\SMP_10\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 5 Positions
         var expectedRun = new ClientRun(null, 401);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, -1, 426, 449));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 12, 11, 13, 20, 57, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-configonly";
         expectedRun.Data.ClientVersion = "6.24R3";
         expectedRun.Data.FoldingID = "sneakysnowman";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "5D2DCEF06CE524B3";
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 0;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = null;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.ElementAt(4);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         actualRun = fahLog.ClientRuns.Peek();
         Assert.AreEqual(1, actualRun.SlotRuns[0].UnitRuns.Count); // no previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (ClientRun 8 - First UnitRun)
         var unitRun = fahLog.ClientRuns.ElementAt(1).SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(6, unitRun.LogLines[3].LineData);
         Assert.AreEqual(2.10f, unitRun.LogLines[10].LineData);
         Assert.That(unitRun.LogLines[21].ToString().Contains("Project: 2683 (Run 4, Clone 11, Gen 18)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[53].LineData);
      }
Ejemplo n.º 25
0
      public void LegacyLog_Read_SMP_3_Test() // verbosity (normal) / Handles Core Download on Startup / notfred's instance
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\SMP_3\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 231, 384));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 385, 408));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 25, 18, 11, 37, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-local -forceasm -smp 4";
         expectedRun.Data.ClientVersion = "6.02";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         // verbosity (normal) does not output User ID after requested from server
         // see ClientLogLines indexes 29 & 30
         expectedRun.Data.UserID = null;
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = null; // TODO: not capturing line "+ Starting local stats count at 1"
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(1, unitRun.LogLines[3].LineData);
         Assert.AreEqual(2.08f, unitRun.LogLines[8].LineData);
         Assert.That(unitRun.LogLines[15].ToString().Contains("Project: 2677 (Run 4, Clone 60, Gen 40)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[137].LineData);
      }
Ejemplo n.º 26
0
      public void LegacyLog_Read_SMP_2_Test() // verbosity 9
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\SMP_2\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 30, 220));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 221, 382));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 18, 2, 40, 5, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-smp -verbosity 9";
         expectedRun.Data.ClientVersion = "6.24beta";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "3A49EBB303C19834";
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 2;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 292;
         expectedSlotRun.Data.Status = SlotStatus.SendingWorkPacket;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(1, unitRun.LogLines[3].LineData);
         Assert.AreEqual(2.08f, unitRun.LogLines[10].LineData);
         Assert.That(unitRun.LogLines[17].ToString().Contains("Project: 2677 (Run 10, Clone 49, Gen 38)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[150].LineData);

         // Special Check to be sure the reader is catching the Attempting To Send line (Current ClientRun - Last Unit)
         unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(LogLineType.ClientSendStart, unitRun.LogLines[158].LineType);
      }
Ejemplo n.º 27
0
        private static void PopulateRunLevelData(ClientRun run, Info info, SlotModel slotModel)
        {
            Debug.Assert(slotModel != null);

             if (info != null)
             {
            slotModel.ClientVersion = info.Build.Version;
             }
             if (run != null)
             {
            slotModel.TotalRunCompletedUnits = run.CompletedUnits;
            slotModel.TotalRunFailedUnits = run.FailedUnits;
             }
        }
Ejemplo n.º 28
0
      public void LegacyLog_Read_Standard_9_Test() // v6.23 A4 Uniprocessor
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\Standard_9\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 0);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 24, 276));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 3, 16, 18, 46, 15, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-oneunit -verbosity 9";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "Amaruk";
         expectedRun.Data.Team = 50625;
         expectedRun.Data.UserID = "1E53CB2Axxxxxxxx";
         expectedRun.Data.MachineID = 14;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 173;
         expectedSlotRun.Data.Status = SlotStatus.Stopped;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.AreEqual(1, actualRun.SlotRuns[0].UnitRuns.Count); // no previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (First ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Last().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(5, unitRun.LogLines[7].LineData);
         Assert.AreEqual(2.27f, unitRun.LogLines[14].LineData);
         Assert.That(unitRun.LogLines[23].ToString().Contains("Project: 10741 (Run 0, Clone 1996, Gen 3)"));
      }
Ejemplo n.º 29
0
 public ClientRunLogLineEnumerable(ClientRun source)
 {
     _source = source ?? throw new ArgumentNullException(nameof(source));
 }
Ejemplo n.º 30
0
        /// <summary>
        /// Aggregate Data and return UnitInfo List
        /// </summary>
        public IList<UnitInfo> AggregateData()
        {
            var logLines = LogReader.GetLogLines(FahLogFilePath);
             _logInterpreterLegacy = new LogInterpreterLegacy(logLines, LogReader.GetClientRuns(logLines));
             _currentClientRun = _logInterpreterLegacy.CurrentClientRun;
             _currentClientRunLogLines = _logInterpreterLegacy.CurrentClientRunLogLines;

             // report errors that came back from log parsing
             foreach (var s in _logInterpreterLegacy.LogLineParsingErrors)
             {
            _logger.Debug(Constants.ClientNameFormat, ClientName, s);
             }

             IList<UnitInfo> parsedUnits;
             // Decision Time: If Queue Read fails parse from logs only
             QueueData qData = ReadQueueFile();
             if (qData != null)
             {
            parsedUnits = GenerateUnitInfoDataFromQueue(qData);
            _clientQueue = BuildClientQueue(qData);
             }
             else
             {
            _logger.Warn(Constants.ClientNameFormat, ClientName,
               "Queue unavailable or failed read.  Parsing logs without queue.");

            parsedUnits = GenerateUnitInfoDataFromLogs();
            _clientQueue = null;
             }

             _logInterpreterLegacy = null;

             return parsedUnits;
        }
Ejemplo n.º 31
0
        private static void PopulateRunLevelData(ClientRun run, SlotModel slotModel)
        {
            slotModel.Arguments = run.Arguments;
             slotModel.ClientVersion = run.ClientVersion;

             slotModel.UserId = run.UserID;
             slotModel.MachineId = run.MachineID;

             slotModel.TotalRunCompletedUnits = run.CompletedUnits;
             slotModel.TotalRunFailedUnits = run.FailedUnits;
             slotModel.TotalCompletedUnits = run.TotalCompletedUnits;
        }
Ejemplo n.º 32
0
 /// <summary>
 /// Creates a new <see cref="ClientRunData"/> object from the information contained in the <see cref="ClientRun"/> object.
 /// </summary>
 public ClientRunData GetClientRunData(ClientRun clientRun)
 {
     return(OnGetClientRunData(clientRun));
 }
Ejemplo n.º 33
0
      public void LegacyLog_Read_GPU2_2_Test() // verbosity (normal)
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\GPU2_2\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 34, 207));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 208, 381));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 382, 446));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 14, 4, 40, 2, DateTimeKind.Utc);
         expectedRun.Data.Arguments = null;
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "51108B97183EA3DF";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 2;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 4221;
         expectedSlotRun.Data.Status = SlotStatus.Stopped;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (First ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Last().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(8, unitRun.LogLines[3].LineData);
         Assert.AreEqual(1.19f, unitRun.LogLines[8].LineData);
         Assert.That(unitRun.LogLines[22].ToString().Contains("Project: 5751 (Run 8, Clone 205, Gen 527)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[154].LineData);
      }
Ejemplo n.º 34
0
      public void LegacyLog_Read_SMP_15_Test() // lots of Client-core communications error
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\SMP_15\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 36, 233));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 234, 283));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 284, 333));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 334, 657));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 658, 707));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 708, 757));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 758, 1081));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 1082, 1146));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 1147, 1218));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 1219, 1268));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 1269, 1340));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 1341, 1435));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 1436, 1537));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 1538, 1587));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 1588, 1637));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 1638, 1709));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 1710, 1759));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 1760, 1824));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 1825, 2148));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 2149, 2198));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 2199, 2417));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 2418, 2489));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 2490, 2539));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 2540, 2589));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 2590, 2913));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 2914, 2963));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 2964, 3013));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 3014, 3352));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 3353, 3447));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 3448, 3497));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 3498, 3644));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 3645, 3709));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 3710, 3759));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 3760, 3792));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 9, 14, 2, 48, 27, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-smp -verbosity 9";
         expectedRun.Data.ClientVersion = "6.30";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "DC1DAF57D91DF79";
         expectedRun.Data.MachineID = 1;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 33;
         expectedSlotRun.Data.TotalCompletedUnits = 617;
         expectedSlotRun.Data.Status = SlotStatus.EuePause;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (First ClientRun - Current UnitRun)
         var unitRun = fahLog.ClientRuns.Last().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(0, unitRun.LogLines[3].LineData);
         Assert.AreEqual(2.22f, unitRun.LogLines[10].LineData);
         Assert.That(unitRun.LogLines[20].ToString().Contains("Project: 6071 (Run 0, Clone 39, Gen 70)"));
         Assert.AreEqual(WorkUnitResult.ClientCoreError, unitRun.LogLines[26].LineData);
      }
Ejemplo n.º 35
0
      public void LegacyLog_Read_GPU2_3_Test() // verbosity (normal) / EUE Pause Test
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\GPU2_3\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 0);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 24, 55));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 18, 3, 26, 33, DateTimeKind.Utc);
         expectedRun.Data.Arguments = null;
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "JollySwagman";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "1D1493BB0A79C9AE";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 0;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = null;
         expectedSlotRun.Data.Status = SlotStatus.Stopped;

         var actualRun = fahLog.ClientRuns.ElementAt(1);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Check Run 1 Positions
         expectedRun = new ClientRun(null, 56);
         expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 80, 220));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 221, 270));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 271, 319));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 320, 372));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 373, 420));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 421, 463));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 18, 3, 54, 16, DateTimeKind.Utc);
         expectedRun.Data.Arguments = null;
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "JollySwagman";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "1D1493BB0A79C9AE";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 5;
         expectedSlotRun.Data.TotalCompletedUnits = 224;
         expectedSlotRun.Data.Status = SlotStatus.EuePause;

         actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - UnitRun 3)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.ElementAt(2);
         Assert.AreEqual(9, unitRun.LogLines[3].LineData);
         Assert.AreEqual(1.19f, unitRun.LogLines[8].LineData);
         Assert.That(unitRun.LogLines[22].ToString().Contains("Project: 5756 (Run 6, Clone 32, Gen 480)"));
         Assert.AreEqual(WorkUnitResult.UnstableMachine, unitRun.LogLines[39].LineData);

         // Special Check to be sure the reader is catching the EUE Pause line (Current ClientRun - Current UnitRun)
         unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Peek();
         Assert.AreEqual(LogLineType.ClientEuePauseState, unitRun.LogLines[42].LineType);
      }
Ejemplo n.º 36
0
        internal static void AreEqual(ClientRun expectedRun, ClientRun actualRun, bool assertUnitRunData = false)
        {
            Assert.AreEqual(expectedRun.ClientStartIndex, actualRun.ClientStartIndex);
            Assert.AreEqual(expectedRun.Data.StartTime, actualRun.Data.StartTime);
            if (expectedRun.Data is Legacy.LegacyClientRunData legacyExpectedRunData && actualRun.Data is Legacy.LegacyClientRunData legacyActualRunData)
            {
                Assert.AreEqual(legacyExpectedRunData.Arguments, legacyActualRunData.Arguments);
                Assert.AreEqual(legacyExpectedRunData.ClientVersion, legacyActualRunData.ClientVersion);
                Assert.AreEqual(legacyExpectedRunData.FoldingID, legacyActualRunData.FoldingID);
                Assert.AreEqual(legacyExpectedRunData.Team, legacyActualRunData.Team);
                Assert.AreEqual(legacyExpectedRunData.UserID, legacyActualRunData.UserID);
                Assert.AreEqual(legacyExpectedRunData.MachineID, legacyActualRunData.MachineID);
            }

            Assert.AreEqual(expectedRun.SlotRuns.Count, actualRun.SlotRuns.Count);
            foreach (int slotRunKey in expectedRun.SlotRuns.Keys)
            {
                var expectedSlotRun = expectedRun.SlotRuns[slotRunKey];
                var actualSlotRun   = actualRun.SlotRuns[slotRunKey];
                Assert.AreEqual(expectedSlotRun.Data.CompletedUnits, actualSlotRun.Data.CompletedUnits);
                Assert.AreEqual(expectedSlotRun.Data.FailedUnits, actualSlotRun.Data.FailedUnits);
                if (expectedSlotRun.Data is Legacy.LegacySlotRunData legacyExpectedSlotRunData &&
                    actualSlotRun.Data is Legacy.LegacySlotRunData legacyActualSlotRunData)
                {
                    Assert.AreEqual(legacyExpectedSlotRunData.TotalCompletedUnits, legacyActualSlotRunData.TotalCompletedUnits);
                    Assert.AreEqual(legacyExpectedSlotRunData.Status, legacyActualSlotRunData.Status);
                }

                Assert.AreEqual(expectedSlotRun.UnitRuns.Count, actualSlotRun.UnitRuns.Count);
                for (int i = 0; i < expectedSlotRun.UnitRuns.Count; i++)
                {
                    var expectedUnitRun = expectedSlotRun.UnitRuns.ElementAt(i);
                    var actualUnitRun   = actualSlotRun.UnitRuns.ElementAt(i);
                    Assert.AreEqual(expectedUnitRun.QueueIndex, actualUnitRun.QueueIndex);
                    Assert.AreEqual(expectedUnitRun.StartIndex, actualUnitRun.StartIndex);
                    Assert.AreEqual(expectedUnitRun.EndIndex, actualUnitRun.EndIndex);
                    if (assertUnitRunData)
                    {
                        Assert.AreEqual(expectedUnitRun.Data.UnitStartTimeStamp, actualUnitRun.Data.UnitStartTimeStamp);
                        Assert.AreEqual(expectedUnitRun.Data.CoreVersion, actualUnitRun.Data.CoreVersion);
                        Assert.AreEqual(expectedUnitRun.Data.FramesObserved, actualUnitRun.Data.FramesObserved);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectID, actualUnitRun.Data.ProjectID);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectRun, actualUnitRun.Data.ProjectRun);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectClone, actualUnitRun.Data.ProjectClone);
                        Assert.AreEqual(expectedUnitRun.Data.ProjectGen, actualUnitRun.Data.ProjectGen);
                        Assert.AreEqual(expectedUnitRun.Data.WorkUnitResult, actualUnitRun.Data.WorkUnitResult);
                        if (expectedUnitRun.Data.FrameDataDictionary != null && actualUnitRun.Data.FrameDataDictionary != null)
                        {
                            Assert.AreEqual(expectedUnitRun.Data.FrameDataDictionary.Count, actualUnitRun.Data.FrameDataDictionary.Count);
                            foreach (int frameDataKey in expectedUnitRun.Data.FrameDataDictionary.Keys)
                            {
                                var expectedFrameDataDictionary = expectedUnitRun.Data.FrameDataDictionary[frameDataKey];
                                var actualFrameDataDictionary   = actualUnitRun.Data.FrameDataDictionary[frameDataKey];
                                Assert.AreEqual(expectedFrameDataDictionary.ID, actualFrameDataDictionary.ID);
                                Assert.AreEqual(expectedFrameDataDictionary.RawFramesComplete, actualFrameDataDictionary.RawFramesComplete);
                                Assert.AreEqual(expectedFrameDataDictionary.RawFramesTotal, actualFrameDataDictionary.RawFramesTotal);
                                Assert.AreEqual(expectedFrameDataDictionary.TimeStamp, actualFrameDataDictionary.TimeStamp);
                                Assert.AreEqual(expectedFrameDataDictionary.Duration, actualFrameDataDictionary.Duration);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 37
0
      public void LegacyLog_Read_SMP_17_Test() // v6.23 A4 SMP
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\SMP_17\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 0);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 24, 174));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 175, 207));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 3, 20, 7, 52, 34, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-smp -bigadv -betateam -verbosity 9";
         expectedRun.Data.ClientVersion = "6.34";
         expectedRun.Data.FoldingID = "GreyWhiskers";
         expectedRun.Data.Team = 0;
         expectedRun.Data.UserID = "51EA5C9A7EF9D58E";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 0;
         expectedSlotRun.Data.TotalCompletedUnits = 885;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         var actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (Current ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Peek().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(0, unitRun.LogLines[8].LineData);
         Assert.AreEqual(2.27f, unitRun.LogLines[15].LineData);
         Assert.That(unitRun.LogLines[27].ToString().Contains("Project: 8022 (Run 11, Clone 318, Gen 24)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[106].LineData);
      }
Ejemplo n.º 38
0
      public void LegacyLog_Read_GPU2_1_Test() // verbosity 9
      {
         // Scan
         var fahLog = FahLog.Read(File.ReadAllLines("..\\..\\..\\TestFiles\\GPU2_1\\FAHlog.txt"), FahLogType.Legacy);

         // Check Run 0 Positions
         var expectedRun = new ClientRun(null, 2);
         var expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 130, 325));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 326, 386));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 387, 448));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 449, 509));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 510, 570));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 571, 617));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 8, 5, 7, 18, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-verbosity 9 -local";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "CF185086C102A47";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 1;
         expectedSlotRun.Data.FailedUnits = 5;
         expectedSlotRun.Data.TotalCompletedUnits = null; // TODO: not capturing line "+ Starting local stats count at 1"
         expectedSlotRun.Data.Status = SlotStatus.Stopped;

         var actualRun = fahLog.ClientRuns.ElementAt(1);
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Check Run 1 Positions
         expectedRun = new ClientRun(null, 618);
         expectedSlotRun = new SlotRun(expectedRun, 0);
         expectedRun.SlotRuns.Add(0, expectedSlotRun);
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 663, 736));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 737, 934));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 935, 1131));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 0, 1132, 1328));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 1, 1329, 1525));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 2, 1526, 1723));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 3, 1724, 1925));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 4, 1926, 2122));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 5, 2123, 2320));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 6, 2321, 2517));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 7, 2518, 2714));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 8, 2715, 2916));
         expectedSlotRun.UnitRuns.Push(new UnitRun(expectedSlotRun, 9, 2917, 2995));
         expectedRun.Data = new ClientRunData();
         expectedRun.Data.StartTime = new DateTime(DateTime.UtcNow.Year, 8, 8, 6, 18, 28, DateTimeKind.Utc);
         expectedRun.Data.Arguments = "-verbosity 9 -local";
         expectedRun.Data.ClientVersion = "6.23";
         expectedRun.Data.FoldingID = "harlam357";
         expectedRun.Data.Team = 32;
         expectedRun.Data.UserID = "CF185086C102A47";
         expectedRun.Data.MachineID = 2;
         expectedSlotRun.Data = new SlotRunData();
         expectedSlotRun.Data.CompletedUnits = 11;
         expectedSlotRun.Data.FailedUnits = 1;
         expectedSlotRun.Data.TotalCompletedUnits = 12;
         expectedSlotRun.Data.Status = SlotStatus.RunningNoFrameTimes;

         actualRun = fahLog.ClientRuns.Peek();
         FahLogAssert.AreEqual(expectedRun, actualRun);

         // Verify LogLine Properties
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(1).LogLines); // previous
         Assert.IsNotNull(actualRun.SlotRuns[0].UnitRuns.ElementAt(0).LogLines); // current

         // Spot Check Work Unit Data (First ClientRun - First UnitRun)
         var unitRun = fahLog.ClientRuns.Last().SlotRuns[0].UnitRuns.Last();
         Assert.AreEqual(1, unitRun.LogLines[3].LineData);
         Assert.AreEqual(1.19f, unitRun.LogLines[10].LineData);
         Assert.That(unitRun.LogLines[24].ToString().Contains("Project: 5771 (Run 12, Clone 109, Gen 805)"));
         Assert.AreEqual(WorkUnitResult.FinishedUnit, unitRun.LogLines[156].LineData);
      }
Ejemplo n.º 39
0
        /// <summary>
        /// Aggregate Data and return UnitInfo Dictionary.
        /// </summary>
        public IDictionary<int, UnitInfo> AggregateData(ICollection<LogLine> logLines, UnitCollection unitCollection, Info info, Options options, 
            SlotOptions slotOptions, UnitInfo currentUnitInfo, int slotId)
        {
            if (logLines == null) throw new ArgumentNullException("logLines");
             if (unitCollection == null) throw new ArgumentNullException("unitCollection");
             if (options == null) throw new ArgumentNullException("options");
             if (slotOptions == null) throw new ArgumentNullException("slotOptions");
             if (currentUnitInfo == null) throw new ArgumentNullException("currentUnitInfo");

             _currentUnitIndex = -1;
             // only take up to the last MaxDisplayableLogLines
             _currentLogLines = logLines.Skip(Math.Max(0, logLines.Count - Constants.MaxDisplayableLogLines)).ToList();
             _logInterpreter = new LogInterpreter(logLines, LogReader.GetClientRuns(logLines, LogFileType.FahClient));
             _currentClientRun = _logInterpreter.CurrentClientRun;

             // report errors that came back from log parsing
             foreach (var s in _logInterpreter.LogLineParsingErrors)
             {
            _logger.Debug(Constants.ClientNameFormat, ClientName, s);
             }

             IDictionary<int, UnitInfo> parsedUnits = GenerateUnitInfoDataFromQueue(unitCollection, options, slotOptions, currentUnitInfo, slotId);
             _clientQueue = BuildClientQueue(unitCollection, info, slotOptions, slotId);
             _logInterpreter = null;

             return parsedUnits;
        }