Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
picoquic
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kashyap Thimmaraju
picoquic
Commits
8cbbbdcb
Commit
8cbbbdcb
authored
6 years ago
by
huitema
Browse files
Options
Downloads
Patches
Plain Diff
Add command line argument to set stress duration in minutes in test program
parent
b3ae8320
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
picoquic_t/picoquic_t.c
+26
-3
26 additions, 3 deletions
picoquic_t/picoquic_t.c
picoquictest/picoquictest.h
+5
-0
5 additions, 0 deletions
picoquictest/picoquictest.h
picoquictest/stresstest.c
+10
-0
10 additions, 0 deletions
picoquictest/stresstest.c
with
41 additions
and
3 deletions
picoquic_t/picoquic_t.c
+
26
−
3
View file @
8cbbbdcb
...
...
@@ -143,7 +143,7 @@ static int do_one_test(size_t i, FILE* F)
int
usage
(
char
const
*
argv0
)
{
fprintf
(
stderr
,
"PicoQUIC test exe
x
ution
\n
"
);
fprintf
(
stderr
,
"PicoQUIC test exe
c
ution
\n
"
);
fprintf
(
stderr
,
"Usage: picoquic_ct [-x <excluded>] [<list of tests]
\n
"
);
fprintf
(
stderr
,
"
\n
Usage: %s [test1 [test2 ..[testN]]]
\n\n
"
,
argv0
);
fprintf
(
stderr
,
" Or: %s [-x test]*"
,
argv0
);
...
...
@@ -158,6 +158,7 @@ int usage(char const * argv0)
}
fprintf
(
stderr
,
"Options:
\n
"
);
fprintf
(
stderr
,
" -x test Do not run the specified test.
\n
"
);
fprintf
(
stderr
,
" -s nnn Run stress for nnn minutes.
\n
"
);
fprintf
(
stderr
,
" -h Print this help message
\n
"
);
return
-
1
;
...
...
@@ -181,6 +182,8 @@ int main(int argc, char** argv)
int
ret
=
0
;
int
nb_test_tried
=
0
;
int
nb_test_failed
=
0
;
int
stress_minutes
=
0
;
int
found_exclusion
=
0
;
int
*
is_excluded
=
malloc
(
sizeof
(
int
)
*
nb_tests
);
int
opt
;
...
...
@@ -193,7 +196,7 @@ int main(int argc, char** argv)
{
memset
(
is_excluded
,
0
,
sizeof
(
int
)
*
nb_tests
);
while
(
ret
==
0
&&
(
opt
=
getopt
(
argc
,
argv
,
"x:h"
))
!=
-
1
)
{
while
(
ret
==
0
&&
(
opt
=
getopt
(
argc
,
argv
,
"
s:
x:h"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'x'
:
{
int
test_number
=
get_test_number
(
optarg
);
...
...
@@ -204,9 +207,17 @@ int main(int argc, char** argv)
}
else
{
is_excluded
[
test_number
]
=
1
;
found_exclusion
=
1
;
}
break
;
}
case
's'
:
stress_minutes
=
atoi
(
optarg
);
if
(
stress_minutes
<=
0
)
{
fprintf
(
stderr
,
"Incorrect stress minutes: %s
\n
"
,
optarg
);
ret
=
usage
(
argv
[
0
]);
}
break
;
case
'h'
:
usage
(
argv
[
0
]);
exit
(
0
);
...
...
@@ -217,6 +228,18 @@ int main(int argc, char** argv)
}
}
if
(
ret
==
0
&&
stress_minutes
>
0
)
{
if
(
optind
>=
argc
&&
found_exclusion
==
0
)
{
for
(
size_t
i
=
0
;
i
<
nb_tests
;
i
++
)
{
if
(
strcmp
(
test_table
[
i
].
test_name
,
"stress"
)
!=
0
)
{
is_excluded
[
i
]
=
1
;
}
}
picoquic_stress_test_duration
=
stress_minutes
;
picoquic_stress_test_duration
*=
60000000
;
}
}
if
(
ret
==
0
)
{
if
(
optind
>=
argc
)
{
...
...
@@ -228,7 +251,7 @@ int main(int argc, char** argv)
ret
=
-
1
;
}
}
else
{
else
if
(
stress_minutes
==
0
)
{
fprintf
(
stderr
,
"test number %d (%s) is bypassed.
\n
"
,
(
int
)
i
,
test_table
[
i
].
test_name
);
}
}
...
...
This diff is collapsed.
Click to expand it.
picoquictest/picoquictest.h
+
5
−
0
View file @
8cbbbdcb
...
...
@@ -26,6 +26,11 @@
extern
"C"
{
#endif
/* Control variables for the duration of the stress test */
extern
uint64_t
picoquic_stress_test_duration
;
/* In microseconds; defaults to 2 minutes */
/* List of test functions */
int
picohash_test
();
int
cnxcreation_test
();
int
parseheadertest
();
...
...
This diff is collapsed.
Click to expand it.
picoquictest/stresstest.c
+
10
−
0
View file @
8cbbbdcb
...
...
@@ -848,6 +848,10 @@ int stress_test()
{
int
ret
=
0
;
picoquic_stress_ctx_t
stress_ctx
;
int
run_time_seconds
=
0
;
int
wall_time_seconds
=
0
;
uint64_t
wall_time_start
=
picoquic_current_time
();
/* Initialization */
memset
(
&
stress_ctx
,
0
,
sizeof
(
picoquic_stress_ctx_t
));
...
...
@@ -914,5 +918,11 @@ int stress_test()
stress_ctx
.
qserver
=
NULL
;
}
/* Report */
run_time_seconds
=
(
int
)(
stress_ctx
.
simulated_time
/
1000000ull
);
wall_time_seconds
=
(
int
)((
picoquic_current_time
()
-
wall_time_start
)
/
1000000ull
);
DBG_PRINTF
(
"Stress complete after simulating %d s. in %d s., returns %d
\n
"
,
run_time_seconds
,
wall_time_seconds
,
ret
);
return
ret
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment