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
f6b31d26
Commit
f6b31d26
authored
Apr 03, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add no-module stat line.
parent
1b74aad6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
apachedex/__init__.py
apachedex/__init__.py
+16
-12
No files found.
apachedex/__init__.py
View file @
f6b31d26
...
...
@@ -220,10 +220,11 @@ class ERP5SiteStats(GenericSiteStats):
super
(
ERP5SiteStats
,
self
).
__init__
(
threshold
,
prefix
=
prefix
)
# Key levels:
# - module id (string)
# - date (datetime.date)
# - is document (bool)
# - date (datetime.date)
self
.
module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
defaultdict
,
partial
(
APDEXStats
,
threshold
))))
self
.
no_module
=
defaultdict
(
partial
(
APDEXStats
,
threshold
))
def
accumulate
(
self
,
match
,
url_match
,
date
):
prefix
=
self
.
prefix
...
...
@@ -232,7 +233,9 @@ class ERP5SiteStats(GenericSiteStats):
module
=
split
[
0
]
if
module
.
endswith
(
'_module'
):
super
(
ERP5SiteStats
,
self
).
accumulate
(
match
,
url_match
,
date
)
self
.
module
[
module
][
date
][
len
(
split
)
>
2
].
accumulate
(
match
)
self
.
module
[
module
][
len
(
split
)
>
2
][
date
].
accumulate
(
match
)
else
:
self
.
no_module
[
date
].
accumulate
(
match
)
def
asHTML
(
self
):
result
=
[]
...
...
@@ -259,22 +262,23 @@ class ERP5SiteStats(GenericSiteStats):
getClassForDuration
(
data
.
duration_max
,
self
.
threshold
),
float
(
data
.
duration_max
)
/
US_PER_S
,
)
def
apdexAsColumns
(
caption
,
is_document
,
data_dict
):
append
(
'<td>%s</td>'
%
caption
)
def
apdexAsColumns
(
data_dict
):
data_total
=
APDEXStats
(
self
.
threshold
)
for
data
in
data_dict
.
values
():
data_total
.
accumulateFrom
(
data
[
is_document
]
)
data_total
.
accumulateFrom
(
data
)
append
(
apdexStatsAsHtml
(
data_total
))
for
date
in
column_list
:
append
(
apdexStatsAsHtml
(
data_dict
[
date
][
is_document
]))
append
(
'</tr>'
)
append
(
apdexStatsAsHtml
(
data_dict
[
date
]))
for
module_id
,
data_dict
in
sorted
(
self
.
module
.
iteritems
(),
key
=
ITEMGETTER0
):
append
(
'<tr><td rowspan="2">%s</td>'
%
module_id
)
apdexAsColumns
(
'module'
,
False
,
data_dict
)
append
(
'<tr>'
)
apdexAsColumns
(
'document'
,
True
,
data_dict
)
append
(
'</table>'
)
append
(
'<tr><th rowspan="2">%s</th><th>module</th>'
%
module_id
)
apdexAsColumns
(
data_dict
[
False
])
append
(
'</tr><tr><th>document</th>'
)
apdexAsColumns
(
data_dict
[
True
])
append
(
'</tr>'
)
append
(
'<tr><th colspan="2">(none)</th>'
)
apdexAsColumns
(
self
.
no_module
)
append
(
'</tr></table>'
)
append
(
super
(
ERP5SiteStats
,
self
).
asHTML
())
return
'
\
n
'
.
join
(
result
)
...
...
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