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
cdd5d088
Commit
cdd5d088
authored
Apr 07, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5 stats: separate ERP5Site_viewSearchResult from "(other)".
parent
a445c919
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
apachedex/__init__.py
apachedex/__init__.py
+30
-11
No files found.
apachedex/__init__.py
View file @
cdd5d088
...
...
@@ -448,6 +448,7 @@ class ERP5SiteStats(GenericSiteStats):
self
.
module
=
defaultdict
(
partial
(
defaultdict
,
partial
(
defaultdict
,
partial
(
APDEXStats
,
threshold
,
getDuration
))))
self
.
no_module
=
defaultdict
(
partial
(
APDEXStats
,
threshold
,
getDuration
))
self
.
site_search
=
defaultdict
(
partial
(
APDEXStats
,
threshold
,
getDuration
))
def
rescale
(
self
,
convert
,
getDuration
):
super
(
ERP5SiteStats
,
self
).
rescale
(
convert
,
getDuration
)
...
...
@@ -458,10 +459,11 @@ class ERP5SiteStats(GenericSiteStats):
for
date
,
data
in
date_dict
.
iteritems
():
new_date_dict
[
convert
(
date
)].
accumulateFrom
(
data
)
document_dict
[
is_document
]
=
new_date_dict
new_no_module
=
defaultdict
(
partial
(
APDEXStats
,
threshold
,
getDuration
))
for
date
,
data
in
self
.
no_module
.
iteritems
():
new_no_module
[
convert
(
date
)].
accumulateFrom
(
data
)
self
.
no_module
=
new_no_module
for
attribute_id
in
(
'no_module'
,
'site_search'
):
attribute
=
defaultdict
(
partial
(
APDEXStats
,
threshold
,
getDuration
))
for
date
,
data
in
getattr
(
self
,
attribute_id
).
iteritems
():
attribute
[
convert
(
date
)].
accumulateFrom
(
data
)
setattr
(
self
,
attribute_id
,
attribute
)
def
accumulate
(
self
,
match
,
url_match
,
date
):
split
=
self
.
suffix
(
url_match
.
group
(
'url'
)).
split
(
'?'
,
1
)[
0
].
split
(
'/'
)
...
...
@@ -471,6 +473,8 @@ class ERP5SiteStats(GenericSiteStats):
self
.
module
[
module
][
len
(
split
)
>
1
and
(
split
[
1
]
!=
'view'
and
'_view'
not
in
split
[
1
])
][
date
].
accumulate
(
match
)
elif
split
and
split
[
0
]
==
'ERP5Site_viewSearchResult'
:
self
.
site_search
[
date
].
accumulate
(
match
)
else
:
self
.
no_module
[
date
].
accumulate
(
match
)
...
...
@@ -502,6 +506,11 @@ class ERP5SiteStats(GenericSiteStats):
for
date
,
value
in
self
.
no_module
.
iteritems
():
filtered_no_module
[
stat_filter
(
date
)].
accumulateFrom
(
value
)
column_set
=
set
(
filtered_no_module
)
filtered_site_search
=
defaultdict
(
partial
(
APDEXStats
,
self
.
threshold
,
None
))
for
date
,
value
in
self
.
site_search
.
iteritems
():
filtered_site_search
[
stat_filter
(
date
)].
accumulateFrom
(
value
)
column_set
.
update
(
filtered_site_search
)
for
key
,
is_document_dict
in
self
.
module
.
iteritems
():
filtered_is_document_dict
=
filtered_module
[
key
]
for
key
,
data_dict
in
is_document_dict
.
iteritems
():
...
...
@@ -556,11 +565,17 @@ class ERP5SiteStats(GenericSiteStats):
append
(
'<tr class="group_top group_bottom"><th colspan="2">(none)</th>'
)
hiddenGraph
(
self
.
no_module
,
'(none)'
)
no_module_overall
=
apdexAsColumns
(
filtered_no_module
)
append
(
'<tr class="group_top group_bottom"><th colspan="2">site search'
'</th>'
)
hiddenGraph
(
self
.
site_search
,
'site search'
)
site_search_overall
=
apdexAsColumns
(
filtered_site_search
)
append
(
'</tr></table><h2>Per-level overall</h2><table class="stats"><tr>'
'<th>level</th>'
)
append
(
APDEXStats
.
asHTMLHeader
())
append
(
'</tr><tr><th>top</th>'
)
append
(
no_module_overall
.
asHTML
(
self
.
threshold
))
append
(
'</tr><tr><th>site search</th>'
)
append
(
site_search_overall
.
asHTML
(
self
.
threshold
))
append
(
'</tr><tr><th>module</th>'
)
append
(
module_document_overall
[
False
].
asHTML
(
self
.
threshold
))
append
(
'</tr><tr><th>document</th>'
)
...
...
@@ -579,9 +594,10 @@ class ERP5SiteStats(GenericSiteStats):
date_dict
=
module_dict
[
is_document
==
'true'
]
for
date
,
apdex_state
in
date_dict_state
.
iteritems
():
date_dict
[
date
]
=
APDEXStats
.
fromJSONState
(
apdex_state
,
getDuration
)
no_module
=
result
.
no_module
for
date
,
apdex_state
in
state
[
'no_module'
].
iteritems
():
no_module
[
date
]
=
APDEXStats
.
fromJSONState
(
apdex_state
,
getDuration
)
for
attribute_id
in
(
'no_module'
,
'site_search'
):
attribute
=
getattr
(
result
,
attribute_id
)
for
date
,
apdex_state
in
state
[
attribute_id
].
iteritems
():
attribute
[
date
]
=
APDEXStats
.
fromJSONState
(
apdex_state
,
getDuration
)
return
result
def
asJSONState
(
self
):
...
...
@@ -591,7 +607,9 @@ class ERP5SiteStats(GenericSiteStats):
module_dict_state
=
module
[
module_id
]
=
{}
for
is_document
,
date_dict
in
module_dict
.
iteritems
():
module_dict_state
[
is_document
]
=
_APDEXDateDictAsJSONState
(
date_dict
)
result
[
'no_module'
]
=
_APDEXDateDictAsJSONState
(
self
.
no_module
)
for
attribute_id
in
(
'no_module'
,
'site_search'
):
result
[
attribute_id
]
=
_APDEXDateDictAsJSONState
(
getattr
(
self
,
attribute_id
))
return
result
def
accumulateFrom
(
self
,
other
):
...
...
@@ -603,9 +621,10 @@ class ERP5SiteStats(GenericSiteStats):
date_dict
=
module_dict
[
is_document
]
for
date
,
apdex
in
other_date_dict
.
iteritems
():
date_dict
[
date
].
accumulateFrom
(
apdex
)
no_module
=
self
.
no_module
for
date
,
apdex
in
other
.
no_module
.
iteritems
():
no_module
[
date
].
accumulateFrom
(
apdex
)
for
attribute_id
in
(
'no_module'
,
'site_search'
):
attribute
=
getattr
(
self
,
attribute_id
)
for
date
,
apdex
in
getattr
(
other
,
attribute_id
).
iteritems
():
attribute
[
date
].
accumulateFrom
(
apdex
)
DURATION_US_FORMAT
=
'%D'
DURATION_S_FORMAT
=
'%T'
...
...
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