Permalink
Browse files

Fix find PerformanceCounterInstance

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...
1 parent f4252ff commit 20d81265c31e472c15f054dc19dead77bb2cf5c9 Stein Arild Hoem committed Feb 1, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 Raven.Database/Storage/Esent/TransactionalStorage.cs
@@ -207,7 +207,7 @@ public long GetDatabaseTransactionVersionSizeInBytes()
return getDatabaseTransactionVersionSizeInBytesErrorValue = -1;
var category = new PerformanceCounterCategory(categoryName);
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";
if (ravenInstance == null || !category.CounterExists(counterName))
{

0 comments on commit 20d8126

Please sign in to comment.