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
Xiaowu Zhang
apachedex
Commits
75507403
Commit
75507403
authored
Apr 06, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide W3C names for status codes.
parent
15e1a7f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
apachedex/__init__.py
apachedex/__init__.py
+11
-2
apachedex/apachedex.css
apachedex/apachedex.css
+5
-0
No files found.
apachedex/__init__.py
View file @
75507403
...
...
@@ -34,6 +34,7 @@ from operator import itemgetter
from
urllib
import
splittype
,
splithost
import
argparse
import
gzip
import
httplib
import
itertools
import
json
import
math
...
...
@@ -312,11 +313,18 @@ class GenericSiteStats(object):
append
(
'</tr>'
)
def
hitTd
(
hit
,
status
):
return
'<td class="%s">%s</td>'
%
(
getClassForStatusHit
(
hit
,
status
),
hit
)
def
statusAsHtml
(
status
):
try
:
definition
=
httplib
.
responses
[
int
(
status
)]
except
KeyError
:
return
status
else
:
return
'<abbr title="%s">%s</abbr>'
%
(
definition
,
status
)
has_errors
=
False
for
status
,
data_dict
in
sorted
(
filtered_status
.
iteritems
(),
key
=
ITEMGETTER0
):
has_errors
|=
statusIsError
(
status
)
append
(
'<tr><th>%s</th>'
%
status
)
append
(
'<tr><th>%s</th>'
%
status
AsHtml
(
status
)
)
append
(
hitTd
(
sum
(
data_dict
.
itervalues
()),
status
))
for
date
in
column_list
:
append
(
hitTd
(
data_dict
[
date
],
status
))
...
...
@@ -334,7 +342,8 @@ class GenericSiteStats(object):
'<th>hits</th><th>url</th><th>referers</th></tr>'
)
for
status
,
url_list
in
sorted
(
filtered_status_url
.
iteritems
(),
key
=
ITEMGETTER0
):
append
(
'<tr><th rowspan="%s">%s</th>'
%
(
len
(
url_list
),
status
))
append
(
'<tr><th rowspan="%s">%s</th>'
%
(
len
(
url_list
),
statusAsHtml
(
status
)))
first_url
=
True
for
url
,
referer_counter
in
url_list
:
if
first_url
:
...
...
apachedex/apachedex.css
View file @
75507403
...
...
@@ -116,3 +116,8 @@ h2 {
.tooltip
.x
br
{
display
:
none
;
}
abbr
{
border-bottom
:
1px
dotted
#000
;
cursor
:
help
;
}
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