github.com/Projeto-USPY/uspy-scraper@v1.0.0/worker/worker_bench_test.go (about) 1 package worker 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/Projeto-USPY/uspy-backend/db" 8 ) 9 10 func buildQueryParams(institute string) map[string][]string { 11 return map[string][]string{ 12 "institute": {institute}, 13 } 14 } 15 16 func BenchmarkCollectJupiter(b *testing.B) { 17 ctx := context.Background() 18 CollectJupiter(ctx, db.Database{}, map[string][]string{}, Noop) 19 } 20 21 func BenchmarkCollectICMCSubjects(b *testing.B) { 22 ctx := context.Background() 23 CollectJupiter(ctx, db.Database{}, buildQueryParams("55"), Noop) 24 } 25 26 func BenchmarkCollectICMCOfferings(b *testing.B) { 27 ctx := context.Background() 28 CollectOfferings(ctx, db.Database{}, buildQueryParams("55"), Noop) 29 } 30 31 func BenchmarkCollectPoliSubjects(b *testing.B) { 32 ctx := context.Background() 33 CollectJupiter(ctx, db.Database{}, buildQueryParams("3"), Noop) 34 } 35 36 func BenchmarkCollectPoliOfferings(b *testing.B) { 37 ctx := context.Background() 38 CollectOfferings(ctx, db.Database{}, buildQueryParams("3"), Noop) 39 }