Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,25 @@ For testing how onlylogs behaves under production-like network conditions, you c
./bin/simulate_latency disable
```

### Performance Testing

Performance tests require large log files that are not included in the repository. You can download them using the provided script:

```bash
bin/download_performance_fixtures
```

This will download `big.log`, `ultra_big.log`, and `very_big.log` to `test/fixtures/files/`.

Once the fixtures are downloaded, you can run the performance tests locally:

```bash
bin/rails test test/models/onlylogs/grep_performance_test.rb
```

> [!NOTE]
> Performance tests are automatically skipped in CI environments or if the large fixture files are missing.

### Plans for the future

We believe that by simply analysing your logs you can also have a fancy errors report.
Expand Down
27 changes: 27 additions & 0 deletions bin/download_performance_fixtures
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# Set output directory relative to this script
FIXTURES_DIR="$(dirname "$0")/../test/fixtures/files"
mkdir -p "$FIXTURES_DIR"

FILES=(
"https://onlylogs-files.s3.eu-central-1.amazonaws.com/big.log"
"https://onlylogs-files.s3.eu-central-1.amazonaws.com/ultra_big.log"
"https://onlylogs-files.s3.eu-central-1.amazonaws.com/very_big.log"
)

echo "Downloading performance test fixtures to $FIXTURES_DIR..."

for url in "${FILES[@]}"; do
filename=$(basename "$url")
target="$FIXTURES_DIR/$filename"

if [ -f "$target" ]; then
echo "Check: $filename already exists. Skipping..."
else
echo "Downloading $filename..."
curl -L "$url" -o "$target"
fi
done

echo "Done! Performance fixtures are ready."
Loading