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
965f6d73
Commit
965f6d73
authored
Apr 03, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more specific CSS selectors.
parent
90e515fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
apachedex/__init__.py
apachedex/__init__.py
+11
-9
No files found.
apachedex/__init__.py
View file @
965f6d73
...
...
@@ -186,7 +186,7 @@ class GenericSiteStats(object):
filtered_date_dict
[
stat_filter
(
date
)]
+=
value
column_set
.
update
(
filtered_date_dict
)
column_list
=
sorted
(
column_set
)
append
(
'<h2>Hit per status code</h2><table><tr><th>status</th>'
append
(
'<h2>Hit per status code</h2><table
class="stats"
><tr><th>status</th>'
'<th>overall</th>'
)
for
date
in
column_list
:
append
(
'<th>%s</th>'
%
date
)
...
...
@@ -209,7 +209,7 @@ class GenericSiteStats(object):
filtered_status_url
[
status
]
=
sorted
(
((
key
,
Counter
(
value
))
for
key
,
value
in
url_dict
.
iteritems
()),
key
=
lambda
x
:
getHitForUrl
(
x
[
1
]),
reverse
=
True
)[:
N_ERROR_URL
]
append
(
'<h3>Error detail</h3><table><tr><th>status</th><th>hit</th>'
append
(
'<h3>Error detail</h3><table
class="stats"
><tr><th>status</th><th>hit</th>'
'<th>url</th><th>referers</th></tr>'
)
for
status
,
url_list
in
sorted
(
filtered_status_url
.
iteritems
(),
key
=
ITEMGETTER0
):
...
...
@@ -230,7 +230,7 @@ class GenericSiteStats(object):
))
append
(
'</tr>'
)
append
(
'</table>'
)
append
(
'<h2>Slowest pages</h2><table><tr><th>duration (s)</th>'
append
(
'<h2>Slowest pages</h2><table
class="stats"
><tr><th>duration (s)</th>'
'<th>date</th><th>url</th><th>referer</th></tr>'
)
for
duration
,
timestamp
,
url
,
referer
in
reversed
(
self
.
slowest_list
):
if
timestamp
is
None
:
...
...
@@ -280,7 +280,7 @@ class ERP5SiteStats(GenericSiteStats):
def
asHTML
(
self
,
stat_filter
=
lambda
x
:
x
):
result
=
[]
append
=
result
.
append
append
(
'<h2>Per module</h2><table><tr><th rowspan="2" colspan="2">'
append
(
'<h2>Per module</h2><table
class="stats"
><tr><th rowspan="2" colspan="2">'
'module</th><th colspan="4">overall</th>'
)
filtered_module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
defaultdict
,
partial
(
APDEXStats
,
self
.
threshold
))))
...
...
@@ -516,13 +516,15 @@ def main():
os
.
chdir
(
args
.
out
)
with
open
(
'index.html'
,
'w'
)
as
out
:
out
.
write
(
'<html><head><title>Stats</title><style>'
'th, td { border: solid 1px #000; } th { text-align: center; } '
'td { text-align: right; } th.text, td.text { text-align: left; } '
'table { border-collapse: collapse; } '
'.stats th, .stats td { border: solid 1px #000; } '
'.stats th { text-align: center; } '
'.stats td { text-align: right; } '
'.stats th.text, .stats td.text { text-align: left; } '
'table.stats { border-collapse: collapse; } '
'.problem { background-color: #f00; color: white; } '
'.warning { background-color: #f80; color: white; }'
'</style></head><body><h1>Overall</h1>'
'<h2>Hits per day</h2><table><tr><th>date</th><th>hits</th></tr>'
)
'<h2>Hits per day</h2><table
class="stats"
><tr><th>date</th><th>hits</th></tr>'
)
for
date
,
hit
in
sorted
(
hit_per_day
.
iteritems
(),
key
=
ITEMGETTER0
):
out
.
write
(
'<tr><td>%s</td><td>%s</td></tr>'
%
(
date
,
hit
))
out
.
write
(
'</table>'
)
...
...
@@ -573,7 +575,7 @@ def main():
out
.
write
(
data
.
asHTML
(
decimator
))
end_stat_time
=
time
.
time
()
if
args
.
stats
:
out
.
write
(
'<h1>Parsing stats</h1><table>'
)
out
.
write
(
'<h1>Parsing stats</h1><table
class="stats"
>'
)
for
caption
,
value
in
(
(
'Execution date'
,
datetime
.
now
().
isoformat
()),
(
'File count'
,
file_count
),
...
...
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