示例#1
0
        public void RecordMetrics()
        {
            var sequence = new SymbolStoreSequence(Substitute.For <IBinaryFileUtil>());

            for (int i = 0; i < 4; ++i)
            {
                sequence.AddStore(Substitute.For <IFlatSymbolStore>());
            }
            for (int i = 0; i < 3; ++i)
            {
                sequence.AddStore(Substitute.For <IStructuredSymbolStore>());
            }
            for (int i = 0; i < 2; ++i)
            {
                sequence.AddStore(Substitute.For <IHttpSymbolStore>());
            }
            sequence.AddStore(Substitute.For <IStadiaSymbolStore>());

            mockSymbolPathParser = Substitute.For <SymbolPathParser>();
            mockSymbolPathParser.Parse(SEARCH_PATHS).Returns(sequence);
            moduleFileFinder = new ModuleFileFinder(mockSymbolPathParser);

            var data = new LoadSymbolData();

            moduleFileFinder.SetSearchPaths(SEARCH_PATHS);
            moduleFileFinder.RecordMetrics(data);

            Assert.AreEqual(4, data.FlatSymbolStoresCount);
            Assert.AreEqual(3, data.StructuredSymbolStoresCount);
            Assert.AreEqual(2, data.HttpSymbolStoresCount);
            Assert.AreEqual(1, data.StadiaSymbolStoresCount);
        }
示例#2
0
 public void RecordMetrics(LoadSymbolData loadSymbolData)
 {
     loadSymbolData.FlatSymbolStoresCount =
         _symbolStore.GetAllStores().OfType <IFlatSymbolStore>().Count();
     loadSymbolData.StructuredSymbolStoresCount =
         _symbolStore.GetAllStores().OfType <IStructuredSymbolStore>().Count();
     loadSymbolData.HttpSymbolStoresCount =
         _symbolStore.GetAllStores().OfType <IHttpSymbolStore>().Count();
     loadSymbolData.StadiaSymbolStoresCount =
         _symbolStore.GetAllStores().OfType <IStadiaSymbolStore>().Count();
 }
示例#3
0
        public void RecordBeforeLoad(IList <SbModule> modules)
        {
            var loadSymbolDataBuilder = new LoadSymbolData();

            moduleFileFinder.RecordMetrics(loadSymbolDataBuilder);
            loadSymbolDataBuilder.ModulesBeforeCount = modules.Count;
            loadSymbolDataBuilder.ModulesWithSymbolsLoadedBeforeCount =
                modules.Count(m => moduleUtil.HasSymbolsLoaded(m));
            loadSymbolDataBuilder.BinariesLoadedBeforeCount =
                modules.Count(m => moduleUtil.HasBinaryLoaded(m));
            action.UpdateEvent(new DeveloperLogEvent
            {
                LoadSymbolData = loadSymbolDataBuilder
            });
        }
示例#4
0
        public void RecordAfterLoad(IList <SbModule> modules)
        {
            var loadSymbolDataBuilder = new LoadSymbolData();

            // Update module count again if more modules were loaded during the event.
            loadSymbolDataBuilder.ModulesAfterCount =
                Math.Max(modules.Count, loadSymbolDataBuilder.ModulesCount.GetValueOrDefault());
            loadSymbolDataBuilder.ModulesWithSymbolsLoadedAfterCount =
                modules.Count(m => moduleUtil.HasSymbolsLoaded(m));
            loadSymbolDataBuilder.BinariesLoadedAfterCount =
                modules.Count(m => moduleUtil.HasBinaryLoaded(m));
            action.UpdateEvent(new DeveloperLogEvent {
                LoadSymbolData = loadSymbolDataBuilder
            });
        }
        public DeveloperLogEvent Clone()
        {
            var clone = (DeveloperLogEvent)MemberwiseClone();

            clone.GrpcErrorDetails               = GrpcErrorDetails?.Clone();
            clone.ExternalToolError              = ExternalToolError?.Clone();
            clone.CommandData                    = CommandData?.Clone();
            clone.GameletData                    = GameletData?.Clone();
            clone.GrpcCallDetails                = GrpcCallDetails?.Select(x => x.Clone()).ToList();
            clone.LoadSymbolData                 = LoadSymbolData?.Clone();
            clone.DebugPreflightCheckData        = DebugPreflightCheckData?.Clone();
            clone.DebugSessionEndData            = DebugSessionEndData?.Clone();
            clone.DebugEventBatch                = DebugEventBatch?.Clone();
            clone.DebugParameters                = DebugParameters?.Clone();
            clone.CopyExecutable                 = CopyExecutable?.Clone();
            clone.CopyLldbServer                 = CopyLldbServer?.Clone();
            clone.CustomCommand                  = CustomCommand?.Clone();
            clone.ExceptionsData                 = ExceptionsData?.Select(x => x.Clone()).ToList();
            clone.BoundBreakpointsData           = BoundBreakpointsData?.Clone();
            clone.GameLaunchData                 = GameLaunchData?.Clone();
            clone.DebugExpressionEvaluationBatch = DebugExpressionEvaluationBatch?.Clone();
            return(clone);
        }
        public void MergeFrom(DeveloperLogEvent other)
        {
            if (other == null)
            {
                return;
            }

            if (other.ApiEndpoint.HasValue)
            {
                ApiEndpoint = other.ApiEndpoint;
            }

            if (other.BinaryType.HasValue)
            {
                BinaryType = other.BinaryType;
            }

            if (other.OrganizationId != null)
            {
                OrganizationId = other.OrganizationId;
            }

            if (other.ProjectId != null)
            {
                ProjectId = other.ProjectId;
            }

            if (other.VisualStudioVersion != null)
            {
                VisualStudioVersion = other.VisualStudioVersion;
            }

            if (other.SdkVersion != null)
            {
                SdkVersion = other.SdkVersion;
            }

            if (other.VsExtensionVersion != null)
            {
                VsExtensionVersion = other.VsExtensionVersion;
            }

            if (other.VsSessionIdStr != null)
            {
                VsSessionIdStr = other.VsSessionIdStr;
            }

            if (other.DebugSessionIdStr != null)
            {
                DebugSessionIdStr = other.DebugSessionIdStr;
            }

            if (other.StatusCode.HasValue)
            {
                StatusCode = other.StatusCode;
            }

            if (other.GrpcErrorDetails != null)
            {
                if (GrpcErrorDetails == null)
                {
                    GrpcErrorDetails = new GrpcServiceCallDetails();
                }

                GrpcErrorDetails.MergeFrom(other.GrpcErrorDetails);
            }

            if (other.ExternalToolError != null)
            {
                if (ExternalToolError == null)
                {
                    ExternalToolError = new Types.ExternalToolError();
                }

                ExternalToolError.MergeFrom(other.ExternalToolError);
            }

            if (other.LatencyMilliseconds.HasValue)
            {
                LatencyMilliseconds = other.LatencyMilliseconds;
            }

            if (other.LatencyType.HasValue)
            {
                LatencyType = other.LatencyType;
            }

            if (other.CommandData != null)
            {
                if (CommandData == null)
                {
                    CommandData = new Types.CommandData();
                }

                CommandData.MergeFrom(other.CommandData);
            }

            if (other.GameletData != null)
            {
                if (GameletData == null)
                {
                    GameletData = new Types.GameletData();
                }

                GameletData.MergeFrom(other.GameletData);
            }

            if (other.GrpcCallDetails != null)
            {
                if (GrpcCallDetails == null)
                {
                    GrpcCallDetails = new List <GrpcServiceCallDetails>();
                }

                GrpcCallDetails.AddRange(other.GrpcCallDetails);
            }

            if (other.LoadSymbolData != null)
            {
                if (LoadSymbolData == null)
                {
                    LoadSymbolData = new Types.LoadSymbolData();
                }

                LoadSymbolData.MergeFrom(other.LoadSymbolData);
            }

            if (other.DebugPreflightCheckData != null)
            {
                if (DebugPreflightCheckData == null)
                {
                    DebugPreflightCheckData = new DebugPreflightCheckData();
                }

                DebugPreflightCheckData.MergeFrom(other.DebugPreflightCheckData);
            }

            if (other.DebugSessionEndData != null)
            {
                if (DebugSessionEndData == null)
                {
                    DebugSessionEndData = new DebugSessionEndData();
                }

                DebugSessionEndData.MergeFrom(other.DebugSessionEndData);
            }

            if (other.DebugEventBatch != null)
            {
                if (DebugEventBatch == null)
                {
                    DebugEventBatch = new VSIDebugEventBatch();
                }

                DebugEventBatch.MergeFrom(other.DebugEventBatch);
            }

            if (other.DebugParameters != null)
            {
                if (DebugParameters == null)
                {
                    DebugParameters = new VSIDebugParameters();
                }

                DebugParameters.MergeFrom(other.DebugParameters);
            }

            if (other.CopyExecutable != null)
            {
                if (CopyExecutable == null)
                {
                    CopyExecutable = new CopyBinaryData();
                }

                CopyExecutable.MergeFrom(other.CopyExecutable);
            }

            if (other.CopyLldbServer != null)
            {
                if (CopyLldbServer == null)
                {
                    CopyLldbServer = new CopyBinaryData();
                }

                CopyLldbServer.MergeFrom(other.CopyLldbServer);
            }

            if (other.CustomCommand != null)
            {
                if (CustomCommand == null)
                {
                    CustomCommand = new CustomCommandData();
                }

                CustomCommand.MergeFrom(other.CustomCommand);
            }

            if (other.ExceptionsData != null)
            {
                if (ExceptionsData == null)
                {
                    ExceptionsData = new List <VSIExceptionData>();
                }

                ExceptionsData.AddRange(other.ExceptionsData);
            }

            if (other.BoundBreakpointsData != null)
            {
                if (BoundBreakpointsData == null)
                {
                    BoundBreakpointsData = new VSIBoundBreakpointsData();
                }

                BoundBreakpointsData.MergeFrom(other.BoundBreakpointsData);
            }

            if (other.GameLaunchData != null)
            {
                if (GameLaunchData == null)
                {
                    GameLaunchData = new GameLaunchData();
                }

                GameLaunchData.MergeFrom(other.GameLaunchData);
            }

            if (other.DebugExpressionEvaluationBatch != null)
            {
                if (DebugExpressionEvaluationBatch == null)
                {
                    DebugExpressionEvaluationBatch = new VSIDebugExpressionEvaluationBatch();
                }

                DebugExpressionEvaluationBatch.MergeFrom(other.DebugExpressionEvaluationBatch);
            }
        }
                public void MergeFrom(LoadSymbolData other)
                {
                    if (other.FlatSymbolStoresCount.HasValue)
                    {
                        FlatSymbolStoresCount = other.FlatSymbolStoresCount;
                    }

                    if (other.StructuredSymbolStoresCount.HasValue)
                    {
                        StructuredSymbolStoresCount = other.StructuredSymbolStoresCount;
                    }

                    if (other.HttpSymbolStoresCount.HasValue)
                    {
                        HttpSymbolStoresCount = other.HttpSymbolStoresCount;
                    }

                    if (other.StadiaSymbolStoresCount.HasValue)
                    {
                        StadiaSymbolStoresCount = other.StadiaSymbolStoresCount;
                    }

                    if (other.ModulesCount.HasValue)
                    {
                        ModulesCount = other.ModulesCount;
                    }

                    if (other.ModulesBeforeCount.HasValue)
                    {
                        ModulesBeforeCount = other.ModulesBeforeCount;
                    }

                    if (other.ModulesAfterCount.HasValue)
                    {
                        ModulesAfterCount = other.ModulesAfterCount;
                    }

                    if (other.ModulesWithSymbolsLoadedBeforeCount.HasValue)
                    {
                        ModulesWithSymbolsLoadedBeforeCount =
                            other.ModulesWithSymbolsLoadedBeforeCount;
                    }

                    if (other.ModulesWithSymbolsLoadedAfterCount.HasValue)
                    {
                        ModulesWithSymbolsLoadedAfterCount =
                            other.ModulesWithSymbolsLoadedAfterCount;
                    }

                    if (other.BinariesLoadedBeforeCount.HasValue)
                    {
                        BinariesLoadedBeforeCount = other.BinariesLoadedBeforeCount;
                    }

                    if (other.BinariesLoadedAfterCount.HasValue)
                    {
                        BinariesLoadedAfterCount = other.BinariesLoadedAfterCount;
                    }

                    if (other.SymbolCountAfter.HasValue)
                    {
                        SymbolCountAfter = other.SymbolCountAfter;
                    }
                }
                public bool Equals(LoadSymbolData other)
                {
                    if (ReferenceEquals(other, null))
                    {
                        return(false);
                    }

                    if (ReferenceEquals(other, this))
                    {
                        return(true);
                    }

                    if (other.FlatSymbolStoresCount != FlatSymbolStoresCount)
                    {
                        return(false);
                    }

                    if (other.StructuredSymbolStoresCount != StructuredSymbolStoresCount)
                    {
                        return(false);
                    }

                    if (other.HttpSymbolStoresCount != HttpSymbolStoresCount)
                    {
                        return(false);
                    }

                    if (other.StadiaSymbolStoresCount != StadiaSymbolStoresCount)
                    {
                        return(false);
                    }

                    if (other.ModulesCount != ModulesCount)
                    {
                        return(false);
                    }

                    if (other.ModulesBeforeCount != ModulesBeforeCount)
                    {
                        return(false);
                    }

                    if (other.ModulesAfterCount != ModulesAfterCount)
                    {
                        return(false);
                    }

                    if (other.ModulesWithSymbolsLoadedBeforeCount !=
                        ModulesWithSymbolsLoadedBeforeCount)
                    {
                        return(false);
                    }

                    if (other.ModulesWithSymbolsLoadedAfterCount !=
                        ModulesWithSymbolsLoadedAfterCount)
                    {
                        return(false);
                    }

                    if (other.BinariesLoadedBeforeCount != BinariesLoadedBeforeCount)
                    {
                        return(false);
                    }

                    if (other.BinariesLoadedAfterCount != BinariesLoadedAfterCount)
                    {
                        return(false);
                    }

                    if (other.SymbolCountAfter != SymbolCountAfter)
                    {
                        return(false);
                    }

                    return(true);
                }