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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
apachedex
Commits
ab6cae21
Commit
ab6cae21
authored
Apr 04, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use option groups to make --help easier to read.
parent
90ba5e0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
25 deletions
+32
-25
apachedex/__init__.py
apachedex/__init__.py
+32
-25
No files found.
apachedex/__init__.py
View file @
ab6cae21
...
...
@@ -380,45 +380,52 @@ period_parser = {
}
def
main
():
file_dir
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
parser
=
argparse
.
ArgumentParser
(
description
=
'Compute Apdex out of
log files'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'Compute Apdex out of '
'apache-style
log files'
)
parser
.
add_argument
(
'logfile'
,
nargs
=
'+'
,
help
=
'Log files to process'
)
parser
.
add_argument
(
'-a'
,
'--apdex'
,
default
=
US_PER_S
,
type
=
int
,
parser
.
add_argument
(
'-l'
,
'--logformat'
,
default
=
'%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i" %D'
,
help
=
'Apache LogFormat used to generate provided logs. '
'Default: %(default)r'
)
parser
.
add_argument
(
'-o'
,
'--out'
,
default
=
os
.
getcwd
(),
help
=
'Directory in which statistic files will be generated. '
'Default: %(default)s'
)
parser
.
add_argument
(
'-q'
,
'--quiet'
,
action
=
'store_true'
,
help
=
'Suppress warnings about malformed lines.'
)
parser
.
add_argument
(
'--js'
,
default
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)),
help
=
'Folder containing needed js files. Default: %(default)s'
)
group
=
parser
.
add_argument_group
(
'generated content'
)
group
.
add_argument
(
'-a'
,
'--apdex'
,
default
=
US_PER_S
,
type
=
int
,
help
=
'First threshold for Apdex computation, in microseconds. '
'Default: %(default)r'
)
parser
.
add_argument
(
'-e'
,
'--error-detail'
,
action
=
'store_true'
,
group
.
add_argument
(
'-e'
,
'--error-detail'
,
action
=
'store_true'
,
help
=
'Include detailed report (url & referers) for error statuses.'
)
parser
.
add_argument
(
'-d'
,
'--default'
,
group
.
add_argument
(
'-p'
,
'--period'
,
default
=
'day'
,
choices
=
period_parser
,
help
=
'Periodicity of sampling buckets. Default: %(default)r'
)
group
.
add_argument
(
'-s'
,
'--stats'
,
action
=
'store_true'
,
help
=
'Enable parsing stats (time spent parsing input, time spent '
'generating output, ...)'
)
group
.
add_argument
(
'--js-embed'
,
action
=
'store_true'
,
help
=
'Embed js files instead of linking to them.'
)
group
=
parser
.
add_argument_group
(
'site matching'
)
group
.
add_argument
(
'-d'
,
'--default'
,
help
=
'Caption for lines matching no prefix, or skip them if not provided.'
)
parser
.
add_argument
(
'--base'
,
dest
=
'path'
,
default
=
[],
nargs
=
'+'
,
group
.
add_argument
(
'--base'
,
dest
=
'path'
,
default
=
[],
nargs
=
'+'
,
action
=
AggregateSiteUrl
,
help
=
'Absolute base url of some part of a site (see also '
'--erp5-base).'
)
parser
.
add_argument
(
'--erp5-base'
,
dest
=
'path'
,
nargs
=
'+'
,
group
.
add_argument
(
'--erp5-base'
,
dest
=
'path'
,
nargs
=
'+'
,
action
=
AggregateSiteUrl
,
help
=
'Absolute base url of some part of an ERP5 site (extra '
'stats).'
)
parser
.
add_argument
(
'--skip-base'
,
dest
=
'path'
,
nargs
=
'+'
,
group
.
add_argument
(
'--skip-base'
,
dest
=
'path'
,
nargs
=
'+'
,
action
=
AggregateSiteUrl
,
help
=
'Absolute base url to ignore.'
)
parser
.
add_argument
(
'-l'
,
'--logformat'
,
default
=
'%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i" %D'
,
help
=
'Apache LogFormat used to generate provided logs. '
'Default: %(default)r'
)
parser
.
add_argument
(
'-o'
,
'--out'
,
default
=
'.'
,
help
=
'Directory in which statistic files will be generated. '
'Default: %(default)r'
)
parser
.
add_argument
(
'-p'
,
'--period'
,
default
=
'day'
,
choices
=
period_parser
,
help
=
'Periodicity of sampling buckets. Default: %(default)r'
)
parser
.
add_argument
(
'-q'
,
'--quiet'
,
action
=
'store_true'
,
help
=
'Suppress warnings about malformed lines.'
)
parser
.
add_argument
(
'-s'
,
'--stats'
,
action
=
'store_true'
,
help
=
'Enable parsing stats (time taken to parse all files, ...)'
)
parser
.
add_argument
(
'--js'
,
default
=
file_dir
,
help
=
'Folder containing needed js files. Default: %(default)s'
)
parser
.
add_argument
(
'--js-embed'
,
action
=
'store_true'
,
help
=
'Embed js files instead of linking to them.'
)
args
=
parser
.
parse_args
()
line_regex
=
''
try
:
...
...
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