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
Jérome Perrin
apachedex
Commits
a2bb7274
Commit
a2bb7274
authored
Apr 03, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Word wrapping.
parent
993d9fcd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
apachedex/__init__.py
apachedex/__init__.py
+10
-10
No files found.
apachedex/__init__.py
View file @
a2bb7274
...
@@ -176,8 +176,8 @@ class GenericSiteStats(object):
...
@@ -176,8 +176,8 @@ class GenericSiteStats(object):
filtered_date_dict
[
stat_filter
(
date
)]
+=
value
filtered_date_dict
[
stat_filter
(
date
)]
+=
value
column_set
.
update
(
filtered_date_dict
)
column_set
.
update
(
filtered_date_dict
)
column_list
=
sorted
(
column_set
)
column_list
=
sorted
(
column_set
)
append
(
'<h2>Hit
per status code</h2><table class="stats"><tr><th>status</th
>'
append
(
'<h2>Hit
s per status code</h2><table class="stats"><tr
>'
'<th>overall</th>'
)
'<th>
status</th><th>
overall</th>'
)
for
date
in
column_list
:
for
date
in
column_list
:
append
(
'<th>%s</th>'
%
date
)
append
(
'<th>%s</th>'
%
date
)
append
(
'</tr>'
)
append
(
'</tr>'
)
...
@@ -199,8 +199,8 @@ class GenericSiteStats(object):
...
@@ -199,8 +199,8 @@ class GenericSiteStats(object):
filtered_status_url
[
status
]
=
sorted
(
filtered_status_url
[
status
]
=
sorted
(
((
key
,
Counter
(
value
))
for
key
,
value
in
url_dict
.
iteritems
()),
((
key
,
Counter
(
value
))
for
key
,
value
in
url_dict
.
iteritems
()),
key
=
lambda
x
:
getHitForUrl
(
x
[
1
]),
reverse
=
True
)[:
N_ERROR_URL
]
key
=
lambda
x
:
getHitForUrl
(
x
[
1
]),
reverse
=
True
)[:
N_ERROR_URL
]
append
(
'<h3>Error detail</h3><table class="stats"><tr><th>status</th>
<th>hit</th>
'
append
(
'<h3>Error detail</h3><table class="stats"><tr><th>status</th>'
'<th>url</th><th>referers</th></tr>'
)
'<th>
hits</th><th>
url</th><th>referers</th></tr>'
)
for
status
,
url_list
in
sorted
(
filtered_status_url
.
iteritems
(),
for
status
,
url_list
in
sorted
(
filtered_status_url
.
iteritems
(),
key
=
ITEMGETTER0
):
key
=
ITEMGETTER0
):
append
(
'<tr><th rowspan="%s">%s</th>'
%
(
len
(
url_list
),
status
))
append
(
'<tr><th rowspan="%s">%s</th>'
%
(
len
(
url_list
),
status
))
...
@@ -220,8 +220,8 @@ class GenericSiteStats(object):
...
@@ -220,8 +220,8 @@ class GenericSiteStats(object):
))
))
append
(
'</tr>'
)
append
(
'</tr>'
)
append
(
'</table>'
)
append
(
'</table>'
)
append
(
'<h2>Slowest pages</h2><table class="stats"><tr>
<th>duration (s)</th>
'
append
(
'<h2>Slowest pages</h2><table class="stats"><tr>'
'<th>date</th><th>url</th><th>referer</th></tr>'
)
'<th>d
uration (s)</th><th>d
ate</th><th>url</th><th>referer</th></tr>'
)
for
duration
,
timestamp
,
url
,
referer
in
reversed
(
self
.
slowest_list
):
for
duration
,
timestamp
,
url
,
referer
in
reversed
(
self
.
slowest_list
):
if
timestamp
is
None
:
if
timestamp
is
None
:
continue
continue
...
@@ -270,8 +270,8 @@ class ERP5SiteStats(GenericSiteStats):
...
@@ -270,8 +270,8 @@ class ERP5SiteStats(GenericSiteStats):
def
asHTML
(
self
,
stat_filter
=
lambda
x
:
x
):
def
asHTML
(
self
,
stat_filter
=
lambda
x
:
x
):
result
=
[]
result
=
[]
append
=
result
.
append
append
=
result
.
append
append
(
'<h2>
Per module</h2><table class="stats"><tr><th rowspan="2" colspan="2"
>'
append
(
'<h2>
Stats per module</h2><table class="stats"><tr
>'
'module</th><th colspan="4">overall</th>'
)
'
<th rowspan="2" colspan="2">
module</th><th colspan="4">overall</th>'
)
filtered_module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
filtered_module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
defaultdict
,
partial
(
APDEXStats
,
self
.
threshold
))))
defaultdict
,
partial
(
APDEXStats
,
self
.
threshold
))))
filtered_no_module
=
defaultdict
(
partial
(
APDEXStats
,
self
.
threshold
))
filtered_no_module
=
defaultdict
(
partial
(
APDEXStats
,
self
.
threshold
))
...
@@ -538,8 +538,8 @@ def main():
...
@@ -538,8 +538,8 @@ def main():
out
.
write
(
'<tr><td>%s</td><td>%s</td></tr>'
%
(
date
,
hit
))
out
.
write
(
'<tr><td>%s</td><td>%s</td></tr>'
%
(
date
,
hit
))
out
.
write
(
'</table>'
)
out
.
write
(
'</table>'
)
def
graph
(
title
,
data
,
options
=
{}):
def
graph
(
title
,
data
,
options
=
{}):
out
.
write
(
'<h2>%s</h2><div class="graph"
style="width:600px;height:300px"
'
out
.
write
(
'<h2>%s</h2><div class="graph" '
'data-points="'
%
title
)
'
style="width:600px;height:300px"
data-points="'
%
title
)
out
.
write
(
escape
(
json
.
dumps
(
data
),
quote
=
True
))
out
.
write
(
escape
(
json
.
dumps
(
data
),
quote
=
True
))
out
.
write
(
'" data-options="'
)
out
.
write
(
'" data-options="'
)
out
.
write
(
escape
(
json
.
dumps
(
options
),
quote
=
True
))
out
.
write
(
escape
(
json
.
dumps
(
options
),
quote
=
True
))
...
...
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