Created
October 7, 2014 16:16
-
-
Save Bowbaq/3d489ff1a7c739d6565d to your computer and use it in GitHub Desktop.
Go req/s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> % 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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