Esempio n. 1
0
        protected ApplicationSettingsType GetApplicationSettings()
        {
            InstrumentationSettings instrumentationSettings = this.GetInstrumentationSettings();
            ApplicationSettingsType applicationSettingsType = new ApplicationSettingsType();
            double num = GetOwaUserConfiguration.random.NextDouble();

            applicationSettingsType.AnalyticsEnabled            = (num < (double)instrumentationSettings.AnalyticsProbability);
            applicationSettingsType.CoreAnalyticsEnabled        = (applicationSettingsType.AnalyticsEnabled || num < (double)instrumentationSettings.CoreAnalyticsProbability);
            applicationSettingsType.InferenceEnabled            = instrumentationSettings.IsInferenceEnabled;
            applicationSettingsType.WatsonEnabled               = instrumentationSettings.IsClientWatsonEnabled;
            applicationSettingsType.ManualPerfTracerEnabled     = instrumentationSettings.IsManualPerfTracerEnabled;
            applicationSettingsType.ConsoleTracingEnabled       = instrumentationSettings.IsConsoleTracingEnabled;
            applicationSettingsType.DefaultTraceLevel           = instrumentationSettings.DefaultTraceLevel;
            applicationSettingsType.DefaultPerfTraceLevel       = instrumentationSettings.DefaultPerfTraceLevel;
            applicationSettingsType.DefaultJsMvvmPerfTraceLevel = instrumentationSettings.DefaultJsMvvmPerfTraceLevel;
            switch (instrumentationSettings.DefaultTraceLevel)
            {
            case TraceLevel.Error:
                applicationSettingsType.TraceWarningComponents = instrumentationSettings.TraceWarningComponents;
                applicationSettingsType.TracePerfComponents    = instrumentationSettings.TracePerfComponents;
                applicationSettingsType.TraceInfoComponents    = instrumentationSettings.TraceInfoComponents;
                applicationSettingsType.TraceVerboseComponents = instrumentationSettings.TraceVerboseComponents;
                break;

            case TraceLevel.Warning:
                applicationSettingsType.TracePerfComponents    = instrumentationSettings.TracePerfComponents;
                applicationSettingsType.TraceInfoComponents    = instrumentationSettings.TraceInfoComponents;
                applicationSettingsType.TraceVerboseComponents = instrumentationSettings.TraceVerboseComponents;
                break;

            case TraceLevel.Perf:
                applicationSettingsType.TraceInfoComponents    = instrumentationSettings.TraceInfoComponents;
                applicationSettingsType.TraceVerboseComponents = instrumentationSettings.TraceVerboseComponents;
                break;

            case TraceLevel.Info:
                applicationSettingsType.TraceVerboseComponents = instrumentationSettings.TraceVerboseComponents;
                break;
            }
            applicationSettingsType.InstrumentationSendIntervalSeconds = (int)instrumentationSettings.SendInterval.TotalSeconds;
            if (this.placesConfigurationCache.IsFeatureEnabled)
            {
                applicationSettingsType.MapControlKey     = this.placesConfigurationCache.MapControlKey;
                applicationSettingsType.StaticMapUrl      = this.placesConfigurationCache.StaticMapUrl;
                applicationSettingsType.DirectionsPageUrl = this.placesConfigurationCache.DirectionsPageUrl;
            }
            applicationSettingsType.CheckForForgottenAttachmentsEnabled = this.CheckForForgottenAttachmentsEnabled;
            applicationSettingsType.ControlTasksQueueDisabled           = this.ControlTasksQueueDisabled;
            applicationSettingsType.CloseWindowOnLogout          = this.CloseWindowOnLogout();
            applicationSettingsType.IsLegacySignOut              = this.IsLegacyLogOff;
            applicationSettingsType.FilterWebBeaconsAndHtmlForms = VdirConfiguration.Instance.FilterWebBeaconsAndHtmlForms;
            applicationSettingsType.FindFolderCountLimit         = Global.FindCountLimit;
            return(applicationSettingsType);
        }
Esempio n. 2
0
        protected override bool InternalExecute()
        {
            if (this.datapoints == null || this.datapoints.Length == 0)
            {
                return(true);
            }
            InstrumentationSettings instrumentationSettings = this.GetInstrumentationSettings();

            if (!instrumentationSettings.IsInstrumentationEnabled())
            {
                return(true);
            }
            UserContext userContext          = this.GetUserContext();
            Stopwatch   stopwatch            = Stopwatch.StartNew();
            Datapoint   chunkHeaderDatapoint = this.GetChunkHeaderDatapoint(this.datapoints[0].Time);
            int         num;
            IDictionary <DatapointConsumer, LogDatapoint.ClientLogEventList> dictionary = this.TriageAndConvertDatapoints(userContext, chunkHeaderDatapoint, instrumentationSettings, out num);
            long elapsedMilliseconds      = stopwatch.ElapsedMilliseconds;
            IList <ClientLogEvent> events = dictionary[DatapointConsumer.Watson].Events;

            if (events.Count > 0 && instrumentationSettings.IsClientWatsonEnabled)
            {
                this.clientWatsonHandler.ReportWatsonEvents(userContext, events, chunkHeaderDatapoint, this.datapoints);
            }
            FaultInjection.GenerateFault((FaultInjection.LIDs) 3804638525U);
            stopwatch.Restart();
            this.analyticsLogger(dictionary[DatapointConsumer.Analytics].Events);
            this.diagnosticsLogger(dictionary[DatapointConsumer.Diagnostics].Events);
            long elapsedMilliseconds2 = stopwatch.ElapsedMilliseconds;
            long num2 = 0L;
            long num3 = 0L;
            int  num4 = 0;

            if (this.isOwa && dictionary[DatapointConsumer.Inference].Events.Count > 0)
            {
                stopwatch.Restart();
                IActivityLogger activityLogger = this.GetActivityLogger();
                if (activityLogger != null)
                {
                    IList <Activity> list = this.CreateInferenceActivities(dictionary[DatapointConsumer.Inference].Events);
                    num2 = stopwatch.ElapsedMilliseconds;
                    num3 = 0L;
                    if (list.Count > 0)
                    {
                        num4 = list.Count;
                        stopwatch.Restart();
                        this.WriteInferenceActivities(list, activityLogger);
                        num3 = stopwatch.ElapsedMilliseconds;
                    }
                }
            }
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.CreateDatapointEventsElapsed, elapsedMilliseconds);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.TotalDatapointSize, num);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.AnalyticsDatapointCount, dictionary[DatapointConsumer.Analytics].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.AnalyticsDatapointSize, dictionary[DatapointConsumer.Analytics].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceDatapointCount, dictionary[DatapointConsumer.Inference].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceDatapointSize, dictionary[DatapointConsumer.Inference].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.DiagnosticsDatapointCount, dictionary[DatapointConsumer.Diagnostics].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.DiagnosticsDatapointSize, dictionary[DatapointConsumer.Diagnostics].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.WatsonDatapointCount, dictionary[DatapointConsumer.Watson].Events.Count);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.WatsonDatapointSize, dictionary[DatapointConsumer.Watson].DatapointTotalSize);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.DatapointsToLoggerElapsed, elapsedMilliseconds2);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceActivitiesToMailboxCount, num4);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.CreateInferenceActivitiesElapsed, num2);
            base.CallContext.ProtocolLog.Set(LogDatapointMetadata.InferenceActivitiesToMailboxElapsed, num3);
            return(true);
        }
Esempio n. 3
0
        private IDictionary <DatapointConsumer, LogDatapoint.ClientLogEventList> TriageAndConvertDatapoints(UserContext userContext, Datapoint header, InstrumentationSettings settings, out int totalDatapointSize)
        {
            string            userContextId           = this.GetUserContextId();
            string            clientAddress           = this.GetClientAddress();
            string            userName                = this.isOwa ? base.CallContext.GetEffectiveAccessingSmtpAddress() : "ExternalUser";
            string            cookieValueAndSetIfNull = ClientIdCookie.GetCookieValueAndSetIfNull(HttpContext.Current);
            ClientLogEvent    header2          = new ClientLogEvent(header, userContextId, clientAddress, userName, this.serverVersion, base.CallContext.IsMowa, cookieValueAndSetIfNull);
            DatapointConsumer enabledConsumers = this.GetEnabledConsumers(settings);

            totalDatapointSize = 0;
            LogDatapoint.ClientLogEventList clientLogEventList  = new LogDatapoint.ClientLogEventList(DatapointConsumer.Analytics, enabledConsumers, header2);
            LogDatapoint.ClientLogEventList clientLogEventList2 = new LogDatapoint.ClientLogEventList(DatapointConsumer.Diagnostics, enabledConsumers, header2);
            LogDatapoint.ClientLogEventList clientLogEventList3 = new LogDatapoint.ClientLogEventList(DatapointConsumer.Inference, enabledConsumers, null);
            LogDatapoint.ClientLogEventList clientLogEventList4 = new LogDatapoint.ClientLogEventList(DatapointConsumer.Watson, enabledConsumers, null);
            int num = 0;

            if (userContext != null && this.datapoints[0].Id == "SessionInfo")
            {
                num = 1;
                Datapoint      datapoint      = this.datapoints[0];
                ClientLogEvent clientLogEvent = new ClientLogEvent(datapoint, userContextId, clientAddress, userName, this.serverVersion, base.CallContext.IsMowa, cookieValueAndSetIfNull);
                userContext.LogEventCommonData.UpdateClientData(clientLogEvent.DatapointProperties);
                this.clientVersion = userContext.LogEventCommonData.ClientBuild;
                clientLogEvent.UpdateTenantInfo(userContext);
                clientLogEvent.UpdateNetid(userContext);
                clientLogEvent.UpdateMailboxGuid(userContext.ExchangePrincipal);
                clientLogEvent.UpdateDatabaseInfo(userContext);
                clientLogEvent.UpdateFlightInfo(userContext.LogEventCommonData);
                clientLogEvent.UpdatePassThroughProxyInfo(this.isFromPassThroughProxy);
                clientLogEvent.UpdateUserAgent(userContext.UserAgent);
                clientLogEventList.CheckAndAdd(clientLogEvent);
                clientLogEventList3.CheckAndAdd(clientLogEvent);
                clientLogEventList2.CheckAndAdd(clientLogEvent);
                clientLogEventList4.CheckAndAdd(clientLogEvent);
            }
            for (int i = num; i < this.datapoints.Length; i++)
            {
                Datapoint datapoint2 = this.datapoints[i];
                totalDatapointSize += datapoint2.Size;
                if ((enabledConsumers & datapoint2.Consumers) != DatapointConsumer.None)
                {
                    ClientLogEvent clientLogEvent2 = new ClientLogEvent(datapoint2, userContextId, clientAddress, userName, this.serverVersion, base.CallContext.IsMowa, cookieValueAndSetIfNull);
                    if (userContext != null)
                    {
                        clientLogEvent2.UpdateClientBuildVersion(userContext.LogEventCommonData);
                        string id;
                        if (clientLogEventList.CheckAndAdd(clientLogEvent2) && (id = datapoint2.Id) != null)
                        {
                            if (< PrivateImplementationDetails > { 38B691CF - 9E72 - 4F 22 - A560 - A7F126C51047 }.$$method0x6001a88 - 1 == null)
Esempio n. 4
0
        // Token: 0x06001B24 RID: 6948 RVA: 0x00066FBC File Offset: 0x000651BC
        public InstrumentationSettings(NameValueCollection settings)
        {
            float analyticsProbability;

            if (float.TryParse(settings["AnalyticsProbability"], out analyticsProbability))
            {
                this.AnalyticsProbability = analyticsProbability;
            }
            float coreAnalyticsProbability;

            if (float.TryParse(settings["CoreAnalyticsProbability"], out coreAnalyticsProbability))
            {
                this.CoreAnalyticsProbability = coreAnalyticsProbability;
            }
            bool isInferenceEnabled;

            if (bool.TryParse(settings["InferenceEnabled"], out isInferenceEnabled))
            {
                this.IsInferenceEnabled = isInferenceEnabled;
            }
            bool isConsoleTracingEnabled;

            if (bool.TryParse(settings["ConsoleTracingEnabled"], out isConsoleTracingEnabled))
            {
                this.IsConsoleTracingEnabled = isConsoleTracingEnabled;
            }
            TraceLevel defaultTraceLevel;

            if (Enum.TryParse <TraceLevel>(settings["DefaultTraceLevel"], out defaultTraceLevel))
            {
                this.DefaultTraceLevel = defaultTraceLevel;
            }
            JsMvvmPerfTraceLevel jsMvvmPerfTraceLevel;

            if (Enum.TryParse <JsMvvmPerfTraceLevel>(settings["DefaultPerfTraceLevel"], out jsMvvmPerfTraceLevel))
            {
                this.DefaultJsMvvmPerfTraceLevel = jsMvvmPerfTraceLevel;
                this.DefaultPerfTraceLevel       = InstrumentationSettings.ConvertToOldPerfTraceLevel(jsMvvmPerfTraceLevel);
            }
            string value = settings["TraceInfoComponents"];

            if (!string.IsNullOrEmpty(value))
            {
                this.TraceInfoComponents = InstrumentationSettings.CommaSeperatedStringToArray(value);
            }
            string value2 = settings["TracePerfComponents"];

            if (!string.IsNullOrEmpty(value2))
            {
                this.TracePerfComponents = InstrumentationSettings.CommaSeperatedStringToArray(value2);
            }
            string value3 = settings["TraceVerboseComponents"];

            if (!string.IsNullOrEmpty(value3))
            {
                this.TraceVerboseComponents = InstrumentationSettings.CommaSeperatedStringToArray(value3);
            }
            string value4 = settings["TraceWarningComponents"];

            if (!string.IsNullOrEmpty(value4))
            {
                this.TraceWarningComponents = InstrumentationSettings.CommaSeperatedStringToArray(value4);
            }
            bool isClientWatsonEnabled;

            if (bool.TryParse(settings["ClientWatsonEnabled"], out isClientWatsonEnabled))
            {
                this.IsClientWatsonEnabled = isClientWatsonEnabled;
            }
            TimeSpan sendInterval;

            if (TimeSpan.TryParse(settings["SendInterval"], out sendInterval))
            {
                this.SendInterval = sendInterval;
            }
            bool isManualPerfTracerEnabled;

            if (bool.TryParse(settings["ManualPerfTracerEnabled"], out isManualPerfTracerEnabled))
            {
                this.IsManualPerfTracerEnabled = isManualPerfTracerEnabled;
            }
        }