Exemple #1
0
        public override void SetUp()
        {
            base.SetUp();

            _metricProviderFactory = new ValueMetricProviderFactory();
            _subsystem = new SystemMonitoringSubsystem(Container);

            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();
        }
 /// <summary>Initializes the system monitoring subsystem.</summary>
 private void InitializeSystemMonitoringSubsystem()
 {
     try
     {
         // This can throw a few exceptions so may not be available.
         _systemMonitoringSubsystem = new SystemMonitoringSubsystem(Container);
         _alfred.Register(_systemMonitoringSubsystem);
     }
     catch (Win32Exception ex)
     {
         _console?.Log(LogHeader,
                       string.Format(Locale,
                                     "Problem creating system monitoring module: Win32 exception: {0}",
                                     ex.Message),
                       LogLevel.Error);
     }
     catch (UnauthorizedAccessException ex)
     {
         _console?.Log(LogHeader,
                       string.Format(Locale,
                                     "Problem creating system monitoring module: Unauthorized access exception: {0}",
                                     ex.Message),
                       LogLevel.Error);
     }
 }