/// <summary> /// Extension method for adding the Performance watcher to the the WardenConfiguration with the default name of Performance Watcher. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="configuration">Configuration of PerformanceWatcher.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddPerformanceWatcher( this WardenConfiguration.Builder builder, PerformanceWatcherConfiguration configuration, Action <WatcherHooksConfiguration.Builder> hooks = null) { builder.AddWatcher(PerformanceWatcher.Create(configuration), hooks); return(builder); }
/// <summary> /// Extension method for adding the Performance watcher to the the WardenConfiguration with the default name of Performance Watcher. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="configuration">Configuration of PerformanceWatcher.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <param name="interval">Optional interval (5 seconds by default) after which the next check will be invoked.</param> /// <param name="group">Optional name of the group that PerformanceWatcher belongs to.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddPerformanceWatcher( this WardenConfiguration.Builder builder, PerformanceWatcherConfiguration configuration, Action <WatcherHooksConfiguration.Builder> hooks = null, TimeSpan?interval = null, string group = null) { builder.AddWatcher(PerformanceWatcher.Create(configuration, group), hooks, interval); return(builder); }
protected PerformanceWatcher(string name, PerformanceWatcherConfiguration configuration) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Watcher name can not be empty."); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration), "Performance Watcher configuration has not been provided."); } Name = name; _configuration = configuration; }
protected Configurator(PerformanceWatcherConfiguration configuration) : base(configuration) { }
protected Configurator(TimeSpan?delay = null) { Configuration = new PerformanceWatcherConfiguration(delay); }
public Default(PerformanceWatcherConfiguration configuration) : base(configuration) { SetInstance(this); }
/// <summary> /// Factory method for creating a new instance of PerformanceWatcher. /// </summary> /// <param name="name">Name of the PerformanceWatcher.</param> /// <param name="configuration">Configuration of PerformanceWatcher.</param> /// <param name="group">Optional name of the group that PerformanceWatcher belongs to.</param> /// <returns>Instance of PerformanceWatcher.</returns> public static PerformanceWatcher Create(string name, PerformanceWatcherConfiguration configuration, string group = null) => new PerformanceWatcher(name, configuration, group);
/// <summary> /// Factory method for creating a new instance of PerformanceWatcher with default name of Performance Watcher. /// </summary> /// <param name="configuration">Configuration of PerformanceWatcher.</param> /// <param name="group">Optional name of the group that PerformanceWatcher belongs to.</param> /// <returns>Instance of PerformanceWatcher.</returns> public static PerformanceWatcher Create(PerformanceWatcherConfiguration configuration, string group = null) => Create(DefaultName, configuration, group);
protected Configurator(TimeSpan?delay = null, string machineName = null) { Configuration = new PerformanceWatcherConfiguration(delay, machineName); }
/// <summary> /// Factory method for creating a new instance of PerformanceWatcher. /// </summary> /// <param name="name">Name of the PerformanceWatcher.</param> /// <param name="configuration">Configuration of PerformanceWatcher.</param> /// <returns>Instance of PerformanceWatcher.</returns> public static PerformanceWatcher Create(string name, PerformanceWatcherConfiguration configuration) => new PerformanceWatcher(name, configuration);
/// <summary> /// Factory method for creating a new instance of PerformanceWatcher with default name of Performance Watcher. /// </summary> /// <param name="configuration">Configuration of PerformanceWatcher.</param> /// <returns>Instance of PerformanceWatcher.</returns> public static PerformanceWatcher Create(PerformanceWatcherConfiguration configuration) => Create(DefaultName, configuration);