Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
59a2109c
Commit
59a2109c
authored
May 09, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Investigating some performance optimizations, added more perf instrumentation & measurements
parent
7d4e676c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
3 deletions
+58
-3
public/app/controllers/grafanaCtrl.js
+20
-0
public/app/features/panel/panelHelper.js
+36
-1
public/app/features/panellinks/module.js
+1
-1
public/app/panels/graph/module.js
+1
-1
No files found.
public/app/controllers/grafanaCtrl.js
View file @
59a2109c
...
...
@@ -83,6 +83,26 @@ function (angular, config, _, $, store) {
},
function
()
{
});
$rootScope
.
performance
.
panels
=
[];
$scope
.
$on
(
'refresh'
,
function
()
{
if
(
$rootScope
.
performance
.
panels
.
length
>
0
)
{
var
totalRender
=
0
;
var
totalQuery
=
0
;
_
.
each
(
$rootScope
.
performance
.
panels
,
function
(
panelTiming
)
{
totalRender
+=
panelTiming
.
render
;
totalQuery
+=
panelTiming
.
query
;
});
console
.
log
(
'total query: '
+
totalQuery
);
console
.
log
(
'total render: '
+
totalRender
);
console
.
log
(
'avg render: '
+
totalRender
/
$rootScope
.
performance
.
panels
.
length
);
}
$rootScope
.
performance
.
panels
=
[];
});
$scope
.
onAppEvent
(
'dashboard-loaded'
,
function
()
{
count
=
0
;
...
...
public/app/features/panel/panelHelper.js
View file @
59a2109c
...
...
@@ -9,7 +9,39 @@ function (angular, _, kbn, $) {
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
service
(
'panelHelper'
,
function
(
timeSrv
)
{
module
.
service
(
'panelHelper'
,
function
(
timeSrv
,
$rootScope
)
{
var
self
=
this
;
this
.
setTimeQueryStart
=
function
(
scope
)
{
scope
.
timing
=
{};
scope
.
timing
.
queryStart
=
new
Date
().
getTime
();
};
this
.
setTimeQueryEnd
=
function
(
scope
)
{
scope
.
timing
.
queryEnd
=
new
Date
().
getTime
();
};
this
.
setTimeRenderStart
=
function
(
scope
)
{
scope
.
timing
.
renderStart
=
new
Date
().
getTime
();
};
this
.
setTimeRenderEnd
=
function
(
scope
)
{
scope
.
timing
.
renderEnd
=
new
Date
().
getTime
();
};
this
.
broadcastRender
=
function
(
scope
,
data
)
{
this
.
setTimeRenderStart
(
scope
);
scope
.
$broadcast
(
'render'
,
data
);
this
.
setTimeRenderEnd
(
scope
);
if
(
$rootScope
.
profilingEnabled
)
{
$rootScope
.
performance
.
panels
.
push
({
panelId
:
scope
.
panel
.
id
,
query
:
scope
.
timing
.
queryEnd
-
scope
.
timing
.
queryStart
,
render
:
scope
.
timing
.
renderEnd
-
scope
.
timing
.
renderStart
,
});
}
};
this
.
updateTimeRange
=
function
(
scope
)
{
scope
.
range
=
timeSrv
.
timeRange
();
...
...
@@ -72,7 +104,10 @@ function (angular, _, kbn, $) {
cacheTimeout
:
scope
.
panel
.
cacheTimeout
};
this
.
setTimeQueryStart
(
scope
);
return
datasource
.
query
(
metricsQuery
).
then
(
function
(
results
)
{
self
.
setTimeQueryEnd
(
scope
);
if
(
scope
.
dashboard
.
snapshot
)
{
scope
.
panel
.
snapshotData
=
results
;
}
...
...
public/app/features/panellinks/module.js
View file @
59a2109c
...
...
@@ -15,7 +15,7 @@ function (angular, _) {
},
restrict
:
'E'
,
controller
:
'PanelLinksEditorCtrl'
,
templateUrl
:
'app/features/panellink
editor
/module.html'
,
templateUrl
:
'app/features/panellink
s
/module.html'
,
link
:
function
()
{
}
};
...
...
public/app/panels/graph/module.js
View file @
59a2109c
...
...
@@ -197,7 +197,7 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
};
$scope
.
render
=
function
(
data
)
{
$scope
.
$broadcast
(
'render'
,
data
);
panelHelper
.
broadcastRender
(
$scope
,
data
);
};
$scope
.
changeSeriesColor
=
function
(
series
,
color
)
{
...
...
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