Configure the Performance Monitor
Clone this wiki locally
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
Adminstrator access is required. (You may need to specify the full path of the dll.)
Edit your configuration file, and add the
<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.
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
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.