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
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
apachedex
Commits
73d85e7d
Commit
73d85e7d
authored
Apr 03, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use auto locator & formater.
With (hopefully) appropriate settings.
parent
75fdd631
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
apachedex/__init__.py
apachedex/__init__.py
+9
-18
No files found.
apachedex/__init__.py
View file @
73d85e7d
...
...
@@ -52,13 +52,7 @@ except ImportError:
else
:
matplotlib
.
use
(
'Agg'
)
import
matplotlib.pyplot
as
pyplot
from
matplotlib.dates
import
(
DateFormatter
,
DayLocator
,
HourLocator
,
AutoDateLocator
,
AutoDateFormatter
,
)
from
matplotlib.dates
import
AutoDateLocator
,
AutoDateFormatter
MONTH_VALUE_DICT
=
dict
((
y
,
x
)
for
(
x
,
y
)
in
enumerate
((
'Jan'
,
'Feb'
,
'Mar'
,
...
...
@@ -537,17 +531,14 @@ def main():
daily_data
=
data
.
getApdexData
()
date_list
=
[
datetime
.
strptime
(
x
[
0
],
'%Y/%m/%d'
+
{
'day'
:
' %H'
}.
get
(
args
.
period
,
''
))
for
x
in
daily_data
]
date_range
=
date_list
[
-
1
]
-
date_list
[
0
]
if
date_range
<
timedelta
(
2
):
date_formatter
=
DateFormatter
(
'%Y-%m-%dT%H'
)
date_locator
=
HourLocator
(
interval
=
int
((
date_range
/
4
).
total_seconds
()
/
3600
))
elif
date_range
<
timedelta
(
6
):
date_formatter
=
DateFormatter
(
'%Y-%m-%d'
)
date_locator
=
DayLocator
()
else
:
date_locator
=
AutoDateLocator
()
date_locator
=
AutoDateLocator
(
minticks
=
3
,
maxticks
=
5
)
date_formatter
=
AutoDateFormatter
(
date_locator
)
date_formatter
.
scaled
=
{
365.
:
'%Y'
,
30.
:
'%Y/%m'
,
1.
:
'%Y/%m/%d'
,
1.
/
24
:
'%Y/%m/%d
\
n
%H:%M'
,
}
apdex_plot
=
pyplot
.
subplot
(
2
,
1
,
1
)
apdex_plot
.
xaxis
.
set_major_locator
(
date_locator
)
apdex_plot
.
xaxis
.
set_major_formatter
(
date_formatter
)
...
...
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