{"id":13522228,"url":"https://github.com/straightdave/trunks","last_synced_at":"2025-03-31T22:30:52.924Z","repository":{"id":57494656,"uuid":"126188584","full_name":"straightdave/trunks","owner":"straightdave","description":"Son of Vegeta, with more skills (mainly gRPC support)","archived":false,"fork":true,"pushed_at":"2020-11-21T11:20:51.000Z","size":1708,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-02T06:31:51.371Z","etag":null,"topics":["grpc","stress-testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tsenart/vegeta","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/straightdave.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-21T14:08:58.000Z","updated_at":"2024-07-08T12:35:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/straightdave/trunks","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightdave%2Ftrunks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightdave%2Ftrunks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightdave%2Ftrunks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightdave%2Ftrunks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/straightdave","download_url":"https://codeload.github.com/straightdave/trunks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552158,"owners_count":20795769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","stress-testing"],"created_at":"2024-08-01T06:00:44.279Z","updated_at":"2025-03-31T22:30:47.914Z","avatar_url":"https://github.com/straightdave.png","language":"Go","funding_links":[],"categories":["4. Load Generators and Synthetic Traffic"],"sub_categories":["Events \u0026 Problems"],"readme":"# Trunks [![Build Status](https://travis-ci.org/straightdave/trunks.svg?branch=master)](https://travis-ci.org/straightdave/trunks)\n\nTrunks, like every son, is derived from the father Vegeta with some enhanced skills:\n1. dump HTTP reponses\n2. gRPC support\n\n![Trunks](http://images2.wikia.nocookie.net/__cb20100725123520/dragonballfanon/images/5/52/Future_Trunks_SSJ2.jpg)\n\n\u003e Current Tag v13.0.0\n\n## Usage manual\n\nfor original usage of Vegeta, please refer to [vegeta' readme](https://github.com/tsenart/vegeta/blob/master/README.md)\n\n## More functionalities\n\n### dump http attck response to file\n```console\n(add one more option '-respf' to 'attack')\n-respf string\n      Dump responses to file\n```\n\n### gRPC perf test (as lib)\n\nTrunks uses the _burn_ to attack the gRPC services. Capable with any gRPC service.\n\nGiven multiple hosts ('IP:port' of service instances), Trunks will use simple round-robin as client-side load balance mechanism.\n\n\u003eBurning duration is shorter. No need to do the real __service discovery__ or __watch / real-time live connection's update__. Say, if testing service instances registered to Etcd, we don't need to watch the status of all instances and adjust the connection pool. During the short time of perf testing, we assume the instance hosts are _not-changing_.\n\nExample:\n\n\u003eThis example is using \"google.golang.org/grpc/examples/route_guide\" as the target server.\n\n```golang\npackage main\n\nimport (\n    \"fmt\"\n    \"time\"\n\n    trunks \"github.com/straightdave/trunks/lib\"\n    // for convenience, change the client_stub.pb.go into package main\n)\n\nfunc main() {\n    tgt := \u0026trunks.Gtarget{\n        MethodName: \"/routeguide.RouteGuide/GetFeature\",\n        Requests:   []proto.Message{\u0026Point{Latitude: 10000, Longitude: 10000}}, // supporting multiple requests\n        Response:   \u0026Feature{}, // providing one response data struct\n    }\n\n    burner, err := trunks.NewBurner(\n        []string{\"192.168.0.1:8087\"},  // server address pool; simple round-robin\n        trunks.WithLooping(true),      // loop requests; false by default\n        trunks.WithNumWorker(20),      // worker goroutine pool size; 10 is default\n        trunks.WithDumpFile(\"a.dump\"), // dump responses to file\n    )\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n    defer burner.Close()\n\n    var metrics trunks.Metrics\n    startT := time.Now()\n\n    // burning the target service with QPS=5 and Duration=10s\n    for res := range burner.Burn(tgt, uint64(5), 10*time.Second) {\n        metrics.Add(res)\n    }\n    dur := time.Since(startT)\n    metrics.Close()\n\n    fmt.Printf(\"dur: %v\\n\", dur.Seconds())\n    fmt.Printf(\"earliest: %v\\n\", metrics.Earliest.Sub(startT).Nanoseconds())\n    fmt.Printf(\"latest: %v\\n\", metrics.Latest.Sub(startT).Nanoseconds())\n    fmt.Printf(\"end: %v\\n\", metrics.End.Sub(startT).Nanoseconds())\n    fmt.Printf(\"reqs: %d\\n\", metrics.Requests)\n    fmt.Printf(\"success%: %f\\n\", metrics.Success)\n    fmt.Printf(\"p50: %s\\n\", metrics.Latencies.P50)\n    fmt.Printf(\"p95: %s\\n\", metrics.Latencies.P95)\n    fmt.Printf(\"p99: %s\\n\", metrics.Latencies.P99)\n    fmt.Printf(\"mean: %s\\n\", metrics.Latencies.Mean)\n    fmt.Printf(\"max: %s\\n\", metrics.Latencies.Max)\n    // ...\n}\n```\n\nFor this code snippet, it would result in:\n```console\ndur: 9.802099215\nearliest: 68670\nlatest: 9800068577\nend: 9802058490\nreqs: 50\nsuccess%: 99.88\np50: 5.974748ms\np95: 6.084433ms\np99: 6.10946ms\nmean: 5.143272ms\nmax: 6.19225ms\n```\n\n## Arion as gRPC\nArion makes it easy to use Trunks. Please check https://github.com/straightdave/arion\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraightdave%2Ftrunks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstraightdave%2Ftrunks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraightdave%2Ftrunks/lists"}