private CachingServiceItemTurnoverEvent(string[] counterNames)
        {
            InstrumentedEvent internalEvent;

            internalEvent = new InstrumentedEvent(SR.CachingInstrumentationCounterCategory,
                                                  counterNames,
                                                  true);

            turnOverInstances = internalEvent.GetPerformanceCounterInstances(SR.PerfCounterCacheTurnoverRate);
            totalEntriesInstances = internalEvent.GetPerformanceCounterInstances(SR.PerfCounterTotalCacheEntries);
        }
Ejemplo n.º 2
0
        private void AddPerformanceCounter(string category, string[] counterNames, bool createNewInstance)
        {
            int count = counterNames.Length;

            if (count <= 0)
            {
                return;
            }

            this.perfCounters = new PerformanceCounterInstances[count];

            for (int i = 0; i < count; i++)
            {
                PerformanceCounterInstances instances = new PerformanceCounterInstances(category, counterNames[i], createNewInstance);
                this.perfCounters[i] = instances;
            }
        }
Ejemplo n.º 3
0
        private void AddPerformanceCounter(string category, string[] counterNames, bool createNewInstance)
        {
            int count = counterNames.Length;
            if (count <= 0)
            {
                return;
            }

            this.perfCounters = new PerformanceCounterInstances[count];

            for (int i = 0; i < count; i++)
            {
                PerformanceCounterInstances instances = new PerformanceCounterInstances(category, counterNames[i], createNewInstance);
                this.perfCounters[i] = instances;
            }
        }
Ejemplo n.º 4
0
        /// <summary/>
        /// <param name="message"/>
        /// <param name="counterInstancesArray"/>
        /// <param name="counterValues"/>
        /// <exclude/>
        /// <devdoc>
        /// This method Increment the performance counters, update the timer counter, and write to event logs.
        /// </devdoc>        
        public void FireEvent(string message, PerformanceCounterInstances[] counterInstancesArray, long[] counterValues)
        {
            int index = 0;
            for (index = 0; index < perfCounters.Length; ++index)
            {
                bool found = false;

                for (int i = 0; i < counterInstancesArray.Length && !found; i++)
                {
                    if (counterInstancesArray[i] == perfCounters[index])
                    {
                        found = true;
                        perfCounters[index].IncrementByCore(counterValues[i]);
                    }
                }
                if (!found)
                {
                    perfCounters[index].Increment();
                }
            }
            for (index = 0; index < eventLoggers.Length; ++index)
            {
                eventLoggers[index].Log(message);
            }
        }
Ejemplo n.º 5
0
        /// <summary/>
        /// <param name="message"/>
        /// <param name="counterInstances"/>
        /// <param name="values"/>
        /// <exclude/>
        /// <devdoc>
        /// Fires the internal Aux Event with the message to include in the event and event log entry type
        /// </devdoc>
        protected void FireAuxEvent(string message, PerformanceCounterInstances[] counterInstances, long[] values)
        {
            if (internalEvent == null)
            {
                return;
            }

            internalEvent.FireEvent(message, counterInstances, values);
        }