Skip to content
This repository has been archived by the owner on Jul 7, 2019. It is now read-only.

Configure the Performance Monitor

enyim edited this page Dec 29, 2010 · 4 revisions

The client now supports collecting statistics about each operation on a per-client basis.

The included DefaultPerformanceMonitor uses the Windows performance counters to log these statistics. Each operation (Get, Set, Store, etc.) has Total, Total/sec, Hits, Hits/sec, Misses and Misses/sec counters.

Enabling the default performance monitor

At first the performance counters must be installed. This can be achieved by using installutil:

C:\"%SYSTEMROOT%\Microsoft.Net\Framework\v2.0.50727\InstallUtil.exe" Enyim.Caching.dll

Adminstrator access is required. (You may need to specify the full path of the dll.)

Edit your configuration file, and add the performanceMonitor element:

	  <enyim.com>
	    <memcached>
			...
	      <performanceMonitor factory="Enyim.Caching.Memcached.DefaultPerformanceMonitorFactory, Enyim.Caching" name="enter a name"/>
	    </memcached>
	  </enyim.com>

The name attribute will be used as the instance name for the counters. It is required and must be different for each configuration.

Membase client

The MembaseClient automatically uses the bucket name for the instance name, thus its configuration is different. (It uses a different factory.)

	  <membase>
			...
	      <performanceMonitor factory="Membase.Configuration.DefaultPerformanceMonitorFactory, Membase" />
	  </membase>

Implementing a custom performance monitor

To provide custom monitoring the Enyim.Caching.Memcached.IPerformanceMonitor interface must be implemented. If the monitor requires custom initialization an additional factory must created by implementing the IProviderFactory<IPerfomanceMonitor> interface.

Registering the monitor (no custom initialization):

	  <enyim.com>
	    <memcached>
			...
	      <performanceMonitor type="fully qualified name of the performance monitor"/>
	    </memcached>
	  </enyim.com>

Registering the monitor with a factory:

	  <enyim.com>
	    <memcached>
			...
	      <performanceMonitor factory="fully qualified name of the performance monitor factpry" customArg1="value" customArg2="value" />
	    </memcached>
	  </enyim.com>

Implementing a custom performance monitor for Membase

The MembaseClient requires the Membase.Configuration.IMembasePerformanceMonitorFactory to be implemented. This factory also returns an IPerformanceMonitor instance, so existing monitors can be used.