コード例 #1
0
 public LinuxHostPropertyProvider(IHostInformationProvider theHostInfoProvider)
 {
     CodeContract.RequiresArgumentNotNull <IHostInformationProvider>(theHostInfoProvider, "theHostInfoProvider");
     hostInfoProvider = theHostInfoProvider;
     hostExeName      = new Lazy <string>(() => InitializeHostExeName(), false);
     hostVersionInfo  = new Lazy <Version>(() => InitializeHostVersionInfo(), false);
 }
コード例 #2
0
 public WindowsHostPropertyProvider(IHostInformationProvider theHostInfoProvider)
     : base(theHostInfoProvider)
 {
     CodeContract.RequiresArgumentNotNull <IHostInformationProvider>(theHostInfoProvider, "theHostInfoProvider");
     hostInfoProvider = theHostInfoProvider;
     hostVersionInfo  = new Lazy <FileVersionInfo>(() => InitializeHostVersionInfo(), false);
 }
コード例 #3
0
        private static TelemetrySessionInitializer BuildInitializer(TelemetrySessionSettings telemetrySessionSettings)
        {
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Expected O, but got Unknown
            CancellationTokenSource cancellationTokenSource          = new CancellationTokenSource();
            DiagnosticTelemetry     diagnosticTelemetry              = new DiagnosticTelemetry();
            EnvironmentTools        environmentTools                 = new EnvironmentTools();
            RegistryTools           registryTools                    = (RegistryTools)(object)new RegistryTools();
            ProcessTools            processTools                     = new ProcessTools();
            ILegacyApi                   legacyApi                   = GetLegacyApi((IRegistryTools)(object)registryTools);
            IPersistentPropertyBag       persistentStorage           = CreatePersistentPropertyBag(string.Empty);
            IPersistentPropertyBag       persistentPropertyBag       = CreatePersistentPropertyBag("c57a9efce9b74de382d905a89852db71");
            IMACInformationProvider      mACInformationProvider      = GetMACInformationProvider(processTools, persistentStorage, legacyApi);
            IInternalSettings            internalSettings            = GetInternalSettings(diagnosticTelemetry, (IRegistryTools)(object)registryTools);
            IHostInformationProvider     hostInformationProvider     = GetHostInformationProvider();
            IUserInformationProvider     userInformationProvider     = GetUserInformationProvider((IRegistryTools)(object)registryTools, internalSettings, environmentTools, legacyApi, telemetrySessionSettings);
            MachineInformationProvider   machineInformationProvider  = new MachineInformationProvider(legacyApi, userInformationProvider, mACInformationProvider);
            IIdentityInformationProvider identityInformationProvider = GetIdentityInformationProvider();
            IPersistentPropertyBag       persistentPropertyBag2      = CreatePersistentPropertyBag(hostInformationProvider.ProcessName);
            TelemetryScheduler           telemetryScheduler          = new TelemetryScheduler();
            OptOutAction                 optOutAction                = new OptOutAction();

            optOutAction.AddOptOutFriendlyEventName("vs/telemetryapi/session/initialized");
            optOutAction.AddOptOutFriendlyEventName("context/postproperty");
            optOutAction.AddOptOutFriendlyPropertiesList(new List <string>
            {
                "Context.Default.VS.Core.BranchName",
                "Context.Default.VS.Core.BuildNumber",
                "Context.Default.VS.Core.ExeName",
                "Context.Default.VS.Core.ExeVersion",
                "Context.Default.VS.Core.HardwareId",
                "Context.Default.VS.Core.MacAddressHash",
                "Context.Default.VS.Core.Machine.Id",
                "Context.Default.VS.Core.SkuName",
                "Context.Default.VS.Core.OS.Version",
                "Context.Default.VS.Core.ProcessId",
                "Context.Default.VS.Core.User.Id",
                "Context.Default.VS.Core.User.IsMicrosoftInternal",
                "Context.Default.VS.Core.User.IsOptedIn",
                "Context.Default.VS.Core.User.Location.GeoId",
                "Context.Default.VS.Core.User.Type",
                "Context.Default.VS.Core.Version",
                "Reserved.EventId",
                "Reserved.SessionId",
                "Reserved.TimeSinceSessionStart",
                "VS.Core.Locale.Product",
                "VS.Core.Locale.System",
                "VS.Core.Locale.User",
                "VS.Core.Locale.UserUI",
                "VS.Core.SkuId",
                "VS.Sqm.SkuId"
            });
            ClientSideThrottlingAction item = new ClientSideThrottlingAction(new List <string>
            {
                "context/create",
                "context/close",
                "context/postproperty",
                "vs/core/command",
                "vs/core/extension/installed",
                "vs/core/sessionstart",
                "vs/core/sessionend",
                "vs/telemetryapi/session/initialized",
                "vs/telemetryapi/clientsidethrottling",
                "vs/telemetryapi/manifest/load",
                "vs/telemetryapi/piiproperties"
            }, 0.0, 0L);
            PIIPropertyProcessor  pIIPropertyProcessor = new PIIPropertyProcessor();
            PiiAction             item2 = new PiiAction(pIIPropertyProcessor);
            ComplexPropertyAction item3 = new ComplexPropertyAction(new JsonComplexObjectSerializerFactory(), pIIPropertyProcessor);

            return(new TelemetrySessionInitializer
            {
                CancellationTokenSource = cancellationTokenSource,
                SessionId = Guid.NewGuid().ToString(),
                AppInsightsInstrumentationKey = "f144292e-e3b2-4011-ac90-20e5c03fbce5",
                AsimovInstrumentationKey = "AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70",
                DiagnosticTelemetry = diagnosticTelemetry,
                IdentityTelemetry = new IdentityTelemetry(identityInformationProvider, telemetryScheduler),
                EnvironmentTools = environmentTools,
                RegistryTools = (IRegistryTools2)(object)registryTools,
                ProcessTools = processTools,
                LegacyApi = legacyApi,
                InternalSettings = internalSettings,
                HostInformationProvider = hostInformationProvider,
                MachineInformationProvider = machineInformationProvider,
                UserInformationProvider = userInformationProvider,
                MACInformationProvider = mACInformationProvider,
                EventProcessorScheduler = telemetryScheduler,
                TelemetryManifestManagerBuilder = new TelemetryManifestManagerBuilder(),
                DefaultContextPropertyManager = new DefaultContextPropertyManager(GetPropertyProviders((IRegistryTools)(object)registryTools, environmentTools, hostInformationProvider, machineInformationProvider, mACInformationProvider, userInformationProvider, persistentPropertyBag, identityInformationProvider)),
                PersistentStorage = persistentStorage,
                PersistentSharedProperties = persistentPropertyBag,
                PersistentPropertyBag = persistentPropertyBag2,
                ChannelValidators = new List <IChannelValidator>
                {
                    new RegistryChannelValidator(internalSettings),
                    new InternalChannelValidator(userInformationProvider),
                    new DisabledTelemetryChannelValidator(internalSettings)
                },
                CustomActionToAdd = new List <IEventProcessorAction>
                {
                    optOutAction,
                    new EnforceAIRestrictionAction(),
                    item2,
                    item3,
                    new MetricAction(),
                    new SettingAction(),
                    item,
                    new SuppressEmptyPostPropertyEventAction()
                },
                EventProcessorChannelBuilder = new EventProcessorChannelBuilder(persistentPropertyBag2, telemetryScheduler),
                WatsonSessionChannelBuilder = new WatsonSessionChannelBuilder(internalSettings.FaultEventWatsonSamplePercent(), internalSettings.FaultEventMaximumWatsonReportsPerSession(), internalSettings.FaultEventMinimumSecondsBetweenWatsonReports(), ChannelProperties.Default),
                OptinStatusReader = GetOptInStatusReader((IRegistryTools2)(object)registryTools),
                ProcessCreationTime = GetProcessCreationTime()
            });
        }
コード例 #4
0
        private static IEnumerable <IPropertyProvider> GetPropertyProviders(IRegistryTools registryTools, IEnvironmentTools environmentTools, IHostInformationProvider host, IMachineInformationProvider machine, IMACInformationProvider macAddress, IUserInformationProvider user, IPersistentPropertyBag sharedProperties, IIdentityInformationProvider identity)
        {
            yield return(new IdentityPropertyProvider());

            if (Platform.IsMac)
            {
                yield return(new MacHostPropertyProvider(host, new NsBundleInformationProvider()));

                yield return(new AssemblyPropertyProvider());

                yield return(new MacLocalePropertyProvider());

                yield return(new MacMachinePropertyProvider(machine, registryTools, macAddress));

                yield return(new MacOSPropertyProvider(environmentTools));

                yield return(new MacUserPropertyProvider(user));

                yield return(new PersistentSharedPropertyProvider(sharedProperties));
            }
            else if (Platform.IsLinux)
            {
                yield return(new LinuxHostPropertyProvider(host));

                yield return(new AssemblyPropertyProvider());

                yield return(new LinuxLocalePropertyProvider());

                yield return(new PersistentSharedPropertyProvider(sharedProperties));
            }
            else
            {
                yield return(new WindowsHostPropertyProvider(host));

                yield return(new AssemblyPropertyProvider());

                yield return(new WindowsLocalePropertyProvider(registryTools));

                yield return(new WindowsMachinePropertyProvider(machine, registryTools, macAddress));

                yield return(new WindowsOSPropertyProvider(environmentTools, registryTools));

                yield return(new WindowsUserPropertyProvider(user));

                yield return(new PersistentSharedPropertyProvider(sharedProperties));
            }
        }
コード例 #5
0
 public BaseHostRealtimePropertyProvider(IHostInformationProvider hostInformationProvider)
 {
     CodeContract.RequiresArgumentNotNull <IHostInformationProvider>(hostInformationProvider, "hostInformationProvider");
     this.hostInformationProvider = hostInformationProvider;
 }