mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-14 07:19:02 +00:00
Web dashboard, task release, logs api
This commit is contained in:
28
test/api_task_bench_test.go
Normal file
28
test/api_task_bench_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"src/task_tracker/api"
|
||||
"strconv"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkCreateTask(b *testing.B) {
|
||||
|
||||
resp := createProject(api.CreateProjectRequest{
|
||||
Name: "BenchmarkCreateTask" + strconv.Itoa(b.N),
|
||||
Priority: 1,
|
||||
GitRepo: "benchmark_test" + strconv.Itoa(b.N),
|
||||
Version: "f09e8c9r0w839x0c43",
|
||||
CloneUrl: "http://localhost",
|
||||
})
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
createTask(api.CreateTaskRequest{
|
||||
Project: resp.Id,
|
||||
Priority: 1,
|
||||
Recipe: "{}",
|
||||
MaxRetries: 1,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user