File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ # Go Gin Benchmarks Example
2+
3+ [ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/CodSpeedHQ/go-gin-benchmarks-example )] ( https://goreportcard.com/report/github.com/CodSpeedHQ/go-gin-benchmarks-example )
4+ [ ![ CodSpeed Badge] ( https://img.shields.io/endpoint?url=https://codspeed.io/badge.json )] ( https://codspeed.io/CodSpeedHQ/go-gin-benchmarks-example )
5+
6+ Example repository demonstrating how to benchmark a Gin HTTP API with CodSpeed.
7+
8+ ## Running the API
9+
10+ ``` bash
11+ # Install dependencies
12+ go mod tidy
13+
14+ # Run the server
15+ go run api.go
16+ ```
17+
18+ The API will be available at ` http://localhost:8080 ` with these endpoints:
19+ - ` GET /albums ` - List all albums
20+ - ` GET /albums/:id ` - Get album by ID
21+ - ` POST /albums ` - Create a new album
22+
23+ ## Running Benchmarks
24+
25+ ``` bash
26+ # Run all benchmarks
27+ go test -bench=.
28+
29+ # Run with longer benchmark time for more accurate results
30+ go test -bench=. -benchtime=5s
31+ ```
32+
33+ ## CI Workflow
34+
35+ The repository uses GitHub Actions with CodSpeed to:
36+ - Run benchmarks on every pull request using ` codspeed-macro ` runners
37+ - Track performance changes over time
38+ - Automatically comment on PRs with performance impact
39+
40+ See the [ full guide] ( https://docs.codspeed.io/guides/benchmarking-a-go-gin-api ) for implementation details.
You can’t perform that action at this time.
0 commit comments