-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.go
39 lines (31 loc) · 1006 Bytes
/
benchmark.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"time"
"os"
"github.com/nicholasjackson/bench/output"
"github.com/nicholasjackson/bench/util"
"github.com/koding/kite"
"github.com/nicholasjackson/bench"
)
var kittenServer *kite.Client
func main() {
fmt.Println("Benchmarking application")
k := kite.New("exp2", "1.0.0")
kittenServer = k.NewClient("http://consul.acet.io:8091/kite")
kittenServer.Dial()
b := bench.New(400, 300*time.Second, 90*time.Second, 5*time.Second)
b.AddOutput(0*time.Second, os.Stdout, output.WriteTabularData)
b.AddOutput(1*time.Second, util.NewFile("./output.txt"), output.WriteTabularData)
b.AddOutput(1*time.Second, util.NewFile("./error.txt"), output.WriteErrorLogs)
b.AddOutput(1*time.Second, util.NewFile("./output.png"), output.PlotData)
b.RunBenchmarks(KiteRequest)
}
// GoMicroRequest is executed by benchmarks
func KiteRequest() error {
_, err := kittenServer.Tell("Hello", "Nic") // call "square" method with argument 4
if err != nil {
return err
}
return nil
}