OSDN Git Service

new repo
[bytom/vapor.git] / vendor / google.golang.org / grpc / benchmark / benchmark16_test.go
1 // +build go1.6,!go1.7
2
3 /*
4  *
5  * Copyright 2017 gRPC authors.
6  *
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
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 package benchmark
22
23 import (
24         "os"
25         "testing"
26
27         "google.golang.org/grpc"
28         "google.golang.org/grpc/benchmark/stats"
29 )
30
31 func BenchmarkClientStreamc1(b *testing.B) {
32         grpc.EnableTracing = true
33         runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false})
34 }
35
36 func BenchmarkClientStreamc8(b *testing.B) {
37         grpc.EnableTracing = true
38         runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false})
39 }
40
41 func BenchmarkClientStreamc64(b *testing.B) {
42         grpc.EnableTracing = true
43         runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false})
44 }
45
46 func BenchmarkClientStreamc512(b *testing.B) {
47         grpc.EnableTracing = true
48         runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false})
49 }
50 func BenchmarkClientUnaryc1(b *testing.B) {
51         grpc.EnableTracing = true
52         runStream(b, stats.Features{"", true, 0, 0, 0, 1, 1, 1, false})
53 }
54
55 func BenchmarkClientUnaryc8(b *testing.B) {
56         grpc.EnableTracing = true
57         runStream(b, stats.Features{"", true, 0, 0, 0, 8, 1, 1, false})
58 }
59
60 func BenchmarkClientUnaryc64(b *testing.B) {
61         grpc.EnableTracing = true
62         runStream(b, stats.Features{"", true, 0, 0, 0, 64, 1, 1, false})
63 }
64
65 func BenchmarkClientUnaryc512(b *testing.B) {
66         grpc.EnableTracing = true
67         runStream(b, stats.Features{"", true, 0, 0, 0, 512, 1, 1, false})
68 }
69
70 func BenchmarkClientStreamNoTracec1(b *testing.B) {
71         grpc.EnableTracing = false
72         runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false})
73 }
74
75 func BenchmarkClientStreamNoTracec8(b *testing.B) {
76         grpc.EnableTracing = false
77         runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false})
78 }
79
80 func BenchmarkClientStreamNoTracec64(b *testing.B) {
81         grpc.EnableTracing = false
82         runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false})
83 }
84
85 func BenchmarkClientStreamNoTracec512(b *testing.B) {
86         grpc.EnableTracing = false
87         runStream(b, stats.Features{"", false, 0, 0, 0, 512, 1, 1, false})
88 }
89 func BenchmarkClientUnaryNoTracec1(b *testing.B) {
90         grpc.EnableTracing = false
91         runStream(b, stats.Features{"", false, 0, 0, 0, 1, 1, 1, false})
92 }
93
94 func BenchmarkClientUnaryNoTracec8(b *testing.B) {
95         grpc.EnableTracing = false
96         runStream(b, stats.Features{"", false, 0, 0, 0, 8, 1, 1, false})
97 }
98
99 func BenchmarkClientUnaryNoTracec64(b *testing.B) {
100         grpc.EnableTracing = false
101         runStream(b, stats.Features{"", false, 0, 0, 0, 64, 1, 1, false})
102 }
103
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})
108 }
109
110 func TestMain(m *testing.M) {
111         os.Exit(stats.RunTestMain(m))
112 }