Ejemplo n.º 1
0
        public Alert(string name, double lowerBound, double upperBound)
        {
            CounterAlertInfo info = new CounterAlertInfo("AlertSample");
            info.SampleInterval = TimeSpan.FromSeconds(3.0d);

            CounterName counterName = new CounterName() { Category = "Process", Counter = "IO Data Operations/sec", Instance = "AlertSample.App#1" };
            info.Thresholds.Add(new CounterThreshold() { Name = counterName, Condition = ThresholdCondition.Below, Value = lowerBound });
            info.Thresholds.Add(new CounterThreshold() { Name = counterName, Condition = ThresholdCondition.Above, Value = upperBound });

            this.collector = info.Create();
        }
Ejemplo n.º 2
0
        public Alert(string name, double lowerBound, double upperBound)
        {
            CounterAlertInfo info = new CounterAlertInfo("AlertSample");

            info.SampleInterval = TimeSpan.FromSeconds(3.0d);

            CounterName counterName = new CounterName()
            {
                Category = "Process", Counter = "IO Data Operations/sec", Instance = "AlertSample.App#1"
            };

            info.Thresholds.Add(new CounterThreshold()
            {
                Name = counterName, Condition = ThresholdCondition.Below, Value = lowerBound
            });
            info.Thresholds.Add(new CounterThreshold()
            {
                Name = counterName, Condition = ThresholdCondition.Above, Value = upperBound
            });

            this.collector = info.Create();
        }