Skip to content

Commit

Permalink
do not use (by default) the registry for custom dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsaou committed Sep 6, 2016
1 parent 1f4e5ad commit 703ae75
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 18 deletions.
11 changes: 9 additions & 2 deletions src/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@
// - [DONE] limit the size of PERSON_URL names
// - limit the number of requests that add data to the registry,
// per client IP per hour


//
// 3. lower memory requirements
//
// - embed avl structures directly into registry objects, instead of DICTIONARY
// - store GUIDs in memory as UUID instead of char *
// (this will also remove the index hash, since UUIDs can be compared directly)
// - do not track persons using the demo machines only
// (i.e. start tracking them only when they access a non-demo machine)
// - [DONE] do not track custom dashboards by default

#define REGISTRY_URL_FLAGS_DEFAULT 0x00
#define REGISTRY_URL_FLAGS_EXPIRED 0x01
Expand Down
2 changes: 1 addition & 1 deletion web/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -655,4 +655,4 @@ <h1>C3 Charts</h1>
<!-- <script> netdataServer = "http://box:19999"; </script> -->

<!-- load the dashboard manager - it will do the rest -->
<script type="text/javascript" src="dashboard.js?v45"></script>
<script type="text/javascript" src="dashboard.js?v46"></script>
27 changes: 18 additions & 9 deletions web/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// var netdataNoBootstrap = true; // do not load bootstrap
// var netdataDontStart = true; // do not start the thread to process the charts
// var netdataErrorCallback = null; // Callback function that will be invoked upon error
// var netdataNoRegistry = true; // Don't update the registry for this access
// var netdataRegistry = true; // Update the registry (default disabled)
// var netdataRegistryCallback = null; // Callback function that will be invoked with one param,
// the URLs from the registry
// var netdataShowHelp = false; // enable/disable help (default enabled)
Expand Down Expand Up @@ -157,12 +157,6 @@
else
NETDATA.themes.current = NETDATA.themes.white;

if(typeof netdataShowHelp === 'undefined')
netdataShowHelp = true;

if(typeof netdataShowAlarms === 'undefined')
netdataShowAlarms = false;

NETDATA.colors = NETDATA.themes.current.colors;

// these are the colors Google Charts are using
Expand All @@ -177,6 +171,22 @@
// (blue) (red) (orange) (green) (pink) (brown) (purple) (yellow) (gray)
//NETDATA.colors = [ '#5DA5DA', '#F15854', '#FAA43A', '#60BD68', '#F17CB0', '#B2912F', '#B276B2', '#DECF3F', '#4D4D4D' ];

if(typeof netdataShowHelp === 'undefined')
netdataShowHelp = true;

if(typeof netdataShowAlarms === 'undefined')
netdataShowAlarms = false;

if(typeof netdataRegistry === 'undefined') {
// backward compatibility
if(typeof netdataNoRegistry !== 'undefined' && netdataNoRegistry === false)
netdataRegistry = true;
else
netdataRegistry = false;
}
if(netdataRegistry === false && typeof netdataRegistryCallback === 'function')
netdataRegistry = true;

// ----------------------------------------------------------------------------------------------------------------
// the defaults for all charts

Expand Down Expand Up @@ -5890,8 +5900,7 @@
},

init: function() {
if(typeof netdataNoRegistry !== 'undefined' && netdataNoRegistry)
return;
if(netdataRegistry !== true) return;

NETDATA.registry.hello(NETDATA.serverDefault, function(data) {
if(data) {
Expand Down
2 changes: 1 addition & 1 deletion web/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />

<script type="text/javascript" src="dashboard.js?v45"></script>
<script type="text/javascript" src="dashboard.js?v46"></script>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion web/demo2.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />

<script>var netdataTheme = 'slate';</script>
<script type="text/javascript" src="http://my-netdata.io/dashboard.js?v45"></script>
<script type="text/javascript" src="http://my-netdata.io/dashboard.js?v46"></script>
</head>
<body>

Expand Down
2 changes: 1 addition & 1 deletion web/demosites.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
and that you have chown it to be owned by netdata:netdata
-->
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
<script type="text/javascript" src="dashboard.js?v45"></script>
<script type="text/javascript" src="dashboard.js?v46"></script>

<script>
// --- OPTIONS FOR THE CHARTS --
Expand Down
5 changes: 4 additions & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@
<script type="text/javascript">
// enable alarms checking and notifications
var netdataShowAlarms = true;

// enable registry updates
var netdataRegistry = true;

// --------------------------------------------------------------------
// urlOptions
Expand Down Expand Up @@ -590,7 +593,7 @@
</script>

<!-- load the dashboard manager - it will do the rest -->
<script type="text/javascript" src="dashboard.js?v45"></script>
<script type="text/javascript" src="dashboard.js?v46"></script>
</head>
<body data-spy="scroll" data-target="#sidebar">
<div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
Expand Down
2 changes: 1 addition & 1 deletion web/registry.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
and that you have chown it to be owned by netdata:netdata
-->
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
<script type="text/javascript" src="dashboard.js?v45"></script>
<script type="text/javascript" src="dashboard.js?v46"></script>

<script>
// Set options for TV operation
Expand Down
2 changes: 1 addition & 1 deletion web/tv.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
and that you have chown it to be owned by netdata:netdata
-->
<!-- <script type="text/javascript" src="http://my.server:19999/dashboard.js"></script> -->
<script type="text/javascript" src="dashboard.js?v45"></script>
<script type="text/javascript" src="dashboard.js?v46"></script>

<script>
// Set options for TV operation
Expand Down

0 comments on commit 703ae75

Please sign in to comment.