Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
Commits
8ee15339
Commit
8ee15339
authored
Feb 13, 2014
by
Jonathan Jenkins
Browse files
fixed end-of-sim time bug in example
parent
27feaac2
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/example/example.c
View file @
8ee15339
...
...
@@ -61,6 +61,7 @@ struct svr_state
int
msg_recvd_count
;
/* requests recvd */
int
local_recvd_count
;
/* number of local messages received */
tw_stime
start_ts
;
/* time that we started sending requests */
tw_stime
end_ts
;
/* time that last request finished */
};
/* this struct serves as the ***temporary*** event data, which can be thought
...
...
@@ -355,8 +356,14 @@ static void svr_finalize(
svr_state
*
ns
,
tw_lp
*
lp
)
{
printf
(
"server %llu recvd %d bytes in %f seconds, %f MiB/s sent_count %d recvd_count %d local_count %d
\n
"
,
(
unsigned
long
long
)(
lp
->
gid
/
2
),
payload_sz
*
ns
->
msg_recvd_count
,
ns_to_s
((
tw_now
(
lp
)
-
ns
->
start_ts
)),
((
double
)(
payload_sz
*
num_reqs
)
/
(
double
)(
1024
*
1024
)
/
ns_to_s
(
tw_now
(
lp
)
-
ns
->
start_ts
)),
ns
->
msg_sent_count
,
ns
->
msg_recvd_count
,
ns
->
local_recvd_count
);
printf
(
"server %llu recvd %d bytes in %lf seconds, %lf MiB/s sent_count %d recvd_count %d local_count %d
\n
"
,
(
unsigned
long
long
)(
lp
->
gid
/
2
),
payload_sz
*
ns
->
msg_recvd_count
,
ns_to_s
(
ns
->
end_ts
-
ns
->
start_ts
),
((
double
)(
payload_sz
*
num_reqs
)
/
(
double
)(
1024
*
1024
)
/
ns_to_s
(
ns
->
end_ts
-
ns
->
start_ts
)),
ns
->
msg_sent_count
,
ns
->
msg_recvd_count
,
ns
->
local_recvd_count
);
return
;
}
...
...
@@ -492,6 +499,7 @@ static void handle_ack_event(
{
/* threshold count reached, stop sending messages */
m
->
incremented_flag
=
0
;
ns
->
end_ts
=
tw_now
(
lp
);
}
return
;
}
...
...
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