5 * Copyright 2017 gRPC authors.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
27 "google.golang.org/grpc"
28 "google.golang.org/grpc/benchmark/stats"
31 func BenchmarkClientStreamc1(b *testing.B) {
32 grpc.EnableTracing = true
33 runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false})
36 func BenchmarkClientStreamc8(b *testing.B) {
37 grpc.EnableTracing = true
38 runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false})
41 func BenchmarkClientStreamc64(b *testing.B) {
42 grpc.EnableTracing = true
43 runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false})
46 func BenchmarkClientStreamc512(b *testing.B) {
47 grpc.EnableTracing = true
48 runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false})
50 func BenchmarkClientUnaryc1(b *testing.B) {
51 grpc.EnableTracing = true
52 runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false})
55 func BenchmarkClientUnaryc8(b *testing.B) {
56 grpc.EnableTracing = true
57 runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false})
60 func BenchmarkClientUnaryc64(b *testing.B) {
61 grpc.EnableTracing = true
62 runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false})
65 func BenchmarkClientUnaryc512(b *testing.B) {
66 grpc.EnableTracing = true
67 runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false})
70 func BenchmarkClientStreamNoTracec1(b *testing.B) {
71 grpc.EnableTracing = false
72 runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false})
75 func BenchmarkClientStreamNoTracec8(b *testing.B) {
76 grpc.EnableTracing = false
77 runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false})
80 func BenchmarkClientStreamNoTracec64(b *testing.B) {
81 grpc.EnableTracing = false
82 runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false})
85 func BenchmarkClientStreamNoTracec512(b *testing.B) {
86 grpc.EnableTracing = false
87 runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false})
89 func BenchmarkClientUnaryNoTracec1(b *testing.B) {
90 grpc.EnableTracing = false
91 runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false})
94 func BenchmarkClientUnaryNoTracec8(b *testing.B) {
95 grpc.EnableTracing = false
96 runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false})
99 func BenchmarkClientUnaryNoTracec64(b *testing.B) {
100 grpc.EnableTracing = false
101 runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false})
104 func BenchmarkClientUnaryNoTracec512(b *testing.B) {
105 grpc.EnableTracing = false
106 runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false})
107 runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false})
110 func TestMain(m *testing.M) {
111 os.Exit(stats.RunTestMain(m))