Go to the documentation of this file.
29 #include "gtest/gtest.h"
46 #include "src/proto/grpc/testing/test.grpc.pb.h"
71 const grpc::testing::Empty* ,
72 grpc::testing::Empty* )
override {
80 std::shared_ptr<grpc::ChannelCredentials> channel_creds =
83 std::unique_ptr<grpc::testing::TestService::Stub>
stub =
84 grpc::testing::TestService::NewStub(
106 std::shared_ptr<grpc::ChannelCredentials> channel_creds =
110 return channel->WaitForConnected(
115 TEST(ChannelzSamplerTest, SimpleTest) {
127 const int kWaitForServerSeconds = 10;
144 if (WEXITSTATUS(
status)) {
146 "Channelz sampler test test-runner exited with code %d",
150 }
else if (WIFSIGNALED(
status)) {
151 gpr_log(
GPR_ERROR,
"Channelz sampler test test-runner ended from signal %d",
156 "Channelz sampler test test-runner ended with unknown status %d",
163 client_thread_1.join();
164 client_thread_2.join();
167 int main(
int argc,
char** argv) {
171 auto lslash = me.rfind(
'/');
172 if (lslash != std::string::npos) {
173 g_root = me.substr(0, lslash);
int main(int argc, char **argv)
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
virtual std::shared_ptr< ChannelCredentials > GetChannelCredentials(const std::string &type, ChannelArguments *args)=0
void RunClient(const std::string &client_id, gpr_event *done_ev)
GPRAPI void gpr_event_set(gpr_event *ev, void *value)
std::string server_address("0.0.0.0:10000")
std::unique_ptr< Server > server
virtual std::shared_ptr< ServerCredentials > GetServerCredentials(const std::string &type)=0
wrapped_grpc_channel * channel
A builder class for the creation and startup of grpc::Server instances.
std::string sampling_interval_seconds
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
TEST(ChannelzSamplerTest, SimpleTest)
std::string custom_credentials_type("INSECURE_CREDENTIALS")
GPRAPI void gpr_event_init(gpr_event *ev)
std::shared_ptr< Channel > CreateChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
std::string output_json("output.json")
GPRAPI void * gpr_event_wait(gpr_event *ev, gpr_timespec abs_deadline)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
void InitChannelzService()
Status EmptyCall(grpc::ServerContext *, const grpc::testing::Empty *, grpc::testing::Empty *) override
CredentialsProvider * GetCredentialsProvider()
UniquePtr< SSL_SESSION > ret
GRPC_CUSTOM_UTIL_STATUS Status
#define ASSERT_TRUE(condition)
ABSL_MUST_USE_RESULT bool ok() const
static std::string g_root
grpc::ClientContext context
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
bool WaitForConnection(int wait_server_seconds)
std::string sampling_times
static uv_thread_t thread
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:53