Skip to content

Commit f19670e

Browse files
committed
Address remaining review items: rebase, polish, cleanup
L1: Remove GFM trailing whitespace from sample markdown files L6: Add comment about approximate alignment in waterfall markers L8: Clarify --time-period help text in latency_report.py L9: Scope .gitignore *.log to scripts/ and examples/ only L10: Remove duplicate env validation from latency_report.sh (Python script now handles validation with structured logging) L11: Rebased onto origin/main (17 commits ahead, 0 behind) 79 tests pass, autoformat clean.
1 parent 094ef7d commit f19670e

5 files changed

Lines changed: 17 additions & 22 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ scripts/reports/
2121
examples/*/reports/
2222
examples/*/reports_*/
2323
examples/*/trials_*/
24-
*.log
24+
scripts/**/*.log
25+
examples/**/*.log
2526

2627
# Local workspace metadata
2728
.code*/

scripts/latency_report.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def render_waterfall(trace):
377377
lines.append(f" {label:<{label_w}} {bar} {format_ms(span.latency_ms)}")
378378

379379
lines.append(f" {'':{label_w}} {'─' * BAR_W}")
380-
# Time axis labels
380+
# Time axis labels (approximate alignment; format_ms width varies)
381381
markers = f" {'':{label_w}} 0{'':>{BAR_W//2-1}}{format_ms(total_ms/2)}{'':>{BAR_W//2-1}}{format_ms(total_ms)}"
382382
lines.append(markers)
383383

@@ -557,8 +557,9 @@ def main():
557557
parser.add_argument(
558558
"--time-period",
559559
type=str,
560-
help="Time range filter (e.g. 1h, 30m, 7d). "
561-
"If omitted, fetches the latest traces regardless of age",
560+
default=None,
561+
help="Time range filter: 1h, 30m, 7d (default: no time filter, "
562+
"fetches the latest traces by --limit)",
562563
)
563564
parser.add_argument(
564565
"--app-name",

scripts/latency_report.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ elif [ -f "${SCRIPT_DIR}/../.env" ]; then
4646
set +a
4747
fi
4848

49-
# Validate required env vars
50-
for var in PROJECT_ID DATASET_ID TABLE_ID DATASET_LOCATION; do
51-
if [ -z "${!var}" ]; then
52-
echo "ERROR: Required environment variable ${var} is not set."
53-
echo "Set it in your shell or create a .env file with these variables,"
54-
echo "or pass --env path/to/.env. See scripts/README.md."
55-
exit 1
56-
fi
57-
done
49+
# Env validation is handled by the Python script with structured logging;
50+
# the shell wrapper only needs to load the .env file.
5851

5952
python3 "${SCRIPT_DIR}/latency_report.py" "$@"

scripts/sample_latency_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
Output of `./scripts/latency_report.sh --limit 3 --time-period 1h`:
44

5-
**Project:** my-gcp-project
6-
**Dataset:** agent_logs.agent_events
7-
**Location:** us-central1
5+
**Project:** my-gcp-project
6+
**Dataset:** agent_logs.agent_events
7+
**Location:** us-central1
88

99
```
1010
Fetching traces from my-gcp-project.agent_logs.agent_events...

scripts/sample_quality_report.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Markdown report generated by `./scripts/quality_report.sh --report --config agent_context.json`.
44

5-
**Generated:** 2026-05-10 04:53:12
6-
**Project:** my-gcp-project
7-
**Dataset:** agent_logs.agent_events
8-
**Location:** us-central1
9-
**Eval model:** gemini-2.5-flash
10-
**Sessions:** 100
5+
**Generated:** 2026-05-10 04:53:12
6+
**Project:** my-gcp-project
7+
**Dataset:** agent_logs.agent_events
8+
**Location:** us-central1
9+
**Eval model:** gemini-2.5-flash
10+
**Sessions:** 100
1111

1212
## Summary
1313

0 commit comments

Comments
 (0)