feat(agent-mail): Add Python adapter library for Agent Mail integration
- Created lib/beads_mail_adapter.py with AgentMailAdapter class - Automatic health check on initialization - Graceful degradation when server unavailable - Methods: reserve_issue(), release_issue(), notify(), check_inbox() - Environment-based configuration (AGENT_MAIL_URL, AGENT_MAIL_TOKEN) - Comprehensive unit tests (15 tests, 100% passing) - Full documentation in lib/README.md Closes bd-m9th Amp-Thread-ID: https://ampcode.com/threads/T-caa26228-0d18-4b35-b98a-9f95f6a099fe Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
34
scripts/simple_latency_test.sh
Executable file
34
scripts/simple_latency_test.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# Simple latency benchmark for bd-htfk
|
||||
set -e
|
||||
|
||||
echo "# Latency Benchmark Results"
|
||||
echo ""
|
||||
echo "## Git Sync Latency Test (10 runs)"
|
||||
echo ""
|
||||
|
||||
# Test git sync latency
|
||||
for i in {1..10}; do
|
||||
start=$(date +%s%N)
|
||||
|
||||
# Create, update, and sync an issue
|
||||
test_id=$(bd create "Latency test $i" -p 3 --json 2>/dev/null | jq -r '.id')
|
||||
bd update "$test_id" --status in_progress >/dev/null 2>&1
|
||||
bd sync >/dev/null 2>&1
|
||||
|
||||
end=$(date +%s%N)
|
||||
latency_ms=$(((end - start) / 1000000))
|
||||
|
||||
echo "Run $i: ${latency_ms}ms"
|
||||
|
||||
# Cleanup
|
||||
bd close "$test_id" --reason "test" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "## Notes"
|
||||
echo "- Git sync includes: create → update → export → commit → push → pull → import"
|
||||
echo "- This represents the full round-trip time for issue changes to sync via git"
|
||||
echo "- Agent Mail latency test skipped (server not running)"
|
||||
echo "- Expected git latency: 1000-5000ms"
|
||||
echo "- Expected Agent Mail latency: <100ms (when server running)"
|
||||
Reference in New Issue
Block a user