зеркало из https://github.com/microsoft/BuildXL.git
Merged PR 523773: Fix NRE when asking for GetStats with a failed startup
This commit is contained in:
Родитель
18bc4c5411
Коммит
66cc175a00
|
@ -1192,14 +1192,21 @@ namespace BuildXL.Cache.ContentStore.Stores
|
|||
|
||||
if (StartupCompleted)
|
||||
{
|
||||
counters.Add($"{CurrentByteCountName}", QuotaKeeper.CurrentSize);
|
||||
counters.Add($"{CurrentFileCountName}", await ContentDirectory.GetCountAsync());
|
||||
counters.Merge(ContentDirectory.GetCounters(), "ContentDirectory.");
|
||||
|
||||
var quotaKeeperCounter = QuotaKeeper.Counters;
|
||||
if (quotaKeeperCounter != null)
|
||||
if (QuotaKeeper != null)
|
||||
{
|
||||
counters.Merge(quotaKeeperCounter.ToCounterSet());
|
||||
counters.Add($"{CurrentByteCountName}", QuotaKeeper.CurrentSize);
|
||||
|
||||
var quotaKeeperCounter = QuotaKeeper.Counters;
|
||||
if (quotaKeeperCounter != null)
|
||||
{
|
||||
counters.Merge(quotaKeeperCounter.ToCounterSet());
|
||||
}
|
||||
}
|
||||
|
||||
if (ContentDirectory != null)
|
||||
{
|
||||
counters.Add($"{CurrentFileCountName}", await ContentDirectory.GetCountAsync());
|
||||
counters.Merge(ContentDirectory.GetCounters(), "ContentDirectory.");
|
||||
}
|
||||
}
|
||||
return new GetStatsResult(counters);
|
||||
|
|
Загрузка…
Ссылка в новой задаче