豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 6316e99

Browse files
authored
Merge pull request #3019 from davkean/TimerId
Put constant into own class
2 parents b7f8edb + a0b27bd commit 6316e99

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2+
3+
using Microsoft.Internal.Performance;
4+
5+
namespace Microsoft.VisualStudio
6+
{
7+
/// <summary>
8+
/// Represents timer IDs that are passed to <see cref="CodeMarkers.CodeMarker"/>.
9+
/// </summary>
10+
internal static class CodeMarkerTimerId
11+
{
12+
/// <summary>
13+
/// Indicates that NuGet package restore has finished.
14+
/// </summary>
15+
public const int PerfPackageRestoreEnd = 7343;
16+
}
17+
}

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/NuGet/NuGetRestorer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal class NuGetRestorer : OnceInitializedOnceDisposedAsync
2525
private readonly IActiveProjectConfigurationRefreshService _activeProjectConfigurationRefreshService;
2626
private IDisposable _targetFrameworkSubscriptionLink;
2727
private DisposableBag _designTimeBuildSubscriptionLink;
28-
private const int perfPackageRestoreEnd = 7343;
28+
2929

3030
private static ImmutableHashSet<string> _targetFrameworkWatchedRules = Empty.OrdinalIgnoreCaseStringSet
3131
.Add(NuGetRestore.SchemaName);
@@ -171,7 +171,7 @@ await _solutionRestoreService
171171
_projectVsServices.Project.Services.ProjectAsynchronousTasks.UnloadCancellationToken)
172172
.ConfigureAwait(false);
173173

174-
CodeMarkers.Instance.CodeMarker(perfPackageRestoreEnd);
174+
CodeMarkers.Instance.CodeMarker(CodeMarkerTimerId.PerfPackageRestoreEnd);
175175

176176
}),
177177
ProjectCriticalOperation.Build | ProjectCriticalOperation.Unload | ProjectCriticalOperation.Rename,

0 commit comments

Comments
 (0)