Skip to content
Merged
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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 29 additions & 7 deletions gwt.sh
Original file line number Diff line number Diff line change
@@ -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 <branch-name>"
echo "Example: gwt.sh 97-add-option-to-record-prometheus-scrape-duration"
echo "Usage: gwt.sh <issue-number>"
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"
Loading