Skip to content

Commit

Permalink
new tweaks to generate logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nachocodoner committed Jul 24, 2024
1 parent 06a16ad commit 2cad676
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/
logs
2 changes: 1 addition & 1 deletion artillery/reactive-stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config:
target: http://localhost:3000
phases:
- duration: 60
arrivalRate: 5
arrivalRate: 4
name: Warm up
ensure:
maxErrorRate: 1
Expand Down
6 changes: 6 additions & 0 deletions monitor.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/usr/bin/env bash


# app. Application directory name within ./apps/*
# script. Artillery script name within ./artillery/*
app="${1}"
script="${2}"
logName="${3:-''}"
if [[ -z "$app" ]] || [[ -z "$script" ]]; then
echo "Usage: monitor.sh <app_name> <script_name>"
exit 1;
fi

# Redirect stdout (1) and stderr (2) to a file
mkdir -p logs
exec > ./logs/${logName}-${app}-${script}.log 2>&1

# Initialize script constants
baseDir="${PWD}"
appsDir="${baseDir}/apps"
Expand Down
4 changes: 2 additions & 2 deletions tests/test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const addAndRemoveTasks = async ({ page, reactive, taskCount }) => {
};

async function reactiveAddAndRemoveTasks(page) {
const taskCount = parseFloat(process.env.TASK_COUNT || 25);
const taskCount = parseFloat(process.env.TASK_COUNT || 20);
await addAndRemoveTasks({ page, reactive: false, taskCount });
}

async function nonReactiveAddAndRemoveTasks(page) {
const taskCount = parseFloat(process.env.TASK_COUNT || 25);
const taskCount = parseFloat(process.env.TASK_COUNT || 20);
await addAndRemoveTasks({ page, reactive: true, taskCount });
}

Expand Down

0 comments on commit 2cad676

Please sign in to comment.