Esempio n. 1
0
 internal AlertsObserver(HealthMonitor monitor, AlertCollectorsBase collector)
 {
     healthMonitor = monitor;
     if (collector != null)
     {
         alertCollector = collector;
         if (alertCollector != null)
         {
             valueStorage = new List <double>(alertCollector.Duration);
         }
     }
     if (healthMonitor != null && healthMonitor.Context != null && healthMonitor.Context.CacheImpl != null)
     {
         cacheName = healthMonitor.Context.CacheImpl.Name;
     }
 }
Esempio n. 2
0
        void InitializeHealthDictionary(HealthAlerts healthAlerts)
        {
            if (healthAlerts != null)
            {
                foreach (DictionaryEntry data in healthAlerts.Resources)
                {
                    string collectorName = (string)data.Key;

                    if ((collectorName.ToLower().Equals(ResourceName.MIORRORQUEUEACTIVE) || collectorName.ToLower().Equals(ResourceName.BRIDGQQUEUE)) && (cacheContext.CacheImpl != null && !cacheContext.IsClusteredImpl))
                    {
                        continue;
                    }

                    AlertCollectorsBase collector = GetCollector(collectorName, (ResourceAtribute)data.Value);
                    alertDictionary.Add(collector, new AlertsObserver(this, collector));
                }
            }
        }
Esempio n. 3
0
        AlertCollectorsBase GetCollector(string collectorName, ResourceAtribute data)
        {
            AlertCollectorsBase collector = null;
            string counterName, name;
            int    eventID = 0;

            switch (collectorName)
            {
            case ResourceName.MEMORY:
                collector = new MemoryUsageCollector(data, cacheContext);
                break;

            case ResourceName.NETWORK:
                collector = new NetworkUsageCollector(data, cacheContext);
                break;

            case ResourceName.CPU:
                collector = new CPUUsageCollector(data, cacheContext);
                break;

            case ResourceName.REQUESTPERSEC:
                counterName = "Requests/sec";
                name        = counterName;
                eventID     = EventID.RequestsAlert;

                collector = new SocketResourcesCollector(counterName, name, eventID, data, cacheContext);
                break;

            case ResourceName.CLIENTCONNECTION:
                counterName = "# Clients";
                name        = "Connected Clients";
                eventID     = EventID.ClientConnectionAlert;

                collector = new SocketResourcesCollector(counterName, name, eventID, data, cacheContext, true);
                break;

            case ResourceName.MIORRORQUEUEACTIVE:
                counterName = "Mirror queue size";
                name        = "Mirror Queue";
                eventID     = EventID.MirrorQueueAlert;

                collector = new CacheResourcesCollector(counterName, name, eventID, data, cacheContext, true);
                break;

            case ResourceName.MIORRORQUEUEREPLICA:
                counterName = "Mirror queue size";
                name        = "Mirror Queue (Replica)";
                eventID     = EventID.MirrorQueueAlert;

                collector = new CacheResourcesCollector(counterName, name, eventID, data, cacheContext, true);
                break;

            case ResourceName.WRITEBEHINDQUEUE:

                counterName = "Write-behind queue count";
                name        = "Write Behind Queue";
                eventID     = EventID.WriteBehindQueueAlert;

                collector = new CacheResourcesCollector(counterName, name, eventID, data, cacheContext, true);
                break;

            case ResourceName.AERAGECACHEOPERATIONS:

                counterName = "Average us/cache operation";
                name        = counterName;
                eventID     = EventID.AverageCacheOperations;

                collector = new CacheResourcesCollector(counterName, name, eventID, data, cacheContext);
                break;
            }
            return(collector);
        }