Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
c813572d
Commit
c813572d
authored
Sep 07, 2018
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation issues in examples
parent
81b0ccbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
4 deletions
+2
-4
client.cpp
example/dynamic_partition_echo_c++/client.cpp
+1
-1
client.cpp
example/partition_echo_c++/client.cpp
+1
-1
client2.cpp
example/thrift_extension_c++/client2.cpp
+0
-2
No files found.
example/dynamic_partition_echo_c++/client.cpp
View file @
c813572d
...
@@ -190,7 +190,7 @@ int main(int argc, char* argv[]) {
...
@@ -190,7 +190,7 @@ int main(int argc, char* argv[]) {
pthread_mutex_unlock
(
&
g_latency_mutex
);
pthread_mutex_unlock
(
&
g_latency_mutex
);
const
int64_t
avg_latency
=
(
latency_sum
-
last_latency_sum
)
/
const
int64_t
avg_latency
=
(
latency_sum
-
last_latency_sum
)
/
std
::
max
(
nsuccess
-
last_counter
,
1LL
);
std
::
max
(
nsuccess
-
last_counter
,
(
int64_t
)
1
);
LOG
(
INFO
)
<<
"Sending EchoRequest at qps="
<<
nsuccess
-
last_counter
LOG
(
INFO
)
<<
"Sending EchoRequest at qps="
<<
nsuccess
-
last_counter
<<
" latency="
<<
avg_latency
;
<<
" latency="
<<
avg_latency
;
last_counter
=
nsuccess
;
last_counter
=
nsuccess
;
...
...
example/partition_echo_c++/client.cpp
View file @
c813572d
...
@@ -192,7 +192,7 @@ int main(int argc, char* argv[]) {
...
@@ -192,7 +192,7 @@ int main(int argc, char* argv[]) {
pthread_mutex_unlock
(
&
g_latency_mutex
);
pthread_mutex_unlock
(
&
g_latency_mutex
);
const
int64_t
avg_latency
=
(
latency_sum
-
last_latency_sum
)
/
const
int64_t
avg_latency
=
(
latency_sum
-
last_latency_sum
)
/
std
::
max
(
nsuccess
-
last_counter
,
1LL
);
std
::
max
(
nsuccess
-
last_counter
,
(
int64_t
)
1
);
LOG
(
INFO
)
<<
"Sending EchoRequest at qps="
<<
nsuccess
-
last_counter
LOG
(
INFO
)
<<
"Sending EchoRequest at qps="
<<
nsuccess
-
last_counter
<<
" latency="
<<
avg_latency
;
<<
" latency="
<<
avg_latency
;
last_counter
=
nsuccess
;
last_counter
=
nsuccess
;
...
...
example/thrift_extension_c++/client2.cpp
View file @
c813572d
...
@@ -33,7 +33,6 @@ DEFINE_string(load_balancer, "", "The algorithm for load balancing");
...
@@ -33,7 +33,6 @@ DEFINE_string(load_balancer, "", "The algorithm for load balancing");
DEFINE_int32
(
timeout_ms
,
100
,
"RPC timeout in milliseconds"
);
DEFINE_int32
(
timeout_ms
,
100
,
"RPC timeout in milliseconds"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_bool
(
enable_ssl
,
false
,
"Use SSL connection"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
std
::
string
g_request
;
std
::
string
g_request
;
...
@@ -85,7 +84,6 @@ int main(int argc, char* argv[]) {
...
@@ -85,7 +84,6 @@ int main(int argc, char* argv[]) {
// Initialize the channel, NULL means using default options.
// Initialize the channel, NULL means using default options.
brpc
::
ChannelOptions
options
;
brpc
::
ChannelOptions
options
;
options
.
ssl_options
.
enable
=
FLAGS_enable_ssl
;
options
.
protocol
=
brpc
::
PROTOCOL_THRIFT
;
options
.
protocol
=
brpc
::
PROTOCOL_THRIFT
;
options
.
connection_type
=
FLAGS_connection_type
;
options
.
connection_type
=
FLAGS_connection_type
;
options
.
connect_timeout_ms
=
std
::
min
(
FLAGS_timeout_ms
/
2
,
100
);
options
.
connect_timeout_ms
=
std
::
min
(
FLAGS_timeout_ms
/
2
,
100
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment