Beispiel #1
0
        private void InitializeTelemetry()
        {
            var _logger = new SIM.Core.Logging.SitecoreLogger(Microsoft.Extensions.Logging.LogLevel.Debug);

            var kbProviderConfiguration = new KBProviderConfiguration()
            {
                BaseAddress = Constants.KBProviderBaseAddress
            };

            var kbTelemetryProvider = new KnowledgeBaseProvider(kbProviderConfiguration, true, _logger);

            Telemetry.Analytics.RegisterProvider(kbTelemetryProvider);

            try
            {
                string appVersion = string.IsNullOrEmpty(ApplicationManager.AppVersion) ? "0.0.0.0" : ApplicationManager.AppVersion;

                var telemetryEventContext = new TelemetryEventContext(
                    Constants.SitecoreInstanceManagerAppId,
                    AnalyticsHelper.GetDeviceId(ApplicationManager.TempFolder, _logger),
                    appVersion,
                    _logger
                    );

                Telemetry.Analytics.Initialize(telemetryEventContext, WindowsSettings.AppTelemetryEnabled.Value, _logger);
            }
            catch (Exception ex)
            {
                Log.Error($"'TelemetryEventContext' error occurred.{Environment.NewLine}" +
                          $"Message: {ex.Message}{Environment.NewLine}," +
                          $"{ex.StackTrace}");

                return;
            }
        }
Beispiel #2
0
        public void Init()
        {
            var          knowledgeBaseProvider = new KnowledgeBaseProvider();
            HareDuConfig config = new () { Diagnostics = new ()
                                           {
                                               Probes = new ()
                                               {
                                                   HighConnectionClosureRateThreshold  = 100,
                                                   HighConnectionCreationRateThreshold = 100,
                                                   QueueHighFlowThreshold = 100,
                                                   QueueLowFlowThreshold  = 20,
                                                   MessageRedeliveryThresholdCoefficient   = 0.50M,
                                                   SocketUsageThresholdCoefficient         = 0.60M,
                                                   RuntimeProcessUsageThresholdCoefficient = 0.65M,
                                                   FileDescriptorUsageThresholdCoefficient = 0.65M,
                                                   ConsumerUtilizationThreshold            = 0.50M
                                               }
                                           } };

            _probes = new List <DiagnosticProbe>
            {
                new RuntimeProcessLimitProbe(config.Diagnostics, knowledgeBaseProvider),
                new SocketDescriptorThrottlingProbe(config.Diagnostics, knowledgeBaseProvider),
                new NetworkPartitionProbe(knowledgeBaseProvider),
                new MemoryAlarmProbe(knowledgeBaseProvider),
                new DiskAlarmProbe(knowledgeBaseProvider),
                new AvailableCpuCoresProbe(knowledgeBaseProvider),
                new FileDescriptorThrottlingProbe(config.Diagnostics, knowledgeBaseProvider),
            };
        }
Beispiel #3
0
        public void Init()
        {
            var          knowledgeBaseProvider = new KnowledgeBaseProvider();
            HareDuConfig config = new()
            {
                Diagnostics = new()
                {
                    Probes = new()
                    {
                        HighConnectionClosureRateThreshold  = 100,
                        HighConnectionCreationRateThreshold = 100,
                        QueueHighFlowThreshold = 100,
                        QueueLowFlowThreshold  = 20,
                        MessageRedeliveryThresholdCoefficient   = 0.50M,
                        SocketUsageThresholdCoefficient         = 0.60M,
                        RuntimeProcessUsageThresholdCoefficient = 0.65M,
                        FileDescriptorUsageThresholdCoefficient = 0.65M,
                        ConsumerUtilizationThreshold            = 0.50M
                    }
                }
            };

            _probes = new List <DiagnosticProbe>
            {
                new QueueGrowthProbe(knowledgeBaseProvider),
                new MessagePagingProbe(knowledgeBaseProvider),
                new RedeliveredMessagesProbe(config.Diagnostics, knowledgeBaseProvider),
                new ConsumerUtilizationProbe(config.Diagnostics, knowledgeBaseProvider),
                new UnroutableMessageProbe(knowledgeBaseProvider),
                new QueueLowFlowProbe(config.Diagnostics, knowledgeBaseProvider),
                new QueueNoFlowProbe(knowledgeBaseProvider),
                new QueueHighFlowProbe(config.Diagnostics, knowledgeBaseProvider)
            };
        }
Beispiel #4
0
        public void Init()
        {
            var          knowledgeBaseProvider = new KnowledgeBaseProvider();
            HareDuConfig config = new()
            {
                Diagnostics = new()
                {
                    Probes = new()
                    {
                        HighConnectionClosureRateThreshold  = 100,
                        HighConnectionCreationRateThreshold = 100,
                        QueueHighFlowThreshold = 100,
                        QueueLowFlowThreshold  = 20,
                        MessageRedeliveryThresholdCoefficient   = 0.50M,
                        SocketUsageThresholdCoefficient         = 0.60M,
                        RuntimeProcessUsageThresholdCoefficient = 0.65M,
                        FileDescriptorUsageThresholdCoefficient = 0.65M,
                        ConsumerUtilizationThreshold            = 0.50M
                    }
                }
            };

            _probes = new List <DiagnosticProbe>
            {
                new HighConnectionCreationRateProbe(config.Diagnostics, knowledgeBaseProvider),
                new HighConnectionClosureRateProbe(config.Diagnostics, knowledgeBaseProvider),
                new UnlimitedPrefetchCountProbe(knowledgeBaseProvider),
                new ChannelThrottlingProbe(knowledgeBaseProvider),
                new ChannelLimitReachedProbe(knowledgeBaseProvider),
                new BlockedConnectionProbe(knowledgeBaseProvider)
            };
        }