Skip to content

Instantly share code, notes, and snippets.

@Bowbaq
Created October 7, 2014 16:16
Show Gist options
  • Save Bowbaq/3d489ff1a7c739d6565d to your computer and use it in GitHub Desktop.
Save Bowbaq/3d489ff1a7c739d6565d to your computer and use it in GitHub Desktop.
Go req/s
-> % gobench -c=200 -k=true -u http://127.0.0.1:8080/ -t 10
Dispatching 200 clients
Waiting for results...
Requests: 244689 hits
Successful requests: 244689 hits
Network failed: 0 hits
Bad requests failed (!2xx): 0 hits
Successfull requests rate: 24468 hits/sec
Read throughput: 3058725 bytes/sec
Write throughput: 2938608 bytes/sec
Test time: 10 sec
package main
import (
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]string{"Hello": "World"})
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write(payload)
})
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment