Skip to content

Commit

Permalink
Multiple sleet to avoit stall, configurable time window in query
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnedMarshal committed Jan 13, 2025
1 parent 9e42070 commit 2152d62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/_function_app_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ on:
description: Time between canary traffic increment steps
type: number
required: false
default: 300000
default: 100000
concurrency:
group: ${{ github.workflow }}-cd
cancel-in-progress: true
Expand Down Expand Up @@ -251,7 +251,17 @@ jobs:
# Wait the specified time before the next iteration
delaySeconds=$((afterMs / 1000))
echo "Waiting for $delaySeconds seconds..."
sleep $delaySeconds

while [ "$delaySeconds" -gt 0 ]; do
if [ "$delaySeconds" -gt 10 ]; then
sleep 10
delaySeconds=$((delaySeconds - 10))
echo "Waiting for $delaySeconds seconds..."
else
sleep "$delaySeconds"
delaySeconds=0
fi
done

# If nextIncrementPercentage reach 100
# the loop is interrupted
Expand Down
4 changes: 3 additions & 1 deletion apps/io-web-profile/src/deployment/canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const params: RequestsQueryParams[] = [
{
query: `
AppRequests
| where TimeGenerated > ago(5m)
| where TimeGenerated > ago(${Math.floor(
canaryConfig.CANARY_NEXT_STEP_AFTER_MS / 1000
)}s)
| where AppRoleName == "${canaryConfig.FUNCTION_APP_NAME}-staging"
| summarize totalRequests = count(), failedRequests = countif(toint(ResultCode) > 499)
`,
Expand Down

0 comments on commit 2152d62

Please sign in to comment.