Reputation: 119
I am looking for some tools or the Go tests package to run some benchmarks on different servers. Any idea how i get some nice profiling output in my console. Is it possible to simulate multiple users visiting the server?
getting no output at from this testing code
package tests
import(
"testing"
)
func BenchmarkMyFunc(b *testing.B) {
for i := 0; i < b.N; i++ {
testplus()
}
}
func testplus() int {
x := 1
return x + 1
}
thank you
Upvotes: 2
Views: 8167
Reputation: 24300
Use Go's built-in profiling tools, or convenience wrappers around them: http://dave.cheney.net/2013/07/07/introducing-profile-super-simple-profiling-for-go-programs
... and then hit the application with a decent HTTP load testing tool to generate load: https://github.com/wg/wrk
Note that:
You can also include benchmarks in your test code, noting that these are typically useful for benchmarking algorithms/comparing approaches rather than whole-of-application performance.
Upvotes: 6