Skip to content

Commit 8da25ce

Browse files
authored
Merge pull request microsoft#1896 from tyrielv/tyrielv/hydration-summary-warning-telemetry
Log hydration calculation errors to telemetry
2 parents 0d38953 + c909427 commit 8da25ce

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

GVFS/GVFS.Common/GitStatusCache.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,10 @@ private void UpdateHydrationSummary()
373373
}
374374
else
375375
{
376+
metadata["Exception"] = hydrationSummary.Error?.ToString();
376377
this.context.Tracer.RelatedWarning(
377378
metadata,
378-
$"{nameof(GitStatusCache)}{nameof(RebuildStatusCacheIfNeeded)}: hydration summary could not be calculdated.",
379+
$"{nameof(GitStatusCache)}{nameof(RebuildStatusCacheIfNeeded)}: hydration summary could not be calculated.",
379380
Keywords.Telemetry);
380381
}
381382
}

GVFS/GVFS.Common/HealthCalculator/EnlistmentHydrationSummary.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class EnlistmentHydrationSummary
1212
public int TotalFileCount { get; private set; }
1313
public int HydratedFolderCount { get; private set; }
1414
public int TotalFolderCount { get; private set; }
15+
public Exception Error { get; private set; } = null;
16+
1517

1618
public bool IsValid
1719
{
@@ -67,14 +69,15 @@ public static EnlistmentHydrationSummary CreateSummary(
6769
TotalFolderCount = totalFolderCount,
6870
};
6971
}
70-
catch
72+
catch (Exception e)
7173
{
7274
return new EnlistmentHydrationSummary()
7375
{
7476
HydratedFileCount = -1,
7577
HydratedFolderCount = -1,
7678
TotalFileCount = -1,
7779
TotalFolderCount = -1,
80+
Error = e,
7881
};
7982
}
8083
}

0 commit comments

Comments
 (0)