-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·35 lines (28 loc) · 753 Bytes
/
demo.sh
File metadata and controls
executable file
·35 lines (28 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -e
echo " Distributed Rate Limiter "
echo ""
echo "1. Starting services (postgres backend)..."
bun run dev
sleep 4
echo ""
echo "2. Single request..."
bun run examples/basic_usage.ts
echo ""
echo "3. Burst — 15 requests, capacity 10..."
bun run examples/burst_demo.ts
echo ""
echo "4. Checking bucket stats after burst..."
grpcurl -plaintext \
-proto src/proto/ratelimit.proto \
-d '{"key":"demo:burst"}' \
localhost:50051 ratelimit.v1.Admin/GetBucketStats
echo ""
echo "5. Resetting bucket..."
grpcurl -plaintext \
-proto src/proto/ratelimit.proto \
-d '{"key":"demo:burst"}' \
localhost:50051 ratelimit.v1.Admin/ResetBucket
echo ""
echo "Demo complete."
echo "Run 'bun run dev:down' to stop services."