Added timing to Thrift calls in order for end to end test to test changes that affect thrift call speed such as Thrift protocol changes
This commit is contained in:
parent
10c12d5a13
commit
58c560061f
1 changed files with 13 additions and 1 deletions
|
@ -21,6 +21,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var r Realis
|
var r Realis
|
||||||
|
@ -62,23 +63,29 @@ func TestRealisClient_CreateJob_Thermos(t *testing.T) {
|
||||||
InstanceCount(1).
|
InstanceCount(1).
|
||||||
AddPorts(1)
|
AddPorts(1)
|
||||||
|
|
||||||
|
start := time.Now()
|
||||||
resp, err := r.CreateJob(job)
|
resp, err := r.CreateJob(job)
|
||||||
|
end := time.Now()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
||||||
|
fmt.Printf("Create call took %d ns\n", (end.UnixNano()- start.UnixNano()))
|
||||||
|
|
||||||
// Tasks must exist for it to be killed
|
// Tasks must exist for it to be killed
|
||||||
t.Run("TestRealisClient_KillJob_Thermos", func(t *testing.T) {
|
t.Run("TestRealisClient_KillJob_Thermos", func(t *testing.T) {
|
||||||
|
start := time.Now()
|
||||||
resp, err := r.KillJob(job.JobKey())
|
resp, err := r.KillJob(job.JobKey())
|
||||||
|
end := time.Now()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
||||||
|
fmt.Printf("Kill call took %d ns\n", (end.UnixNano()- start.UnixNano()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,22 +121,27 @@ func TestRealisClient_ScheduleCronJob_Thermos(t *testing.T) {
|
||||||
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
||||||
|
|
||||||
t.Run("TestRealisClient_StartCronJob_Thermos", func(t *testing.T) {
|
t.Run("TestRealisClient_StartCronJob_Thermos", func(t *testing.T) {
|
||||||
|
start := time.Now()
|
||||||
resp, err := r.StartCronJob(job.JobKey())
|
resp, err := r.StartCronJob(job.JobKey())
|
||||||
|
end := time.Now()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
||||||
|
fmt.Printf("Schedule cron call took %d ns\n", (end.UnixNano()- start.UnixNano()))
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("TestRealisClient_DeschedulerCronJob_Thermos", func(t *testing.T) {
|
t.Run("TestRealisClient_DeschedulerCronJob_Thermos", func(t *testing.T) {
|
||||||
|
start := time.Now()
|
||||||
resp, err := r.DescheduleCronJob(job.JobKey())
|
resp, err := r.DescheduleCronJob(job.JobKey())
|
||||||
|
end := time.Now()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
assert.Equal(t, aurora.ResponseCode_OK, resp.ResponseCode)
|
||||||
|
fmt.Printf("Deschedule cron call took %d ns\n", (end.UnixNano()- start.UnixNano()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue