Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apachedex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
apachedex
Commits
2a3edb84
Commit
2a3edb84
authored
Apr 20, 2021
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apachedex: Implement a duration cap.
parent
d743c185
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
apachedex/__init__.py
apachedex/__init__.py
+16
-0
No files found.
apachedex/__init__.py
View file @
2a3edb84
...
@@ -1309,6 +1309,12 @@ def main():
...
@@ -1309,6 +1309,12 @@ def main():
'but requires pytz module, fixed UTC offsets can be provided in the '
'but requires pytz module, fixed UTC offsets can be provided in the '
'+hhmm form (ex: -0700 for UTC-7). This form does not require pytz '
'+hhmm form (ex: -0700 for UTC-7). This form does not require pytz '
'module.'
)
'module.'
)
parser
.
add_argument
(
'--duration-cap'
,
type
=
float
,
help
=
'Duration, in seconda, to set as an upper limit to request '
'durations: anything longer than this will be set to this value. '
'Useful when migrating from one configuration/software package to '
'another while keeping results comparable even if the latter has a '
'much larger (and possibly non-configurable) total request timeout.'
)
group
=
parser
.
add_argument_group
(
'generated content (all formats)'
)
group
=
parser
.
add_argument_group
(
'generated content (all formats)'
)
group
.
add_argument
(
'-a'
,
'--apdex'
,
default
=
1.0
,
type
=
float
,
group
.
add_argument
(
'-a'
,
'--apdex'
,
default
=
1.0
,
type
=
float
,
...
@@ -1384,6 +1390,16 @@ def main():
...
@@ -1384,6 +1390,16 @@ def main():
else
:
else
:
parser
.
error
(
'Neither %D nor %T are present in logformat, apdex '
parser
.
error
(
'Neither %D nor %T are present in logformat, apdex '
'cannot be computed.'
)
'cannot be computed.'
)
if
args
.
duration_cap
:
def
getDuration
(
match
,
_duration_cap
=
int
(
args
.
duration_cap
*
US_PER_S
),
_getDuration
=
getDuration
,
):
duration
=
_getDuration
(
match
)
if
duration
>
_duration_cap
:
return
_duration_cap
return
duration
if
args
.
match_servername
is
not
None
and
\
if
args
.
match_servername
is
not
None
and
\
args
.
match_servername
not
in
args
.
logformat
:
args
.
match_servername
not
in
args
.
logformat
:
parser
.
error
(
'--match-servername %s requested, but missing '
parser
.
error
(
'--match-servername %s requested, but missing '
...
...
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