static void Main() { log4net.Config.XmlConfigurator.Configure(); // Alternatively: http://stackoverflow.com/a/10204514/419956 AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionLogger; logger.Info($"Initializing the CouchMon Context."); // must be done before creating Nimator CouchmonContext.Initialize(); logger.Info($"CouchMon Context initialization complete."); logger.Info("Creating Nimator."); var nimator = CreateNimator(); logger.Info($"Nimator created. Starting timer for cycle every {CheckIntervalInSecs} seconds."); using (new Timer(_ => nimator.TickSafe(logger), null, 0, CheckIntervalInSecs * 1000)) { Console.WriteLine("Press any key to exit."); Console.ReadKey(); } logger.Info("Shutting down."); }
public ICheck ToCheck() { var clusterService = CouchmonContext.GetInstance <IClusterService>(); return(new DocumentThresholdCheck(clusterService, DocumentThreshold)); }
public ICheck ToCheck() { var clusterService = CouchmonContext.GetInstance <IClusterService>(); return(new RamThresholdCheck(clusterService, RamUsageThreshold)); }