-
Notifications
You must be signed in to change notification settings - Fork 359
Configure the Performance Monitor
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.
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.
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>
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>
The MembaseClient requires the Membase.Configuration.IMembasePerformanceMonitorFactory
to be implemented. This factory also returns an IPerformanceMonitor instance, so existing monitors can be used.