diff --git a/README.md b/README.md index e0470f5..44de3b9 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,22 @@ ASAPQuery has two main components: **asap-planner-rs** analyzes your PromQL quer └── asap-query-engine/ # Query serving and sketch precomputation engine ``` +## Supported Queries + +ASAPQuery accelerates PromQL queries that match the following patterns. Queries that don't match are transparently forwarded to Prometheus. + +**Temporal range functions** (no label selectors): +- `rate(metric[range])` +- `increase(metric[range])` +- `sum_over_time(metric[range])`, `count_over_time(metric[range])`, `avg_over_time(metric[range])`, `min_over_time(metric[range])`, `max_over_time(metric[range])` +- `quantile_over_time(φ, metric[range])` + +**Aggregation operators** (with optional `by (label, ...)` clause, no label selectors): +- `sum(...)`, `count(...)`, `avg(...)`, `min(...)`, `max(...)`, `quantile(φ, ...)`, `topk(k, ...)` + +**Binary arithmetic** — arithmetic combinations of the above patterns: +- e.g. `rate(errors_total[5m]) / rate(requests_total[5m])` + ## Coming soon 1. Drop-in ASAPQuery artifact that accelerates Clickhouse queries diff --git a/gwt.sh b/gwt.sh index 8b6df7b..248f8e7 100755 --- a/gwt.sh +++ b/gwt.sh @@ -1,17 +1,39 @@ #!/bin/bash -# Add a git worktree for a branch +# Add a git worktree for an issue number (uses gh to resolve the branch) if [ -z "$1" ]; then - echo "Usage: gwt.sh " - echo "Example: gwt.sh 97-add-option-to-record-prometheus-scrape-duration" + echo "Usage: gwt.sh " + echo "Example: gwt.sh 97" exit 1 fi -branch_name="$1" -issue_num="${branch_name%%-*}" # Extract issue number (everything before first hyphen) +issue_num="$1" -echo "Fetching branch $branch_name from origin..." +branches=$(gh issue develop "$issue_num" --list 2>/dev/null | awk '{print $1}') + +if [ -z "$branches" ]; then + echo "No branch found for issue #$issue_num. Creating one via gh..." + gh issue develop "$issue_num" + branches=$(gh issue develop "$issue_num" --list 2>/dev/null | awk '{print $1}') + if [ -z "$branches" ]; then + echo "Failed to create branch for issue #$issue_num." + exit 1 + fi +fi + +branch_count=$(echo "$branches" | wc -l) + +if [ "$branch_count" -gt 1 ]; then + echo "Multiple branches found for issue #$issue_num:" + echo "$branches" + exit 1 +fi + +branch_name="$branches" + +echo "Found branch: $branch_name" +echo "Fetching from origin..." git fetch origin "$branch_name" -echo "Creating worktree at ../worktrees/$issue_num for branch $branch_name..." +echo "Creating worktree at ../worktrees/$issue_num..." git worktree add --track -b "$branch_name" "../worktrees/$issue_num" "origin/$branch_name"