Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openwhisk-runtime-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Groundhog
openwhisk-runtime-python
Commits
47bb4997
Commit
47bb4997
authored
8 years ago
by
Perry
Committed by
Rodric Rabbah
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove throttle tightening.
parent
d24c257d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/limits/ThrottleTests.scala
+9
-6
9 additions, 6 deletions
tests/src/limits/ThrottleTests.scala
with
9 additions
and
6 deletions
tests/src/limits/ThrottleTests.scala
+
9
−
6
View file @
47bb4997
...
@@ -99,7 +99,6 @@ class ThrottleTests
...
@@ -99,7 +99,6 @@ class ThrottleTests
* @param results the sequence of results from invocations or firings
* @param results the sequence of results from invocations or firings
*/
*/
def
waitForActivations
(
results
:
ParSeq
[
RunResult
])
=
results
.
foreach
{
result
=>
def
waitForActivations
(
results
:
ParSeq
[
RunResult
])
=
results
.
foreach
{
result
=>
println
(
"waiting for activations to complete"
)
if
(
result
.
exitCode
==
SUCCESS_EXIT
)
{
if
(
result
.
exitCode
==
SUCCESS_EXIT
)
{
withActivation
(
wsk
.
activation
,
result
,
totalWait
=
5.
minutes
)(
identity
)
withActivation
(
wsk
.
activation
,
result
,
totalWait
=
5.
minutes
)(
identity
)
}
}
...
@@ -135,6 +134,9 @@ class ThrottleTests
...
@@ -135,6 +134,9 @@ class ThrottleTests
val
results
=
List
.
fill
(
count
)(
Future
{
val
results
=
List
.
fill
(
count
)(
Future
{
if
(!
p
.
isCompleted
)
{
if
(!
p
.
isCompleted
)
{
val
rr
=
run
()
val
rr
=
run
()
if
(
rr
.
exitCode
!=
SUCCESS_EXIT
)
{
println
(
s
"exitCode = ${rr.exitCode} stderr = ${rr.stderr.trim}"
)
}
if
(
rr
.
exitCode
==
THROTTLED
)
{
if
(
rr
.
exitCode
==
THROTTLED
)
{
p
.
trySuccess
(())
p
.
trySuccess
(())
}
}
...
@@ -168,9 +170,10 @@ class ThrottleTests
...
@@ -168,9 +170,10 @@ class ThrottleTests
(
action
,
_
)
=>
action
.
create
(
name
,
defaultAction
)
(
action
,
_
)
=>
action
.
create
(
name
,
defaultAction
)
}
}
// T
wo
things to be careful of:
// T
hree
things to be careful of:
// 1) We do not know the minute boundary so we perform twice max so that it will trigger no matter where they fall
// 1) We do not know the minute boundary so we perform twice max so that it will trigger no matter where they fall
// 2) We cannot issue too quickly or else the concurrency throttle will be triggered
// 2) We cannot issue too quickly or else the concurrency throttle will be triggered
// 3) In the worst case, we do about almost the limit in the first min and just exceed the limit in the second min.
val
totalInvokes
=
2
*
maximumInvokesPerMinute
val
totalInvokes
=
2
*
maximumInvokesPerMinute
val
numGroups
=
(
totalInvokes
/
maximumConcurrentInvokes
)
+
1
val
numGroups
=
(
totalInvokes
/
maximumConcurrentInvokes
)
+
1
val
invokesPerGroup
=
(
totalInvokes
/
numGroups
)
+
1
val
invokesPerGroup
=
(
totalInvokes
/
numGroups
)
+
1
...
@@ -186,11 +189,11 @@ class ThrottleTests
...
@@ -186,11 +189,11 @@ class ThrottleTests
try
{
try
{
val
throttledCount
=
throttledActivations
(
results
,
tooManyRequests
)
val
throttledCount
=
throttledActivations
(
results
,
tooManyRequests
)
throttledCount
should
be
>
0
throttledCount
should
be
>
0
throttledCount
should
be
<=
(
results
.
length
-
maximumInvokesPerMinute
)
}
finally
{
}
finally
{
waitForActivations
(
results
.
par
)
val
alreadyWaited
=
durationBetween
(
afterInvokes
,
Instant
.
now
)
val
alreadyWaited
=
durationBetween
(
afterInvokes
,
Instant
.
now
)
settleThrottles
(
alreadyWaited
)
settleThrottles
(
alreadyWaited
)
println
(
"clearing activations"
)
Try
{
waitForActivations
(
results
.
par
)
}
}
}
}
}
...
@@ -210,7 +213,6 @@ class ThrottleTests
...
@@ -210,7 +213,6 @@ class ThrottleTests
try
{
try
{
val
throttledCount
=
throttledActivations
(
results
,
tooManyRequests
)
val
throttledCount
=
throttledActivations
(
results
,
tooManyRequests
)
throttledCount
should
be
>
0
throttledCount
should
be
>
0
throttledCount
should
be
<=
(
results
.
length
-
maximumFiringsPerMinute
)
}
finally
{
}
finally
{
// no need to wait for activations of triggers since they consume no resources
// no need to wait for activations of triggers since they consume no resources
// (because there is no rule attached in this test)
// (because there is no rule attached in this test)
...
@@ -261,9 +263,10 @@ class ThrottleTests
...
@@ -261,9 +263,10 @@ class ThrottleTests
val
throttledCount
=
throttledActivations
(
combinedResults
,
tooManyConcurrentRequests
)
val
throttledCount
=
throttledActivations
(
combinedResults
,
tooManyConcurrentRequests
)
throttledCount
should
be
>
0
throttledCount
should
be
>
0
}
finally
{
}
finally
{
waitForActivations
(
combinedResults
.
par
)
val
alreadyWaited
=
durationBetween
(
afterSlowInvokes
,
Instant
.
now
)
val
alreadyWaited
=
durationBetween
(
afterSlowInvokes
,
Instant
.
now
)
settleThrottles
(
alreadyWaited
)
settleThrottles
(
alreadyWaited
)
println
(
"clearing activations"
)
Try
{
waitForActivations
(
combinedResults
.
par
)
}
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment