pingtimeout commented on code in PR #6:
URL: https://github.com/apache/polaris-tools/pull/6#discussion_r2050837138
##########
benchmarks/src/gatling/scala/org/apache/polaris/benchmarks/simulations/CreateTreeDataset.scala:
##########
@@ -64,11 +67,31 @@ class CreateTreeDataset extends Simulation {
private val createdViews = new AtomicInteger()
//
--------------------------------------------------------------------------------
- // Workload: Authenticate and store the access token for later use
+ // Authentication related workloads:
+ // * Authenticate and store the access token for later use every minute
+ // * Wait for an OAuth token to be available
+ // * Stop the token refresh loop
//
--------------------------------------------------------------------------------
- val authenticate: ScenarioBuilder = scenario("Authenticate using the OAuth2
REST API endpoint")
- .feed(authenticationActions.feeder())
- .exec(authenticationActions.authenticateAndSaveAccessToken)
+ val continuouslyRefreshOauthToken: ScenarioBuilder =
+ scenario("Authenticate every minute using the Iceberg REST API")
+ .asLongAs(_ => shouldRefreshToken.get())(
+ feed(authenticationActions.feeder())
+ .exec(authenticationActions.authenticateAndSaveAccessToken)
+ .pause(1.minute)
Review Comment:
Well, we could but it would be a tricky parameter.
This action is equivalent to an uninterruptible sleep. So in the worse
case, with this 1 minute value, Gatling will continue running for nothing
during 60 seconds after the last response from all other queries has been
received.
If we make this parameter, I can imagine how people would think that a token
needs be refreshed only every 30 minutes. And now they have to wait up to 30
minutes before the process actually completes.
I will likely give another try at this element in the future. Like, instead
of a 1 minute pause, run a loop of 60 "sleep 1s" actions with the same check `_
=> shouldRefreshToken.get()` that is done earlier. Or something similar.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]