Skip to content

Commit

Permalink
update brokerbenchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
keyuxuan committed Aug 21, 2024
1 parent 33262e2 commit 883b8bc
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/MSALWrapper.Benchmark/BrokerBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public BrokerBenchmark()
public void WarmUp()
{
NativeBrokerBenchmark();
ManagedBrokerBenchmark();
}

/// <summary>
Expand All @@ -53,27 +52,14 @@ public void WarmUp()
[Benchmark]
public void NativeBrokerBenchmark()
{
var pcaWrapper = BuildPCAWrapper(this.logger, this.clientID, this.tenantID, true);
var pcaWrapper = BuildPCAWrapper(this.logger, this.clientID, this.tenantID);
AuthParameters authParameters = new AuthParameters(this.clientID, this.tenantID, this.scopes);
Broker broker = new Broker(this.logger, authParameters, pcaWrapper: pcaWrapper);

broker.GetTokenAsync().Wait();
}

/// <summary>
/// Benchmark with .Net managed broker.
/// </summary>
[Benchmark]
public void ManagedBrokerBenchmark()
{
var pcaWrapper = BuildPCAWrapper(this.logger, this.clientID, this.tenantID, false);
AuthParameters authParameters = new AuthParameters(this.clientID, this.tenantID, this.scopes);
Broker broker = new Broker(this.logger, authParameters, pcaWrapper: pcaWrapper);

broker.GetTokenAsync().Wait();
}

private IPCAWrapper BuildPCAWrapper(ILogger logger, Guid clientId, Guid tenantId, bool useNativeBroker)
private IPCAWrapper BuildPCAWrapper(ILogger logger, Guid clientId, Guid tenantId)
{
IList<Exception> errors = new List<Exception>();

Expand Down

0 comments on commit 883b8bc

Please sign in to comment.