Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
e584d9cd
Commit
e584d9cd
authored
4 years ago
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Measure the number of UDP datagrams sent and received
parent
4d140ea6
master
v1.45.x
v1.46.0
v1.45.1
v1.45.0
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
24 deletions
+41
-24
src/h2load.cc
src/h2load.cc
+35
-24
src/h2load.h
src/h2load.h
+4
-0
src/h2load_quic.cc
src/h2load_quic.cc
+2
-0
No files found.
src/h2load.cc
View file @
e584d9cd
...
...
@@ -160,7 +160,9 @@ Stats::Stats(size_t req_todo, size_t nclients)
bytes_head
(
0
),
bytes_head_decomp
(
0
),
bytes_body
(
0
),
status
()
{}
status
(),
udp_dgram_recv
(
0
),
udp_dgram_sent
(
0
)
{}
Stream
::
Stream
()
:
req_stat
{},
status_success
(
-
1
)
{}
...
...
@@ -1377,6 +1379,8 @@ int Client::write_udp(const sockaddr *addr, socklen_t addrlen,
auto
nwrite
=
sendto
(
fd
,
data
,
datalen
,
MSG_DONTWAIT
,
addr
,
addrlen
);
if
(
nwrite
<
0
)
{
std
::
cerr
<<
"sendto: errno="
<<
errno
<<
std
::
endl
;
}
else
{
++
worker
->
stats
.
udp_dgram_sent
;
}
ev_io_stop
(
worker
->
loop
,
&
wev
);
...
...
@@ -2971,6 +2975,8 @@ int main(int argc, char **argv) {
stats
.
bytes_head
+=
s
.
bytes_head
;
stats
.
bytes_head_decomp
+=
s
.
bytes_head_decomp
;
stats
.
bytes_body
+=
s
.
bytes_body
;
stats
.
udp_dgram_recv
+=
s
.
udp_dgram_recv
;
stats
.
udp_dgram_sent
+=
s
.
udp_dgram_sent
;
for
(
size_t
i
=
0
;
i
<
stats
.
status
.
size
();
++
i
)
{
stats
.
status
[
i
]
+=
s
.
status
[
i
];
...
...
@@ -3029,30 +3035,35 @@ traffic: )" << util::utos_funit(stats.bytes_total)
<<
util
::
utos_funit
(
stats
.
bytes_head
)
<<
"B ("
<<
stats
.
bytes_head
<<
") headers (space savings "
<<
header_space_savings
*
100
<<
"%), "
<<
util
::
utos_funit
(
stats
.
bytes_body
)
<<
"B ("
<<
stats
.
bytes_body
<<
R"() data
min max mean sd +/- sd
<<
stats
.
bytes_body
<<
R"() data)"
<<
std
::
endl
;
if
(
config
.
is_quic
())
{
std
::
cout
<<
"UDP datagram: "
<<
stats
.
udp_dgram_sent
<<
" sent, "
<<
stats
.
udp_dgram_recv
<<
" received"
<<
std
::
endl
;
}
std
::
cout
<<
R"( min max mean sd +/- sd
time for request: )"
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
min
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
max
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
mean
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
sd
)
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
request
.
within_sd
)
<<
"%"
<<
"
\n
time for connect: "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
min
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
max
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
mean
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
sd
)
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
connect
.
within_sd
)
<<
"%"
<<
"
\n
time to 1st byte: "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
min
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
max
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
mean
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
sd
)
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
ttfb
.
within_sd
)
<<
"%"
<<
"
\n
req/s : "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
min
<<
" "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
max
<<
" "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
mean
<<
" "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
sd
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
rps
.
within_sd
)
<<
"%"
<<
std
::
endl
;
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
min
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
max
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
mean
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
request
.
sd
)
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
request
.
within_sd
)
<<
"%"
<<
"
\n
time for connect: "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
min
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
max
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
mean
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
connect
.
sd
)
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
connect
.
within_sd
)
<<
"%"
<<
"
\n
time to 1st byte: "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
min
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
max
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
mean
)
<<
" "
<<
std
::
setw
(
10
)
<<
util
::
format_duration
(
ts
.
ttfb
.
sd
)
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
ttfb
.
within_sd
)
<<
"%"
<<
"
\n
req/s : "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
min
<<
" "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
max
<<
" "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
mean
<<
" "
<<
std
::
setw
(
10
)
<<
ts
.
rps
.
sd
<<
std
::
setw
(
9
)
<<
util
::
dtos
(
ts
.
rps
.
within_sd
)
<<
"%"
<<
std
::
endl
;
SSL_CTX_free
(
ssl_ctx
);
...
...
This diff is collapsed.
Click to expand it.
src/h2load.h
View file @
e584d9cd
...
...
@@ -230,6 +230,10 @@ struct Stats {
std
::
vector
<
RequestStat
>
req_stats
;
// The statistics per client
std
::
vector
<
ClientStat
>
client_stats
;
// The number of UDP datagrams received.
size_t
udp_dgram_recv
;
// The number of UDP datagrams sent.
size_t
udp_dgram_sent
;
};
enum
ClientState
{
CLIENT_IDLE
,
CLIENT_CONNECTED
};
...
...
This diff is collapsed.
Click to expand it.
src/h2load_quic.cc
View file @
e584d9cd
...
...
@@ -524,6 +524,8 @@ int Client::read_quic() {
assert
(
quic
.
conn
);
++
worker
->
stats
.
udp_dgram_recv
;
auto
path
=
ngtcp2_path
{
{
local_addr
.
len
,
&
local_addr
.
su
.
sa
},
{
addrlen
,
&
su
.
sa
},
...
...
This diff is collapsed.
Click to expand it.
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