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
e245ddc9
Commit
e245ddc9
authored
Apr 05, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare "graph" function reuse.
parent
e36ddfab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
apachedex/__init__.py
apachedex/__init__.py
+12
-9
No files found.
apachedex/__init__.py
View file @
e245ddc9
...
...
@@ -674,12 +674,15 @@ def main():
out
.
write
(
'<tr><td>%s</td><td>%s</td></tr>'
%
(
date
,
hit
))
out
.
write
(
'</table>'
)
def
graph
(
title
,
data
,
options
=
{}):
out
.
write
(
'<h2>%s</h2><div class="graph" '
result
=
[]
append
=
result
.
append
append
(
'<h2>%s</h2><div class="graph" '
'style="width:600px;height:300px" data-points="'
%
title
)
out
.
write
(
escape
(
json
.
dumps
(
data
),
quote
=
True
))
out
.
write
(
'" data-options="'
)
out
.
write
(
escape
(
json
.
dumps
(
options
),
quote
=
True
))
out
.
write
(
'"></div>'
)
append
(
escape
(
json
.
dumps
(
data
),
quote
=
True
))
append
(
'" data-options="'
)
append
(
escape
(
json
.
dumps
(
options
),
quote
=
True
))
append
(
'"></div>'
)
return
''
.
join
(
result
)
for
site_id
,
data
in
per_site
.
iteritems
():
out
.
write
(
'<h1>Site: %s</h1>'
%
site_id
)
daily_data
=
data
.
getApdexData
()
...
...
@@ -703,7 +706,7 @@ def main():
# Guesstimation: 6px per digit. If only em were allowed...
yLabelWidth
=
max
(
int
(
math
.
log10
(
max
(
x
[
2
]
for
x
in
daily_data
)))
+
1
,
3
)
*
6
graph
(
'apdex'
,
out
.
write
(
graph
(
'apdex'
,
[
zip
(
date_list
,
(
x
[
1
]
for
x
in
daily_data
))],
{
'xaxis'
:
{
...
...
@@ -718,8 +721,8 @@ def main():
},
'lines'
:
{
'show'
:
True
},
},
)
graph
(
'Hits (per %s)'
%
graph_period
,
)
)
out
.
write
(
graph
(
'Hits (per %s)'
%
graph_period
,
[
zip
(
date_list
,
(
x
[
2
]
for
x
in
daily_data
))],
{
'xaxis'
:
{
...
...
@@ -734,7 +737,7 @@ def main():
},
'lines'
:
{
'show'
:
True
},
},
)
)
)
out
.
write
(
data
.
asHTML
(
decimator
))
end_stat_time
=
time
.
time
()
if
args
.
stats
:
...
...
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