Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a725be3a
authored
Mar 08, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix graphite graphs
parent
980c92b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
circle/dashboard/views.py
+16
-14
No files found.
circle/dashboard/views.py
View file @
a725be3a
...
...
@@ -1606,16 +1606,6 @@ class TransferOwnershipConfirmView(LoginRequiredMixin, View):
class
GraphViewBase
(
LoginRequiredMixin
,
View
):
metrics
=
{
'cpu'
:
(
'cactiStyle(alias(derivative(
%
s.cpu.usage),'
'"cpu usage (
%%
)"))'
),
'memory'
:
(
'cactiStyle(alias(
%
s.memory.usage,'
'"memory usage (
%%
)"))'
),
'network'
:
(
'cactiStyle(aliasByMetric('
'derivative(
%
s.network.bytes_*)))'
),
}
@staticmethod
def
get_graphite_url
():
graphite_host
=
getenv
(
"GRAPHITE_HOST"
,
None
)
...
...
@@ -1641,7 +1631,7 @@ class GraphViewBase(LoginRequiredMixin, View):
raise
Http404
()
prefix
=
self
.
get_prefix
(
instance
)
target
=
self
.
metrics
[
metric
]
%
prefix
target
=
self
.
metrics
[
metric
]
%
{
'prefix'
:
prefix
}
title
=
self
.
get_title
(
instance
,
metric
)
params
=
{
'target'
:
target
,
'from'
:
'-
%
s'
%
time
,
...
...
@@ -1665,6 +1655,18 @@ class GraphViewBase(LoginRequiredMixin, View):
class
VmGraphView
(
GraphViewBase
):
metrics
=
{
'cpu'
:
(
'cactiStyle(alias(nonNegativeDerivative(
%(prefix)
s.cpu.usage),'
'"cpu usage (
%%
)"))'
),
'memory'
:
(
'cactiStyle(alias(
%(prefix)
s.memory.usage,'
'"memory usage (
%%
)"))'
),
'network'
:
(
'group('
'aliasSub(nonNegativeDerivative(
%(prefix)
s.network.bytes_recv*),'
' ".*-(
\
d+)
\\
)", "out (vlan
\\
1)"),'
'aliasSub(nonNegativeDerivative(
%(prefix)
s.network.bytes_sent*),'
' ".*-(
\
d+)
\\
)", "in (vlan
\\
1)"))'
),
}
model
=
Instance
def
get_prefix
(
self
,
instance
):
...
...
@@ -1676,12 +1678,12 @@ class VmGraphView(GraphViewBase):
class
NodeGraphView
(
SuperuserRequiredMixin
,
GraphViewBase
):
metrics
=
{
'cpu'
:
(
'cactiStyle(alias(
derivative(
%
s.cpu.times),'
'cpu'
:
(
'cactiStyle(alias(
nonNegativeDerivative(
%(prefix)
s.cpu.times),'
'"cpu usage (
%%
)"))'
),
'memory'
:
(
'cactiStyle(alias(
%
s.memory.usage,'
'memory'
:
(
'cactiStyle(alias(
%
(prefix)
s.memory.usage,'
'"memory usage (
%%
)"))'
),
'network'
:
(
'cactiStyle(aliasByMetric('
'
derivative(
%
s.network.bytes_*)))'
),
'
nonNegativeDerivative(
%(prefix)
s.network.bytes_*)))'
),
}
model
=
Node
...
...
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