Skip to content

Commit 2ba90f4

Browse files
committed
benchmark
1 parent 7b095ae commit 2ba90f4

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Benchmark Repo Iteration
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
benchmark:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Wait for server to be up (if needed)
11+
run: |
12+
echo "Sleeping 30s to allow server to start (adjust as needed)"
13+
sleep 30
14+
- name: Benchmark repo iteration
15+
run: |
16+
RESPONSE=$(curl -s ${{ secrets.BENCHMARK_URL }}/api/repo/benchmark)
17+
echo "Benchmark response: $RESPONSE"
18+
echo "$RESPONSE" | jq '.'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { useOctokitApp } from "../../utils/octokit";
2+
3+
export default defineEventHandler(async (event) => {
4+
const signal = toWebRequest(event).signal;
5+
const app = useOctokitApp(event, { ignoreBaseUrl: true });
6+
7+
let repoCount = 0;
8+
const start = Date.now();
9+
10+
await app.eachRepository(async ({ repository }) => {
11+
if (signal.aborted) return;
12+
if (repository.private) return;
13+
repoCount++;
14+
});
15+
16+
const elapsed = Date.now() - start;
17+
return { repoCount, elapsed };
18+
});

0 commit comments

Comments
 (0)