Skip to content

Commit

Permalink
Fix find PerformanceCounterInstance
Browse files Browse the repository at this point in the history
It does not always 'startswith' - running as application or debugging on my win81
pc the Instancename is:
'Raven.Server.vshost/1-UxBsU-C:\Users\SteinArild\Source\Repos\RavenDb\build\Database'
trying to match uniquePrefix = '1-UxBsU'
  • Loading branch information
steinho committed Feb 1, 2014
1 parent f4252ff commit 20d8126
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Raven.Database/Storage/Esent/TransactionalStorage.cs
Expand Up @@ -207,7 +207,7 @@ public long GetDatabaseTransactionVersionSizeInBytes()
return getDatabaseTransactionVersionSizeInBytesErrorValue = -1; return getDatabaseTransactionVersionSizeInBytesErrorValue = -1;
var category = new PerformanceCounterCategory(categoryName); var category = new PerformanceCounterCategory(categoryName);
var instances = category.GetInstanceNames(); var instances = category.GetInstanceNames();
var ravenInstance = instances.FirstOrDefault(x => x.StartsWith(uniquePrefix)); var ravenInstance = instances.FirstOrDefault(x => x.Contains(uniquePrefix));
const string counterName = "Version Buckets Allocated"; const string counterName = "Version Buckets Allocated";
if (ravenInstance == null || !category.CounterExists(counterName)) if (ravenInstance == null || !category.CounterExists(counterName))
{ {
Expand Down

0 comments on commit 20d8126

Please sign in to comment.