Skip to content

Commit

Permalink
use actual type instead of var
Browse files Browse the repository at this point in the history
  • Loading branch information
chunyu3 committed Apr 28, 2022
1 parent 55e1add commit ec265d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sdk/template/Azure.Template/perf/TemplateClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TemplateClientTest : PerfTest<TemplateClientTest.TemplateClientPerf

public TemplateClientTest(TemplateClientPerfOptions options) : base(options)
{
var keyVaultUri = GetEnvironmentVariable("KEYVAULT_URL");
string keyVaultUri = GetEnvironmentVariable("KEYVAULT_URL");
_templateClient = new TemplateClient(keyVaultUri, new DefaultAzureCredential());
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/template/Azure.Template/src/TemplateClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class TemplateClient
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual async Task<Response<SecretBundle>> GetSecretValueAsync(string secretName, CancellationToken cancellationToken = default)
{
using var scope = ClientDiagnostics.CreateScope("TemplateClient.GetSecretValue");
using DiagnosticScope scope = ClientDiagnostics.CreateScope("TemplateClient.GetSecretValue");
scope.Start();

try
Expand All @@ -46,7 +46,7 @@ public virtual async Task<Response<SecretBundle>> GetSecretValueAsync(string sec
/// <param name="cancellationToken"> The cancellation token to use. </param>
public virtual Response<SecretBundle> GetSecretValue(string secretName, CancellationToken cancellationToken = default)
{
using var scope = ClientDiagnostics.CreateScope("TemplateClient.GetSecretValue");
using DiagnosticScope scope = ClientDiagnostics.CreateScope("TemplateClient.GetSecretValue");
scope.Start();

try
Expand Down
7 changes: 4 additions & 3 deletions sdk/template/Azure.Template/stress/TemplateClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Azure.Identity;
using Azure.Test.Stress;
using CommandLine;
using Azure.Template.Models;

namespace Azure.Template.Stress
{
Expand All @@ -18,8 +19,8 @@ public TemplateClientTest(TemplateClientStressOptions options, TemplateClientStr

public override async Task RunAsync(CancellationToken cancellationToken)
{
var keyVaultUri = GetEnvironmentVariable("KEYVAULT_URL");
var client = new TemplateClient(keyVaultUri, new DefaultAzureCredential());
string keyVaultUri = GetEnvironmentVariable("KEYVAULT_URL");
TemplateClient client = new TemplateClient(keyVaultUri, new DefaultAzureCredential());

while (!cancellationToken.IsCancellationRequested)
{
Expand All @@ -28,7 +29,7 @@ public override async Task RunAsync(CancellationToken cancellationToken)
// Throttle requests to avoid exceeding service limits
await Task.Delay(TimeSpan.FromMilliseconds(Options.Delay), cancellationToken);

var secret = await client.GetSecretValueAsync(Options.SecretName, cancellationToken);
Response<SecretBundle> secret = await client.GetSecretValueAsync(Options.SecretName, cancellationToken);
Interlocked.Increment(ref Metrics.SecretsReceived);

if (secret.Value.Value == "TestValue")
Expand Down

0 comments on commit ec265d2

Please sign in to comment.