Skip to content

Commit 0a3e94e

Browse files
fix runner labels for ARM64 - use ubuntu-24.04-arm
1 parent fb24d6a commit 0a3e94e

File tree

6 files changed

+159
-2
lines changed

6 files changed

+159
-2
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
cybuerg/cfspeedtest:${{ github.sha }}-amd64
4646
4747
docker-build-arm64:
48-
runs-on: arm64-linux
48+
runs-on: ubuntu-24.04-arm
4949
steps:
5050
- uses: actions/checkout@v4
5151
- name: Build ARM64 Docker image

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
6969
docker-build-arm64:
7070
needs: [create-release, upload-assets]
71-
runs-on: arm64-linux
71+
runs-on: ubuntu-24.04-arm
7272
steps:
7373
- uses: actions/checkout@v4
7474
- name: Log in to DockerHub

CLAUDE.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
cfspeedtest is a Rust CLI tool that provides an unofficial client for speed.cloudflare.com. It performs network speed tests by downloading and uploading data to Cloudflare's servers and provides detailed statistics including latency measurements.
8+
9+
## Common Commands
10+
11+
### Development
12+
```bash
13+
# Build the project
14+
cargo build
15+
16+
# Run with debug logging
17+
RUST_LOG=debug cargo run
18+
19+
# Format code (required for CI)
20+
cargo fmt
21+
22+
# Run linter
23+
cargo clippy --all-targets --all-features
24+
25+
# Run tests
26+
cargo test
27+
28+
# Run examples
29+
cargo run --example simple_speedtest
30+
cargo run --example download_test
31+
cargo run --example latency_test
32+
```
33+
34+
### Release
35+
```bash
36+
# Create release (requires cargo-release)
37+
cargo release patch --execute
38+
39+
# Manual publish to crates.io
40+
cargo publish --dry-run
41+
cargo package --list
42+
cargo publish
43+
```
44+
45+
## Architecture
46+
47+
### Core Modules
48+
49+
- **`main.rs`**: Entry point that handles CLI argument parsing and HTTP client setup with IPv4/IPv6 support
50+
- **`lib.rs`**: Defines CLI options structure and output format enums
51+
- **`speedtest.rs`**: Core speed testing logic with download/upload functionality and payload size management
52+
- **`measurements.rs`**: Statistics calculation and output formatting (CSV, JSON, stdout)
53+
- **`boxplot.rs`**: ASCII boxplot rendering for verbose output
54+
- **`progress.rs`**: Progress bar implementation for test execution
55+
56+
### Key Components
57+
58+
**SpeedTestCLIOptions**: Main configuration struct with options for:
59+
- Test parameters (number of tests, payload sizes)
60+
- Output formats (CSV, JSON, pretty JSON, stdout)
61+
- Network settings (IPv4/IPv6 forcing)
62+
- Test types (download-only, upload-only, or both)
63+
64+
**PayloadSize enum**: Defines test payload sizes from 100KB to 100MB with string parsing
65+
66+
**TestType enum**: Distinguishes between Download and Upload tests
67+
68+
**Measurement struct**: Represents individual test results with test type, payload size, and speed in Mbit/s
69+
70+
### Test Flow
71+
72+
1. Initialize HTTP client with optional IPv4/IPv6 binding
73+
2. Run latency tests (25 by default)
74+
3. For each payload size (100KB to max configured):
75+
- Run download tests (10 by default)
76+
- Run upload tests (10 by default)
77+
- Calculate statistics (min, max, median, quartiles)
78+
- Optionally skip larger payloads if previous tests took >5 seconds
79+
4. Output results in requested format
80+
81+
### Output Formats
82+
83+
- **StdOut**: Human-readable with optional verbose boxplots
84+
- **CSV**: Comma-separated values for data analysis
85+
- **JSON/JsonPretty**: Machine-readable structured data
86+
87+
## Testing
88+
89+
The CI pipeline runs:
90+
- `cargo fmt -- --check` (formatting check)
91+
- `cargo build --verbose`
92+
- `cargo test --verbose`
93+
- All three examples
94+
- Full CLI execution
95+
- Clippy linting with warnings as errors
96+
97+
## Dependencies
98+
99+
Key external dependencies:
100+
- `reqwest`: HTTP client with blocking API and rustls-tls
101+
- `clap`: CLI argument parsing with derive features
102+
- `serde`: Serialization for JSON/CSV output
103+
- `csv`: CSV file generation
104+
- `regex`: URL pattern matching
105+
- `log`/`env_logger`: Debug logging support

pr204-review

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit fb24d6a08daddb8a52ecad069f4da12bb1829a95
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"blocks": [
3+
{
4+
"startTime": "2025-06-24T20:00:00.000Z",
5+
"endTime": "2025-06-25T01:00:00.000Z",
6+
"actualEndTime": "2025-06-24T21:14:30.973Z",
7+
"perModelStats": {
8+
"claude-sonnet-4-20250514": {
9+
"tokenCounts": {
10+
"inputTokens": 2346,
11+
"outputTokens": 926,
12+
"cacheCreationTokens": 86187,
13+
"cacheReadTokens": 1123319,
14+
"totalTokens": 3272
15+
},
16+
"costUSD": 0.681125,
17+
"entriesCount": 35
18+
}
19+
},
20+
"totalTokens": 3272,
21+
"totalTokensOld": 3272,
22+
"costUSD": 0.681125,
23+
"entries": 36,
24+
"limits": [
25+
{
26+
"type": "general_limit",
27+
"timestamp": "2025-06-24T20:57:13.405Z",
28+
"content": "Claude AI usage limit reached|1750798800",
29+
"resetTime": "2025-06-24T21:00:00.000Z"
30+
}
31+
]
32+
}
33+
]
34+
}

usage_tracking2.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"user_id": "8e8ae8fd-ef19-46a3-b74a-62ae1c4e1422",
3+
"first_run": "2025-06-24T23:14:35.834333",
4+
"runs": [
5+
{
6+
"timestamp": "2025-06-24T23:14:36.386505",
7+
"plan": "pro",
8+
"timezone": "Europe_Warsaw",
9+
"filename": "XXXNEW_pro_Europe_Warsaw_8e8ae8fd-ef19-46a3-b74a-62ae1c4e1422_20250624_231435.json"
10+
}
11+
],
12+
"last_upload_config": {
13+
"plan": "pro",
14+
"timezone": "Europe_Warsaw",
15+
"timestamp": "2025-06-24T23:14:36.386790"
16+
}
17+
}

0 commit comments

Comments
 (0)