Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging pmaytak/perf #636

Merged
merged 23 commits into from
Oct 2, 2020
Merged

Merging pmaytak/perf #636

merged 23 commits into from
Oct 2, 2020

Conversation

pmaytak
Copy link
Contributor

@pmaytak pmaytak commented Sep 30, 2020

Merges only test related changes. Merge perf client and benchmark project. Includes Henrik's test runner changes.

Note: Will fix integration tests after merge.

#88

pmaytak and others added 19 commits September 30, 2020 12:24
…ve operations. Added loop counter to test runner.
* Perf project.

* Add TestController.

* Added Perf.Client project that creates and HttpClient and sends requests with a previously acquired token.

* Updated to not using the token array. Small logging fixes.

* Mostly updated to use AcquireTokenSilent instead of Tokens array.

* Added a duration check to the inner loop.

* Disable JWT Handler debug messages. Add Accept header.

* Added empty action to weather controller.

* serialize msal cache + add timers

* Added three controllers with different dependencies to IntegrationTestServices. Minor TestRunner refactor.

* Update Kesterl Url.

* add msal logs

* updates to perf testing w/app services

* use distributed cache

* fix constants in test

* fix controller action

* remove memory cache updates & fix test

* try to fix tests

* adding in timers around msal cache lookup

* update testrunner part 5

* one more

* Jmprieur/perf with scalable Public Client Application cache (#614)

* Adding a scalable token cache that writes each entry
in a different file

* Moving the PCA creation in the loop
to avoid the cache to grow (MSAL perf bug)

* Adding comments

Co-authored-by: jennyf19 <jeferrie@microsoft.com>

* Fixing a couple of issues:
- the AddMemoryCache override that takes a delegate does not accept null (fix done by Jenny lost in translation)
- In the test runner allows to reduce the number of users

Simplifying the matrix:
- the UI test does not need to be on several frameworks (as it's not what is being tested)
- the Integration test either (as the web API is only netcoreapp3.1)

* Fixing the build

Co-authored-by: pmaytak <34331512+pmaytak@users.noreply.github.com>
Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>
* changes to test runner

* fix user start value + add app insights logging

* Update MicrosoftIdentityAppCallingWebApiAuthenticationBuilder.cs

Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>
…ource with the new files. Added counters to App Insights telemetry.
* changes to test runner

* fix user start value + add app insights logging

* In memory db for test runner, and resilience in the test run itself, ensuring the runner continues to run until canceled by esc, or ctrl + c or ctrl + x

* remove copy

* update runner to not stop

* Fix issue updating cache after refresh from AAD. Also update title to reflect summary of status

* Added persistence of cache after each loop and loading of cache on start-up. This minimizes disk operations and enables restarting the console with-out having to fetch tokens again if those are still valid

* Enable persistence if token was not obtained from cache

* Testing Parallel.For and adding locks around file persistence. Cache and logging both are not threadsafe atm and will need more work.

* Parrallel.For and Some persistence. Including a small pause between loops.

* limiting persistence

* removing parralel

* Minor clean-up. Removing parrallel'ism. Requires more work and refactorings to make safe. Still not great code but better than previous iterations.

* Update output display for test runner

Co-authored-by: Jennyf19 <jeferrie@microsoft.com>
Co-authored-by: Henrik Metzger <henrikm@microsoft.com>
Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@jennyf19
Copy link
Collaborator

jennyf19 commented Oct 1, 2020

will wait to review when integration tests are fixed.

… IntegrationTestService to new project PerformanceTestService.
@pmaytak
Copy link
Contributor Author

pmaytak commented Oct 1, 2020

@jennyf19 Integration test is fixed. I moved perf related code from IntegrationTestService to new project PerformanceTestService.

@jennyf19
Copy link
Collaborator

jennyf19 commented Oct 1, 2020

I assume this is the same as what @jmprieur committed...i just skipped reviewing it as I had previously when i pulled his changes.


Refers to: tests/PerformanceTests/Microsoft.Identity.Web.Perf.Client/ScalableTokenCacheHelper.cs:201 in aa4a04f. [](commit_id = aa4a04f, deletion_comment = False)

@jennyf19
Copy link
Collaborator

jennyf19 commented Oct 1, 2020

using Microsoft.AspNetCore.Authorization;

license info.


Refers to: tests/PerformanceTests/PerformanceTestService/Controllers/EmptyController.cs:1 in aa4a04f. [](commit_id = aa4a04f, deletion_comment = False)

@jennyf19
Copy link
Collaborator

jennyf19 commented Oct 1, 2020

using Microsoft.AspNetCore.Authorization;

license info.


Refers to: tests/PerformanceTests/PerformanceTestService/Controllers/GraphClientController.cs:1 in aa4a04f. [](commit_id = aa4a04f, deletion_comment = False)

@jennyf19
Copy link
Collaborator

jennyf19 commented Oct 1, 2020

using Microsoft.AspNetCore.Authorization;

license info.


Refers to: tests/PerformanceTests/PerformanceTestService/Controllers/TokenAcquisitionController.cs:1 in aa4a04f. [](commit_id = aa4a04f, deletion_comment = False)

@jennyf19
Copy link
Collaborator

jennyf19 commented Oct 1, 2020

there were some changes made to the msalInMemoryTokenCacheProvider & one other class in my previous branch, but i'll go back and add those in after you merge.


In reply to: 702424303 [](ancestors = 702424303)

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@pmaytak pmaytak merged commit d499f34 into master Oct 2, 2020
Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmaytak : I propose a few changes

@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we needs this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll verify if we need it.

[ApiController]
[Authorize]
[Route("SecurePage")]
public class WeatherForecastController : ControllerBase
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to rename the file and the class tio SecurePageController ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I'll refactor the naming.

/// <summary>
/// Adds benchmarking counters on top of <see cref="MsalDistributedTokenCacheAdapter"/>.
/// </summary>
public class BenchmarkMsalDistributedTokenCacheAdapter : MsalDistributedTokenCacheAdapter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's used in place of normal distributed cache class.

@pmaytak pmaytak deleted the pmaytak/perf branch October 6, 2020 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants