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
Arnaud Fontaine
apachedex
Commits
00e121ca
Commit
00e121ca
authored
Apr 06, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include module- and document-level graphs in ERP5 table.
parent
31723edb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
apachedex/__init__.py
apachedex/__init__.py
+25
-4
No files found.
apachedex/__init__.py
View file @
00e121ca
...
@@ -269,7 +269,8 @@ class GenericSiteStats(object):
...
@@ -269,7 +269,8 @@ class GenericSiteStats(object):
def
getApdexData
(
self
):
def
getApdexData
(
self
):
return
getDataPoints
(
self
.
apdex
)
return
getDataPoints
(
self
.
apdex
)
def
asHTML
(
self
,
stat_filter
=
lambda
x
:
x
):
def
asHTML
(
self
,
date_format
,
placeholder_delta
,
graph_period
,
stat_filter
=
lambda
x
:
x
):
result
=
[]
result
=
[]
append
=
result
.
append
append
=
result
.
append
apdex
=
APDEXStats
(
self
.
threshold
,
None
)
apdex
=
APDEXStats
(
self
.
threshold
,
None
)
...
@@ -377,11 +378,12 @@ class ERP5SiteStats(GenericSiteStats):
...
@@ -377,11 +378,12 @@ class ERP5SiteStats(GenericSiteStats):
else
:
else
:
self
.
no_module
[
date
].
accumulate
(
match
)
self
.
no_module
[
date
].
accumulate
(
match
)
def
asHTML
(
self
,
stat_filter
=
lambda
x
:
x
):
def
asHTML
(
self
,
date_format
,
placeholder_delta
,
graph_period
,
stat_filter
=
lambda
x
:
x
):
result
=
[]
result
=
[]
append
=
result
.
append
append
=
result
.
append
append
(
'<h2>Stats per module</h2><table class="stats stats_erp5"><tr>'
append
(
'<h2>Stats per module</h2><table class="stats stats_erp5"><tr>'
'<th rowspan="2" colspan="
2
">module</th>'
'<th rowspan="2" colspan="
3
">module</th>'
'<th colspan="4" class="overall_right">overall</th>'
)
'<th colspan="4" class="overall_right">overall</th>'
)
filtered_module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
filtered_module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
defaultdict
,
partial
(
APDEXStats
,
self
.
threshold
,
None
))))
defaultdict
,
partial
(
APDEXStats
,
self
.
threshold
,
None
))))
...
@@ -410,18 +412,34 @@ class ERP5SiteStats(GenericSiteStats):
...
@@ -410,18 +412,34 @@ class ERP5SiteStats(GenericSiteStats):
append
(
getApdexStatsAsHtml
(
data_total
,
self
.
threshold
,
True
))
append
(
getApdexStatsAsHtml
(
data_total
,
self
.
threshold
,
True
))
for
date
in
column_list
:
for
date
in
column_list
:
append
(
getApdexStatsAsHtml
(
data_dict
[
date
],
self
.
threshold
))
append
(
getApdexStatsAsHtml
(
data_dict
[
date
],
self
.
threshold
))
def
hiddenGraph
(
data_dict
):
append
(
'<td class="text group_right hover">'
)
data
=
getDataPoints
(
data_dict
)
if
len
(
data
)
>
1
:
append
(
'+<div class="hover_target">'
)
append
(
graphPair
(
prepareDataForGraph
(
data
,
date_format
,
placeholder_delta
),
date_format
,
graph_period
,
))
append
(
'</div>'
)
append
(
'</td>'
)
for
module_id
,
data_dict
in
sorted
(
filtered_module
.
iteritems
(),
for
module_id
,
data_dict
in
sorted
(
filtered_module
.
iteritems
(),
key
=
ITEMGETTER0
):
key
=
ITEMGETTER0
):
append
(
'<tr class="group_top"><th rowspan="2">%s</th>'
append
(
'<tr class="group_top"><th rowspan="2">%s</th>'
'<th>module</th>'
%
module_id
)
'<th>module</th>'
%
module_id
)
hiddenGraph
(
self
.
module
[
module_id
][
False
])
apdexAsColumns
(
data_dict
[
False
])
apdexAsColumns
(
data_dict
[
False
])
append
(
'</tr><tr class="group_bottom"><th>document</th>'
)
append
(
'</tr><tr class="group_bottom"><th>document</th>'
)
hiddenGraph
(
self
.
module
[
module_id
][
True
])
apdexAsColumns
(
data_dict
[
True
])
apdexAsColumns
(
data_dict
[
True
])
append
(
'</tr>'
)
append
(
'</tr>'
)
append
(
'<tr class="group_top group_bottom"><th colspan="2">(none)</th>'
)
append
(
'<tr class="group_top group_bottom"><th colspan="2">(none)</th>'
)
hiddenGraph
(
self
.
no_module
)
apdexAsColumns
(
filtered_no_module
)
apdexAsColumns
(
filtered_no_module
)
append
(
'</tr></table>'
)
append
(
'</tr></table>'
)
append
(
super
(
ERP5SiteStats
,
self
).
asHTML
(
stat_filter
=
stat_filter
))
append
(
super
(
ERP5SiteStats
,
self
).
asHTML
(
date_format
,
placeholder_delta
,
graph_period
,
stat_filter
=
stat_filter
))
return
'
\
n
'
.
join
(
result
)
return
'
\
n
'
.
join
(
result
)
DURATION_US_FORMAT
=
'%D'
DURATION_US_FORMAT
=
'%D'
...
@@ -701,6 +719,9 @@ def main():
...
@@ -701,6 +719,9 @@ def main():
'.stats_erp5 td.group_left { border-left-style: solid; } '
'.stats_erp5 td.group_left { border-left-style: solid; } '
'.stats_erp5 td.group_right { border-right-style: solid; } '
'.stats_erp5 td.group_right { border-right-style: solid; } '
'.stats_erp5 .overall_right { border-right-width: .2em; } '
'.stats_erp5 .overall_right { border-right-width: .2em; } '
'.hover_target { visibility: hidden; position: fixed; '
'top: 0; right: 0; background-color: #fff; border: 1px solid #000; } '
'.hover:hover .hover_target { visibility: visible; } '
'table.stats { border-collapse: collapse; } '
'table.stats { border-collapse: collapse; } '
'.problem { background-color: #f00; color: white; } '
'.problem { background-color: #f00; color: white; } '
'.warning { background-color: #f80; color: white; } '
'.warning { background-color: #f80; color: white; } '
...
...
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