do not use (by default) the registry for custom dashboards
Costa Tsaousis (ktsaou) committed
Sep 7, 2016 at 02:37 UTC
703ae75fb617cdbde48c1ed862cfab85f149444e
9 files changed
+37
-18
src/registry.c
+9
-2
@@ -27,8 +27,15 @@
27
// - [DONE] limit the size of PERSON_URL names
28
// - limit the number of requests that add data to the registry,
29
// per client IP per hour
30
-
31
-
30
+//
31
+// 3. lower memory requirements
32
+//
33
+// - embed avl structures directly into registry objects, instead of DICTIONARY
34
+// - store GUIDs in memory as UUID instead of char *
35
+// (this will also remove the index hash, since UUIDs can be compared directly)
36
+// - do not track persons using the demo machines only
37
+// (i.e. start tracking them only when they access a non-demo machine)
38
+// - [DONE] do not track custom dashboards by default
39
40
#define REGISTRY_URL_FLAGS_DEFAULT 0x00
41
#define REGISTRY_URL_FLAGS_EXPIRED 0x01
web/dashboard.html
+1
-1
@@ -655,4 +655,4 @@ So, to avoid flashing the charts, we destroy and re-create the charts on each up
655
<!-- <script> netdataServer = "http://box:19999"; </script> -->
656
657
<!-- load the dashboard manager - it will do the rest -->
658
- <script type="text/javascript" src="dashboard.js?v45"></script>
658
+ <script type="text/javascript" src="dashboard.js?v46"></script>
web/dashboard.js
+18
-9
@@ -12,7 +12,7 @@
12
// var netdataNoBootstrap = true; // do not load bootstrap
13
// var netdataDontStart = true; // do not start the thread to process the charts
14
// var netdataErrorCallback = null; // Callback function that will be invoked upon error
15
-// var netdataNoRegistry = true; // Don't update the registry for this access
15
+// var netdataRegistry = true; // Update the registry (default disabled)
16
// var netdataRegistryCallback = null; // Callback function that will be invoked with one param,
17
// the URLs from the registry
18
// var netdataShowHelp = false; // enable/disable help (default enabled)
@@ -157,12 +157,6 @@
157
else
158
NETDATA.themes.current = NETDATA.themes.white;
159
160
- if(typeof netdataShowHelp === 'undefined')
161
- netdataShowHelp = true;
162
-
163
- if(typeof netdataShowAlarms === 'undefined')
164
- netdataShowAlarms = false;
165
-
160
NETDATA.colors = NETDATA.themes.current.colors;
161
162
// these are the colors Google Charts are using
@@ -177,6 +171,22 @@
171
// (blue) (red) (orange) (green) (pink) (brown) (purple) (yellow) (gray)
172
//NETDATA.colors = [ '#5DA5DA', '#F15854', '#FAA43A', '#60BD68', '#F17CB0', '#B2912F', '#B276B2', '#DECF3F', '#4D4D4D' ];
173
174
+ if(typeof netdataShowHelp === 'undefined')
175
+ netdataShowHelp = true;
176
+
177
+ if(typeof netdataShowAlarms === 'undefined')
178
+ netdataShowAlarms = false;
179
+
180
+ if(typeof netdataRegistry === 'undefined') {
181
+ // backward compatibility
182
+ if(typeof netdataNoRegistry !== 'undefined' && netdataNoRegistry === false)
183
+ netdataRegistry = true;
184
+ else
185
+ netdataRegistry = false;
186
+ }
187
+ if(netdataRegistry === false && typeof netdataRegistryCallback === 'function')
188
+ netdataRegistry = true;
189
+
190
// ----------------------------------------------------------------------------------------------------------------
191
// the defaults for all charts
192
@@ -5890,8 +5900,7 @@
5900
},
5901
5902
init: function() {
5893
- if(typeof netdataNoRegistry !== 'undefined' && netdataNoRegistry)
5894
- return;
5903
+ if(netdataRegistry !== true) return;
5904
5905
NETDATA.registry.hello(NETDATA.serverDefault, function(data) {
5906
if(data) {
web/demo.html
+1
-1
@@ -20,7 +20,7 @@
20
<meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
21
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
22
23
- <script type="text/javascript" src="dashboard.js?v45"></script>
23
+ <script type="text/javascript" src="dashboard.js?v46"></script>
24
</head>
25
<body>
26
web/demo2.html
+1
-1
@@ -21,7 +21,7 @@
21
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
22
23
<script>var netdataTheme = 'slate';</script>
24
- <script type="text/javascript" src="http://my-netdata.io/dashboard.js?v45"></script>
24
+ <script type="text/javascript" src="http://my-netdata.io/dashboard.js?v46"></script>
25
</head>
26
<body>
27
web/demosites.html
+1
-1
@@ -51,7 +51,7 @@
51
and that you have chown it to be owned by netdata:netdata
52
-->
53
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
54
- <script type="text/javascript" src="dashboard.js?v45"></script>
54
+ <script type="text/javascript" src="dashboard.js?v46"></script>
55
56
<script>
57
// --- OPTIONS FOR THE CHARTS --
web/index.html
+4
-1
@@ -394,6 +394,9 @@
394
<script type="text/javascript">
395
// enable alarms checking and notifications
396
var netdataShowAlarms = true;
397
+
398
+ // enable registry updates
399
+ var netdataRegistry = true;
400
401
// --------------------------------------------------------------------
402
// urlOptions
@@ -590,7 +593,7 @@
593
</script>
594
595
<!-- load the dashboard manager - it will do the rest -->
593
- <script type="text/javascript" src="dashboard.js?v45"></script>
596
+ <script type="text/javascript" src="dashboard.js?v46"></script>
597
</head>
598
<body data-spy="scroll" data-target="#sidebar">
599
<div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
web/registry.html
+1
-1
@@ -134,7 +134,7 @@
134
and that you have chown it to be owned by netdata:netdata
135
-->
136
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
137
- <script type="text/javascript" src="dashboard.js?v45"></script>
137
+ <script type="text/javascript" src="dashboard.js?v46"></script>
138
139
<script>
140
// Set options for TV operation
web/tv.html
+1
-1
@@ -49,7 +49,7 @@
49
and that you have chown it to be owned by netdata:netdata
50
-->
51
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
52
- <script type="text/javascript" src="dashboard.js?v45"></script>
52
+ <script type="text/javascript" src="dashboard.js?v46"></script>
53
54
<script>
55
// Set options for TV operation