Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
test
cpp
end2end
counted_service.h
Go to the documentation of this file.
1
//
2
// Copyright 2017 gRPC authors.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
//
16
17
#ifndef GRPC_TEST_CPP_END2END_COUNTED_SERVICE_H
18
#define GRPC_TEST_CPP_END2END_COUNTED_SERVICE_H
19
20
#include "
src/core/lib/gprpp/sync.h
"
21
22
namespace
grpc
{
23
namespace
testing
{
24
25
// A wrapper around an RPC service implementation that provides request and
26
// response counting.
27
template
<
typename
ServiceType>
28
class
CountedService
:
public
ServiceType {
29
public
:
30
size_t
request_count
() {
31
grpc_core::MutexLock
lock(&
mu_
);
32
return
request_count_
;
33
}
34
35
size_t
response_count
() {
36
grpc_core::MutexLock
lock(&
mu_
);
37
return
response_count_;
38
}
39
40
void
IncreaseResponseCount
() {
41
grpc_core::MutexLock
lock(&
mu_
);
42
++response_count_;
43
}
44
void
IncreaseRequestCount
() {
45
grpc_core::MutexLock
lock(&
mu_
);
46
++
request_count_
;
47
}
48
49
void
ResetCounters
() {
50
grpc_core::MutexLock
lock(&
mu_
);
51
request_count_
= 0;
52
response_count_ = 0;
53
}
54
55
private
:
56
grpc_core::Mutex
mu_
;
57
size_t
request_count_
ABSL_GUARDED_BY
(
mu_
) = 0;
58
size_t
response_count_
ABSL_GUARDED_BY
(
mu_
) = 0;
59
};
60
61
}
// namespace testing
62
}
// namespace grpc
63
64
#endif // GRPC_TEST_CPP_END2END_COUNTED_SERVICE_H
grpc::testing::CountedService::request_count
size_t request_count()
Definition:
counted_service.h:30
testing
Definition:
aws_request_signer_test.cc:25
grpc
Definition:
grpcpp/alarm.h:33
grpc_core::MutexLock
Definition:
src/core/lib/gprpp/sync.h:88
grpc::testing::CountedService::IncreaseResponseCount
void IncreaseResponseCount()
Definition:
counted_service.h:40
grpc::testing::CountedService::response_count
size_t response_count()
Definition:
counted_service.h:35
grpc::testing::CountedService::IncreaseRequestCount
void IncreaseRequestCount()
Definition:
counted_service.h:44
grpc::testing::CountedService::mu_
grpc_core::Mutex mu_
Definition:
counted_service.h:56
grpc_core::Mutex
Definition:
src/core/lib/gprpp/sync.h:61
request_count_
int request_count_
Definition:
client_lb_end2end_test.cc:135
grpc::testing::CountedService
Definition:
counted_service.h:28
grpc::testing::CountedService::ABSL_GUARDED_BY
size_t request_count_ ABSL_GUARDED_BY(mu_)=0
grpc::testing::CountedService::ResetCounters
void ResetCounters()
Definition:
counted_service.h:49
sync.h
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:57