fixes for TAB to spaces replacement
Costa Tsaousis committed
Aug 14, 2016 at 14:20 UTC
e5e6cb1b39ce0cc3016331ebcbc34dea5a3c3265
11 files changed
+10614
-10604
netdata-installer.sh
+212
-212
@@ -47,50 +47,50 @@ NETDATA_PREFIX=
47
LIBS_ARE_HERE=0
48
49
usage() {
50
- cat <<-USAGE
50
+ cat <<USAGE
51
52
- ${ME} <installer options>
52
+${ME} <installer options>
53
54
- Valid <installer options> are:
54
+Valid <installer options> are:
55
56
- --install /PATH/TO/INSTALL
56
+ --install /PATH/TO/INSTALL
57
58
- If your give: --install /opt
59
- netdata will be installed in /opt/netdata
58
+ If your give: --install /opt
59
+ netdata will be installed in /opt/netdata
60
61
- --dont-start-it
61
+ --dont-start-it
62
63
- Do not (re)start netdata.
64
- Just install it.
63
+ Do not (re)start netdata.
64
+ Just install it.
65
66
- --dont-wait
66
+ --dont-wait
67
68
- Do not wait for the user to press ENTER.
69
- Start immediately building it.
68
+ Do not wait for the user to press ENTER.
69
+ Start immediately building it.
70
71
- --zlib-is-really-here
72
- --libs-are-really-here
71
+ --zlib-is-really-here
72
+ --libs-are-really-here
73
74
- If you get errors about missing zlib,
75
- or libuuid but you know it is available,
76
- you have a broken pkg-config.
77
- Use this option to allow it continue
78
- without checking pkg-config.
74
+ If you get errors about missing zlib,
75
+ or libuuid but you know it is available,
76
+ you have a broken pkg-config.
77
+ Use this option to allow it continue
78
+ without checking pkg-config.
79
80
- Netdata will by default be compiled with gcc optimization -O3
81
- If you need to pass different CFLAGS, use something like this:
80
+Netdata will by default be compiled with gcc optimization -O3
81
+If you need to pass different CFLAGS, use something like this:
82
83
- CFLAGS="<gcc options>" ${ME} <installer options>
83
+ CFLAGS="<gcc options>" ${ME} <installer options>
84
85
- For the installer to complete successfully, you will need
86
- these packages installed:
85
+For the installer to complete successfully, you will need
86
+these packages installed:
87
88
- gcc make autoconf automake pkg-config zlib1g-dev (or zlib-devel)
89
- uuid-dev (or libuuid-devel)
88
+ gcc make autoconf automake pkg-config zlib1g-dev (or zlib-devel)
89
+ uuid-dev (or libuuid-devel)
90
91
- For the plugins, you will at least need:
91
+For the plugins, you will at least need:
92
93
- curl nodejs
93
+ curl nodejs
94
95
USAGE
96
}
@@ -172,26 +172,26 @@ do
172
fi
173
done
174
175
-cat <<-BANNER
175
+cat <<BANNER
176
177
- Welcome to netdata!
178
- Nice to see you are giving it a try!
177
+Welcome to netdata!
178
+Nice to see you are giving it a try!
179
180
- You are about to build and install netdata to your system.
180
+You are about to build and install netdata to your system.
181
182
- It will be installed at these locations:
182
+It will be installed at these locations:
183
184
- - the daemon at ${NETDATA_PREFIX}/usr/sbin/netdata
185
- - config files at ${NETDATA_PREFIX}/etc/netdata
186
- - web files at ${NETDATA_PREFIX}/usr/share/netdata
187
- - plugins at ${NETDATA_PREFIX}/usr/libexec/netdata
188
- - cache files at ${NETDATA_PREFIX}/var/cache/netdata
189
- - db files at ${NETDATA_PREFIX}/var/lib/netdata
190
- - log files at ${NETDATA_PREFIX}/var/log/netdata
191
- - pid file at ${NETDATA_PREFIX}/var/run
184
+ - the daemon at ${NETDATA_PREFIX}/usr/sbin/netdata
185
+ - config files at ${NETDATA_PREFIX}/etc/netdata
186
+ - web files at ${NETDATA_PREFIX}/usr/share/netdata
187
+ - plugins at ${NETDATA_PREFIX}/usr/libexec/netdata
188
+ - cache files at ${NETDATA_PREFIX}/var/cache/netdata
189
+ - db files at ${NETDATA_PREFIX}/var/lib/netdata
190
+ - log files at ${NETDATA_PREFIX}/var/log/netdata
191
+ - pid file at ${NETDATA_PREFIX}/var/run
192
193
- This installer allows you to change the installation path.
194
- Press Control-C and run the same command with --help for help.
193
+This installer allows you to change the installation path.
194
+Press Control-C and run the same command with --help for help.
195
196
BANNER
197
@@ -199,40 +199,40 @@ if [ "${UID}" -ne 0 ]
199
then
200
if [ -z "${NETDATA_PREFIX}" ]
201
then
202
- cat <<-NONROOTNOPREFIX
202
+ cat <<NONROOTNOPREFIX
203
204
- Sorry! This will fail!
204
+Sorry! This will fail!
205
206
- You are attempting to install netdata as non-root, but you plan to install it
207
- in system paths.
206
+You are attempting to install netdata as non-root, but you plan to install it
207
+in system paths.
208
209
- Please set an installation prefix, like this:
209
+Please set an installation prefix, like this:
210
211
- $0 ${@} --install /tmp
211
+ $0 ${@} --install /tmp
212
213
- or, run the installer as root:
213
+or, run the installer as root:
214
215
- sudo $0 ${@}
215
+ sudo $0 ${@}
216
217
- We suggest to install it as root, or certain data collectors will not be able
218
- to work. Netdata drops root privileges when running. So, if you plan to keep
219
- it, install it as root to get the full functionality.
217
+We suggest to install it as root, or certain data collectors will not be able
218
+to work. Netdata drops root privileges when running. So, if you plan to keep
219
+it, install it as root to get the full functionality.
220
221
NONROOTNOPREFIX
222
exit 1
223
224
else
225
- cat <<-NONROOT
225
+ cat <<NONROOT
226
227
- IMPORTANT:
228
- You are about to install netdata as a non-root user.
229
- Netdata will work, but a few data collection modules that
230
- require root access will fail.
227
+IMPORTANT:
228
+You are about to install netdata as a non-root user.
229
+Netdata will work, but a few data collection modules that
230
+require root access will fail.
231
232
- If you installing permanently on your system, run the
233
- installer like this:
232
+If you installing permanently on your system, run the
233
+installer like this:
234
235
- sudo $0 ${@}
235
+ sudo $0 ${@}
236
237
NONROOT
238
fi
@@ -271,23 +271,23 @@ then
271
then
272
echo "Will skip autoreconf step"
273
else
274
- cat <<-"EOF"
274
+ cat <<"EOF"
275
276
- -------------------------------------------------------------------------------
277
- autotools 2.60 or later is required
276
+-------------------------------------------------------------------------------
277
+autotools 2.60 or later is required
278
279
- Sorry, you do not seem to have autotools 2.60 or later, which is
280
- required to build from the git sources of netdata.
279
+Sorry, you do not seem to have autotools 2.60 or later, which is
280
+required to build from the git sources of netdata.
281
282
- You can either install a suitable version of autotools and automake
283
- or download a netdata package which does not have these dependencies.
282
+You can either install a suitable version of autotools and automake
283
+or download a netdata package which does not have these dependencies.
284
285
- Source packages where autotools have already been run are available
286
- here:
287
- https://firehol.org/download/netdata/
285
+Source packages where autotools have already been run are available
286
+here:
287
+ https://firehol.org/download/netdata/
288
289
- The unsigned/master folder tracks the head of the git tree and released
290
- packages are also available.
289
+The unsigned/master folder tracks the head of the git tree and released
290
+packages are also available.
291
EOF
292
exit 1
293
fi
@@ -304,33 +304,33 @@ if [ ${DONOTWAIT} -eq 0 ]
304
fi
305
306
build_error() {
307
- cat <<-EOF
307
+ cat <<EOF
308
309
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
309
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
310
311
- Sorry! NetData failed to build...
311
+Sorry! NetData failed to build...
312
313
- You many need to check these:
313
+You many need to check these:
314
315
- 1. The package uuid-dev (or libuuid-devel) has to be installed.
315
+1. The package uuid-dev (or libuuid-devel) has to be installed.
316
317
- If your system cannot find libuuid, although it is installed
318
- run me with the option: --libs-are-really-here
317
+ If your system cannot find libuuid, although it is installed
318
+ run me with the option: --libs-are-really-here
319
320
- 2. The package zlib1g-dev (or zlib-devel) has to be installed.
320
+2. The package zlib1g-dev (or zlib-devel) has to be installed.
321
322
- If your system cannot find zlib, although it is installed
323
- run me with the option: --libs-are-really-here
322
+ If your system cannot find zlib, although it is installed
323
+ run me with the option: --libs-are-really-here
324
325
- 3. You need basic build tools installed, like:
325
+3. You need basic build tools installed, like:
326
327
- gcc make autoconf automake pkg-config
327
+ gcc make autoconf automake pkg-config
328
329
- Autoconf version 2.60 or higher is required.
329
+ Autoconf version 2.60 or higher is required.
330
331
- If you still cannot get it to build, ask for help at github:
331
+If you still cannot get it to build, ask for help at github:
332
333
- https://github.com/firehol/netdata/issues
333
+ https://github.com/firehol/netdata/issues
334
335
336
EOF
@@ -849,36 +849,36 @@ fi
849
# Check for KSM
850
851
ksm_is_available_but_disabled() {
852
- cat <<-KSM1
852
+ cat <<KSM1
853
854
- -------------------------------------------------------------------------------
855
- Memory de-duplication instructions
854
+-------------------------------------------------------------------------------
855
+Memory de-duplication instructions
856
857
- You have kernel memory de-duper (called Kernel Same-page Merging,
858
- or KSM) available, but it is not currently enabled.
857
+You have kernel memory de-duper (called Kernel Same-page Merging,
858
+or KSM) available, but it is not currently enabled.
859
860
- To enable it run:
860
+To enable it run:
861
862
- echo 1 >/sys/kernel/mm/ksm/run
863
- echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
862
+echo 1 >/sys/kernel/mm/ksm/run
863
+echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
864
865
- If you enable it, you will save 40-60% of netdata memory.
865
+If you enable it, you will save 40-60% of netdata memory.
866
867
KSM1
868
}
869
870
ksm_is_not_available() {
871
- cat <<-KSM2
871
+ cat <<KSM2
872
873
- -------------------------------------------------------------------------------
874
- Memory de-duplication not present in your kernel
873
+-------------------------------------------------------------------------------
874
+Memory de-duplication not present in your kernel
875
876
- It seems you do not have kernel memory de-duper (called Kernel Same-page
877
- Merging, or KSM) available.
876
+It seems you do not have kernel memory de-duper (called Kernel Same-page
877
+Merging, or KSM) available.
878
879
- To enable it, you need a kernel built with CONFIG_KSM=y
879
+To enable it, you need a kernel built with CONFIG_KSM=y
880
881
- If you can have it, you will save 40-60% of netdata memory.
881
+If you can have it, you will save 40-60% of netdata memory.
882
883
KSM2
884
}
@@ -898,18 +898,18 @@ fi
898
899
if [ ! -s web/version.txt ]
900
then
901
- cat <<-VERMSG
901
+ cat <<VERMSG
902
903
- -------------------------------------------------------------------------------
904
- Version update check warning
903
+-------------------------------------------------------------------------------
904
+Version update check warning
905
906
- The way you downloaded netdata, we cannot find its version. This means the
907
- Update check on the dashboard, will not work.
906
+The way you downloaded netdata, we cannot find its version. This means the
907
+Update check on the dashboard, will not work.
908
909
- If you want to have version update check, please re-install it
910
- following the procedure in:
909
+If you want to have version update check, please re-install it
910
+following the procedure in:
911
912
- https://github.com/firehol/netdata/wiki/Installation
912
+https://github.com/firehol/netdata/wiki/Installation
913
914
VERMSG
915
fi
@@ -919,29 +919,29 @@ fi
919
920
if [ "${UID}" -ne 0 ]
921
then
922
- cat <<-SETUID_WARNING
922
+ cat <<SETUID_WARNING
923
924
- -------------------------------------------------------------------------------
925
- apps.plugin needs privileges
924
+-------------------------------------------------------------------------------
925
+apps.plugin needs privileges
926
927
- Since you have installed netdata as a normal user, to have apps.plugin collect
928
- all the needed data, you have to give it the access rights it needs, by running
929
- either of the following sets of commands:
927
+Since you have installed netdata as a normal user, to have apps.plugin collect
928
+all the needed data, you have to give it the access rights it needs, by running
929
+either of the following sets of commands:
930
931
- To run apps.plugin with escalated capabilities:
931
+To run apps.plugin with escalated capabilities:
932
933
- sudo chown root:${NETDATA_USER} "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
934
- sudo chmod 0750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
935
- sudo setcap cap_dac_read_search,cap_sys_ptrace+ep "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
933
+ sudo chown root:${NETDATA_USER} "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
934
+ sudo chmod 0750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
935
+ sudo setcap cap_dac_read_search,cap_sys_ptrace+ep "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
936
937
- or, to run apps.plugin as root:
937
+or, to run apps.plugin as root:
938
939
- sudo chown root "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
940
- sudo chmod 4755 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
939
+ sudo chown root "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
940
+ sudo chmod 4755 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/apps.plugin"
941
942
- apps.plugin is performing a hard-coded function of data collection for all
943
- running processes. It cannot be instructed from the netdata daemon to perform
944
- any task, so it is pretty safe to do this.
942
+apps.plugin is performing a hard-coded function of data collection for all
943
+running processes. It cannot be instructed from the netdata daemon to perform
944
+any task, so it is pretty safe to do this.
945
946
SETUID_WARNING
947
fi
@@ -949,122 +949,122 @@ fi
949
# -----------------------------------------------------------------------------
950
# Keep un-install info
951
952
-cat >netdata-uninstaller.sh <<-UNINSTALL
953
- #!/bin/bash
952
+cat >netdata-uninstaller.sh <<UNINSTALL
953
+#!/usr/bin/env bash
954
955
- # this script will uninstall netdata
955
+# this script will uninstall netdata
956
957
- if [ "\$1" != "--force" ]
958
- then
959
- echo >&2 "This script will REMOVE netdata from your system."
960
- echo >&2 "Run it again with --force to do it."
961
- exit 1
962
- fi
963
-
964
- echo >&2 "Stopping a possibly running netdata..."
965
- for p in \$(pidof netdata); do kill \$p; done
966
- sleep 2
957
+if [ "\$1" != "--force" ]
958
+ then
959
+ echo >&2 "This script will REMOVE netdata from your system."
960
+ echo >&2 "Run it again with --force to do it."
961
+ exit 1
962
+fi
963
968
- deletedir() {
969
- if [ ! -z "\$1" -a -d "\$1" ]
970
- then
971
- echo
972
- echo "Deleting directory '\$1' ..."
973
- rm -I -R "\$1"
974
- fi
975
- }
964
+echo >&2 "Stopping a possibly running netdata..."
965
+for p in \$(pidof netdata); do kill \$p; done
966
+sleep 2
967
977
- if [ ! -z "${NETDATA_PREFIX}" -a -d "${NETDATA_PREFIX}" ]
968
+deletedir() {
969
+ if [ ! -z "\$1" -a -d "\$1" ]
970
then
979
- # installation prefix was given
980
-
981
- deletedir "${NETDATA_PREFIX}"
971
+ echo
972
+ echo "Deleting directory '\$1' ..."
973
+ rm -I -R "\$1"
974
+ fi
975
+}
976
983
- else
984
- # installation prefix was NOT given
977
+if [ ! -z "${NETDATA_PREFIX}" -a -d "${NETDATA_PREFIX}" ]
978
+ then
979
+ # installation prefix was given
980
986
- if [ -f "${NETDATA_PREFIX}/usr/sbin/netdata" ]
987
- then
988
- echo "Deleting ${NETDATA_PREFIX}/usr/sbin/netdata ..."
989
- rm -i "${NETDATA_PREFIX}/usr/sbin/netdata"
990
- fi
981
+ deletedir "${NETDATA_PREFIX}"
982
992
- deletedir "${NETDATA_PREFIX}/etc/netdata"
993
- deletedir "${NETDATA_PREFIX}/usr/share/netdata"
994
- deletedir "${NETDATA_PREFIX}/usr/libexec/netdata"
995
- deletedir "${NETDATA_PREFIX}/var/lib/netdata"
996
- deletedir "${NETDATA_PREFIX}/var/cache/netdata"
997
- deletedir "${NETDATA_PREFIX}/var/log/netdata"
998
- fi
983
+else
984
+ # installation prefix was NOT given
985
1000
- if [ -f /etc/logrotate.d/netdata ]
986
+ if [ -f "${NETDATA_PREFIX}/usr/sbin/netdata" ]
987
then
1002
- echo "Deleting /etc/logrotate.d/netdata ..."
1003
- rm -i /etc/logrotate.d/netdata
988
+ echo "Deleting ${NETDATA_PREFIX}/usr/sbin/netdata ..."
989
+ rm -i "${NETDATA_PREFIX}/usr/sbin/netdata"
990
fi
991
1006
- if [ -f /etc/systemd/system/netdata.service ]
1007
- then
1008
- echo "Deleting /etc/systemd/system/netdata.service ..."
1009
- rm -i /etc/systemd/system/netdata.service
1010
- fi
992
+ deletedir "${NETDATA_PREFIX}/etc/netdata"
993
+ deletedir "${NETDATA_PREFIX}/usr/share/netdata"
994
+ deletedir "${NETDATA_PREFIX}/usr/libexec/netdata"
995
+ deletedir "${NETDATA_PREFIX}/var/lib/netdata"
996
+ deletedir "${NETDATA_PREFIX}/var/cache/netdata"
997
+ deletedir "${NETDATA_PREFIX}/var/log/netdata"
998
+fi
999
1012
- getent passwd netdata > /dev/null
1013
- if [ $? -eq 0 ]
1014
- then
1015
- echo
1016
- echo "You may also want to remove the user netdata"
1017
- echo "by running:"
1018
- echo " userdel netdata"
1019
- fi
1000
+if [ -f /etc/logrotate.d/netdata ]
1001
+ then
1002
+ echo "Deleting /etc/logrotate.d/netdata ..."
1003
+ rm -i /etc/logrotate.d/netdata
1004
+fi
1005
1021
- getent group netdata > /dev/null
1022
- if [ $? -eq 0 ]
1023
- then
1024
- echo
1025
- echo "You may also want to remove the group netdata"
1026
- echo "by running:"
1027
- echo " groupdel netdata"
1028
- fi
1006
+if [ -f /etc/systemd/system/netdata.service ]
1007
+ then
1008
+ echo "Deleting /etc/systemd/system/netdata.service ..."
1009
+ rm -i /etc/systemd/system/netdata.service
1010
+fi
1011
1030
- getent group docker > /dev/null
1031
- if [ $? -eq 0 -a "${NETDATA_ADDED_TO_DOCKER}" = "1" ]
1032
- then
1033
- echo
1034
- echo "You may also want to remove the netdata user from the docker group"
1035
- echo "by running:"
1036
- echo " gpasswd -d netdata docker"
1037
- fi
1012
+getent passwd netdata > /dev/null
1013
+if [ $? -eq 0 ]
1014
+ then
1015
+ echo
1016
+ echo "You may also want to remove the user netdata"
1017
+ echo "by running:"
1018
+ echo " userdel netdata"
1019
+fi
1020
+
1021
+getent group netdata > /dev/null
1022
+if [ $? -eq 0 ]
1023
+ then
1024
+ echo
1025
+ echo "You may also want to remove the group netdata"
1026
+ echo "by running:"
1027
+ echo " groupdel netdata"
1028
+fi
1029
+
1030
+getent group docker > /dev/null
1031
+if [ $? -eq 0 -a "${NETDATA_ADDED_TO_DOCKER}" = "1" ]
1032
+ then
1033
+ echo
1034
+ echo "You may also want to remove the netdata user from the docker group"
1035
+ echo "by running:"
1036
+ echo " gpasswd -d netdata docker"
1037
+fi
1038
1039
UNINSTALL
1040
chmod 750 netdata-uninstaller.sh
1041
1042
# -----------------------------------------------------------------------------
1043
1044
-cat <<-END
1044
+cat <<END
1045
1046
1047
- -------------------------------------------------------------------------------
1047
+-------------------------------------------------------------------------------
1048
1049
- OK. NetData is installed and it is running.
1049
+OK. NetData is installed and it is running.
1050
1051
- -------------------------------------------------------------------------------
1051
+-------------------------------------------------------------------------------
1052
1053
- By default netdata listens on all IPs on port ${NETDATA_PORT},
1054
- so you can access it with:
1053
+By default netdata listens on all IPs on port ${NETDATA_PORT},
1054
+so you can access it with:
1055
1056
- http://this.machine.ip:${NETDATA_PORT}/
1056
+http://this.machine.ip:${NETDATA_PORT}/
1057
1058
- To stop netdata, just kill it, with:
1058
+To stop netdata, just kill it, with:
1059
1060
- killall netdata
1060
+ killall netdata
1061
1062
- To start it, just run it:
1062
+To start it, just run it:
1063
1064
- ${NETDATA_PREFIX}/usr/sbin/netdata
1064
+ ${NETDATA_PREFIX}/usr/sbin/netdata
1065
1066
1067
- Enjoy!
1067
+Enjoy!
1068
1069
END
1070
echo >&2 "Uninstall script generated: ./netdata-uninstaller.sh"
src/global_statistics.c
+3
-3
@@ -163,7 +163,7 @@ void global_statistics_charts(void) {
163
if (!stclients) stclients = rrdset_find("netdata.clients");
164
if (!stclients) {
165
stclients = rrdset_create("netdata", "clients", NULL, "netdata", NULL, "NetData Web Clients",
166
- "connected clients", 130100, rrd_update_every, RRDSET_TYPE_LINE);
166
+ "connected clients", 130200, rrd_update_every, RRDSET_TYPE_LINE);
167
168
rrddim_add(stclients, "clients", NULL, 1, 1, RRDDIM_ABSOLUTE);
169
} else rrdset_next(stclients);
@@ -176,7 +176,7 @@ void global_statistics_charts(void) {
176
if (!streqs) streqs = rrdset_find("netdata.requests");
177
if (!streqs) {
178
streqs = rrdset_create("netdata", "requests", NULL, "netdata", NULL, "NetData Web Requests", "requests/s",
179
- 130200, rrd_update_every, RRDSET_TYPE_LINE);
179
+ 130300, rrd_update_every, RRDSET_TYPE_LINE);
180
181
rrddim_add(streqs, "requests", NULL, 1, 1, RRDDIM_INCREMENTAL);
182
} else rrdset_next(streqs);
@@ -189,7 +189,7 @@ void global_statistics_charts(void) {
189
if (!stbytes) stbytes = rrdset_find("netdata.net");
190
if (!stbytes) {
191
stbytes = rrdset_create("netdata", "net", NULL, "netdata", NULL, "NetData Network Traffic", "kilobits/s",
192
- 130300, rrd_update_every, RRDSET_TYPE_AREA);
192
+ 130000, rrd_update_every, RRDSET_TYPE_AREA);
193
194
rrddim_add(stbytes, "in", NULL, 8, 1024, RRDDIM_INCREMENTAL);
195
rrddim_add(stbytes, "out", NULL, -8, 1024, RRDDIM_INCREMENTAL);
src/health.c
+3
@@ -1042,6 +1042,7 @@ int health_readfile(const char *path, const char *filename) {
1042
rt = NULL;
1043
}
1044
1045
+ // FIXME: make sure the value does not any operators or spaces
1046
rc = callocz(1, sizeof(RRDCALC));
1047
rc->name = strdupz(value);
1048
rc->hash = simple_hash(rc->name);
@@ -1057,6 +1058,7 @@ int health_readfile(const char *path, const char *filename) {
1058
if(rt && !rrdcalctemplate_add(&localhost, rt))
1059
rrdcalctemplate_free(&localhost, rt);
1060
1061
+ // FIXME: make sure the value does not any operators or spaces
1062
rt = callocz(1, sizeof(RRDCALCTEMPLATE));
1063
rt->name = strdupz(value);
1064
rt->hash_name = simple_hash(rt->name);
@@ -1278,6 +1280,7 @@ void health_readdir(const char *path) {
1280
void health_init(void) {
1281
char *path;
1282
1283
+ // FIXME: allow the user to enable/disable health monitoring
1284
{
1285
char buffer[FILENAME_MAX + 1];
1286
snprintfz(buffer, FILENAME_MAX, "%s/health.d", config_get("global", "config directory", CONFIG_DIR));
web/dashboard.html
+503
-503
@@ -1,24 +1,24 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>NetData Dashboard</title>
5
- <meta name="application-name" content="netdata">
6
-
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
- <meta name="author" content="costa@tsaousis.gr">
14
-
15
- <meta property="og:locale" content="en_US" />
16
- <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
17
- <meta property="og:url" content="http://my-netdata.io/"/>
18
- <meta property="og:type" content="website"/>
19
- <meta property="og:site_name" content="netdata"/>
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." />
4
+ <title>NetData Dashboard</title>
5
+ <meta name="application-name" content="netdata">
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
+ <meta name="author" content="costa@tsaousis.gr">
14
+
15
+ <meta property="og:locale" content="en_US" />
16
+ <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
17
+ <meta property="og:url" content="http://my-netdata.io/"/>
18
+ <meta property="og:type" content="website"/>
19
+ <meta property="og:site_name" content="netdata"/>
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
</head>
23
<body>
24
@@ -32,33 +32,33 @@ This is a template for building custom dashboards. To build a dashboard you just
32
<!DOCTYPE html>
33
<html lang="en">
34
<head>
35
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
36
- <meta charset="utf-8">
37
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
38
- <meta name="viewport" content="width=device-width, initial-scale=1">
39
- <meta name="apple-mobile-web-app-capable" content="yes">
40
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
35
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
36
+ <meta charset="utf-8">
37
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
38
+ <meta name="viewport" content="width=device-width, initial-scale=1">
39
+ <meta name="apple-mobile-web-app-capable" content="yes">
40
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
41
</head>
42
<body>
43
- <div data-netdata="system.processes"
44
- data-chart-library="dygraph"
45
- data-width="600"
46
- data-height="200"
47
- data-after="-600"
48
- ></div>
43
+ <div data-netdata="system.processes"
44
+ data-chart-library="dygraph"
45
+ data-width="600"
46
+ data-height="200"
47
+ data-after="-600"
48
+ ></div>
49
</body>
50
<script type="text/javascript" src="http://netdata.server:19999/dashboard.js"></script>
51
</html>
52
</pre>
53
54
<ul>
55
- <li>You can host your dashboard anywhere.</li>
56
- <li>You can add as many charts as you like.</li>
57
- <li>You can have charts from many different netdata servers (add <pre>data-host="http://another.netdata.server:19999/"</pre> to each chart).</li>
58
- <li>You can use different chart libraries on the same page: <b>peity</b>, <b>sparkline</b>, <b>dygraph</b>, <b>google</b>, <b>morris</b></li>
59
- <li>You can customize each chart to your preferences. For each chart library most of their attributes can be given in <b>data-</b> attributes.</li>
60
- <li>Each chart can have each own duration - it is controlled with the <b>data-after</b> attribute to give that many seconds of data.</li>
61
- <li>Depending on the width of the chart and <b>data-after</b> attribute, netdata will automatically refresh the chart when it needs to be updated. For example giving 600 pixels for width for -600 seconds of data, using a chart library that needs 3 pixels per point, will yeld in a chart updated once every 3 seconds.</li>
55
+ <li>You can host your dashboard anywhere.</li>
56
+ <li>You can add as many charts as you like.</li>
57
+ <li>You can have charts from many different netdata servers (add <pre>data-host="http://another.netdata.server:19999/"</pre> to each chart).</li>
58
+ <li>You can use different chart libraries on the same page: <b>peity</b>, <b>sparkline</b>, <b>dygraph</b>, <b>google</b>, <b>morris</b></li>
59
+ <li>You can customize each chart to your preferences. For each chart library most of their attributes can be given in <b>data-</b> attributes.</li>
60
+ <li>Each chart can have each own duration - it is controlled with the <b>data-after</b> attribute to give that many seconds of data.</li>
61
+ <li>Depending on the width of the chart and <b>data-after</b> attribute, netdata will automatically refresh the chart when it needs to be updated. For example giving 600 pixels for width for -600 seconds of data, using a chart library that needs 3 pixels per point, will yeld in a chart updated once every 3 seconds.</li>
62
</ul>
63
64
@@ -69,61 +69,61 @@ Sparkline charts stretch the values to show the variations between values in mor
69
They also have mouse-hover support.
70
<br/>
71
<b>Sparklines are fantastic</b>. You can inline charts in text. For example this
72
- <div data-netdata="system.cpu"
73
- data-chart-library="sparkline"
74
- data-width="5%"
75
- data-height="20"
76
- data-after="-30"
77
- ></div> is my current cpu usage (last 30 seconds),
78
- while this
79
- <div data-netdata="netdata.net"
80
- data-dimensions="out"
81
- data-chart-library="sparkline"
82
- data-width="10%"
83
- data-height="20"
84
- data-after="-60"
85
- ></div> is the bandwidth my netdata server is currently transmitting (last minute)
86
- and this
87
- <div data-netdata="netdata.requests"
88
- data-chart-library="sparkline"
89
- data-width="20%"
90
- data-height="20"
91
- data-after="-180"
92
- ></div> is the requests/sec it serves (last 3 minutes).
72
+ <div data-netdata="system.cpu"
73
+ data-chart-library="sparkline"
74
+ data-width="5%"
75
+ data-height="20"
76
+ data-after="-30"
77
+ ></div> is my current cpu usage (last 30 seconds),
78
+ while this
79
+ <div data-netdata="netdata.net"
80
+ data-dimensions="out"
81
+ data-chart-library="sparkline"
82
+ data-width="10%"
83
+ data-height="20"
84
+ data-after="-60"
85
+ ></div> is the bandwidth my netdata server is currently transmitting (last minute)
86
+ and this
87
+ <div data-netdata="netdata.requests"
88
+ data-chart-library="sparkline"
89
+ data-width="20%"
90
+ data-height="20"
91
+ data-after="-180"
92
+ ></div> is the requests/sec it serves (last 3 minutes).
93
94
<br/>
95
<div style="width: 33%; display: inline-block;">
96
- <div data-netdata="system.processes"
97
- data-chart-library="sparkline"
98
- data-width="100%"
99
- data-height="30"
100
- data-after="-300"
101
- data-dt-element-name="time101"
102
- ></div>
103
- <br/>
104
- <small>rendered in <span id="time101">X</span> ms</small>
96
+ <div data-netdata="system.processes"
97
+ data-chart-library="sparkline"
98
+ data-width="100%"
99
+ data-height="30"
100
+ data-after="-300"
101
+ data-dt-element-name="time101"
102
+ ></div>
103
+ <br/>
104
+ <small>rendered in <span id="time101">X</span> ms</small>
105
</div>
106
<div style="width: 33%; display: inline-block;">
107
- <div data-netdata="system.ipv4"
108
- data-chart-library="sparkline"
109
- data-width="100%"
110
- data-height="30"
111
- data-after="-300"
112
- data-dt-element-name="time102"
113
- ></div>
114
- <br/>
115
- <small>rendered in <span id="time102">X</span> ms</small>
107
+ <div data-netdata="system.ipv4"
108
+ data-chart-library="sparkline"
109
+ data-width="100%"
110
+ data-height="30"
111
+ data-after="-300"
112
+ data-dt-element-name="time102"
113
+ ></div>
114
+ <br/>
115
+ <small>rendered in <span id="time102">X</span> ms</small>
116
</div>
117
<div style="width: 33%; display: inline-block;">
118
- <div data-netdata="system.cpu"
119
- data-chart-library="sparkline"
120
- data-width="100%"
121
- data-height="30"
122
- data-after="-300"
123
- data-dt-element-name="time103"
124
- ></div>
125
- <br/>
126
- <small>rendered in <span id="time103">X</span> ms</small>
118
+ <div data-netdata="system.cpu"
119
+ data-chart-library="sparkline"
120
+ data-width="100%"
121
+ data-height="30"
122
+ data-after="-300"
123
+ data-dt-element-name="time103"
124
+ ></div>
125
+ <br/>
126
+ <small>rendered in <span id="time103">X</span> ms</small>
127
</div>
128
129
@@ -135,37 +135,37 @@ Peity charts cannot have multiple dimensions on the charts - so netdata will use
135
the total of all dimensions.
136
<br/>
137
<div style="width: 33%; display: inline-block;">
138
- <div data-netdata="system.processes"
139
- data-chart-library="peity"
140
- data-width="100%"
141
- data-height="30"
142
- data-after="-300"
143
- data-dt-element-name="time001"
144
- ></div>
145
- <br/>
146
- <small>rendered in <span id="time001">X</span> ms</small>
138
+ <div data-netdata="system.processes"
139
+ data-chart-library="peity"
140
+ data-width="100%"
141
+ data-height="30"
142
+ data-after="-300"
143
+ data-dt-element-name="time001"
144
+ ></div>
145
+ <br/>
146
+ <small>rendered in <span id="time001">X</span> ms</small>
147
</div>
148
<div style="width: 33%; display: inline-block;">
149
- <div data-netdata="system.ipv4"
150
- data-chart-library="peity"
151
- data-width="100%"
152
- data-height="30"
153
- data-after="-300"
154
- data-dt-element-name="time002"
155
- ></div>
156
- <br/>
157
- <small>rendered in <span id="time002">X</span> ms</small>
149
+ <div data-netdata="system.ipv4"
150
+ data-chart-library="peity"
151
+ data-width="100%"
152
+ data-height="30"
153
+ data-after="-300"
154
+ data-dt-element-name="time002"
155
+ ></div>
156
+ <br/>
157
+ <small>rendered in <span id="time002">X</span> ms</small>
158
</div>
159
<div style="width: 33%; display: inline-block;">
160
- <div data-netdata="system.cpu"
161
- data-chart-library="peity"
162
- data-width="100%"
163
- data-height="30"
164
- data-after="-300"
165
- data-dt-element-name="time003"
166
- ></div>
167
- <br/>
168
- <small>rendered in <span id="time003">X</span> ms</small>
160
+ <div data-netdata="system.cpu"
161
+ data-chart-library="peity"
162
+ data-width="100%"
163
+ data-height="30"
164
+ data-after="-300"
165
+ data-dt-element-name="time003"
166
+ ></div>
167
+ <br/>
168
+ <small>rendered in <span id="time003">X</span> ms</small>
169
</div>
170
171
@@ -178,173 +178,173 @@ The charts are zoomable (drag their contents to pan, shift with mouse wheel to z
178
<b>Netdata magic!</b> Realtime charts on your web page!
179
<br/>
180
Sparklines using dygraphs
181
- <div data-netdata="system.processes"
182
- data-chart-library="dygraph"
183
- data-dygraph-theme="sparkline"
184
- data-legend="no"
185
- data-width="15%"
186
- data-height="20"
187
- data-after="-300"
188
- ></div>
189
- are also possible! This
190
- <div data-netdata="system.ipv4"
191
- data-chart-library="dygraph"
192
- data-dygraph-theme="sparkline"
193
- data-legend="no"
194
- data-width="15%"
195
- data-height="20"
196
- data-after="-300"
197
- ></div>
198
- is an area chart, while this
199
- <div data-netdata="system.cpu"
200
- data-chart-library="dygraph"
201
- data-dygraph-theme="sparkline"
202
- data-legend="no"
203
- data-width="15%"
204
- data-height="20"
205
- data-after="-300"
206
- ></div> is a stacked area chart!
181
+ <div data-netdata="system.processes"
182
+ data-chart-library="dygraph"
183
+ data-dygraph-theme="sparkline"
184
+ data-legend="no"
185
+ data-width="15%"
186
+ data-height="20"
187
+ data-after="-300"
188
+ ></div>
189
+ are also possible! This
190
+ <div data-netdata="system.ipv4"
191
+ data-chart-library="dygraph"
192
+ data-dygraph-theme="sparkline"
193
+ data-legend="no"
194
+ data-width="15%"
195
+ data-height="20"
196
+ data-after="-300"
197
+ ></div>
198
+ is an area chart, while this
199
+ <div data-netdata="system.cpu"
200
+ data-chart-library="dygraph"
201
+ data-dygraph-theme="sparkline"
202
+ data-legend="no"
203
+ data-width="15%"
204
+ data-height="20"
205
+ data-after="-300"
206
+ ></div> is a stacked area chart!
207
208
209
<br/>
210
<div style="width: 33%; display: inline-block;">
211
- <div data-netdata="system.processes"
212
- data-chart-library="dygraph"
213
- data-dygraph-theme="sparkline"
214
- data-width="100%"
215
- data-height="30"
216
- data-after="-300"
217
- data-dt-element-name="time501"
218
- ></div>
219
- <br/>
220
- <small>rendered in <span id="time501">X</span> ms</small>
211
+ <div data-netdata="system.processes"
212
+ data-chart-library="dygraph"
213
+ data-dygraph-theme="sparkline"
214
+ data-width="100%"
215
+ data-height="30"
216
+ data-after="-300"
217
+ data-dt-element-name="time501"
218
+ ></div>
219
+ <br/>
220
+ <small>rendered in <span id="time501">X</span> ms</small>
221
</div>
222
<div style="width: 33%; display: inline-block;">
223
- <div data-netdata="system.ipv4"
224
- data-chart-library="dygraph"
225
- data-dygraph-theme="sparkline"
226
- data-width="100%"
227
- data-height="30"
228
- data-after="-300"
229
- data-dt-element-name="time502"
230
- ></div>
231
- <br/>
232
- <small>rendered in <span id="time502">X</span> ms</small>
223
+ <div data-netdata="system.ipv4"
224
+ data-chart-library="dygraph"
225
+ data-dygraph-theme="sparkline"
226
+ data-width="100%"
227
+ data-height="30"
228
+ data-after="-300"
229
+ data-dt-element-name="time502"
230
+ ></div>
231
+ <br/>
232
+ <small>rendered in <span id="time502">X</span> ms</small>
233
</div>
234
<div style="width: 33%; display: inline-block;">
235
- <div data-netdata="system.cpu"
236
- data-chart-library="dygraph"
237
- data-dygraph-theme="sparkline"
238
- data-width="100%"
239
- data-height="30"
240
- data-after="-300"
241
- data-dt-element-name="time503"
242
- ></div>
243
- <br/>
244
- <small>rendered in <span id="time503">X</span> ms</small>
235
+ <div data-netdata="system.cpu"
236
+ data-chart-library="dygraph"
237
+ data-dygraph-theme="sparkline"
238
+ data-width="100%"
239
+ data-height="30"
240
+ data-after="-300"
241
+ data-dt-element-name="time503"
242
+ ></div>
243
+ <br/>
244
+ <small>rendered in <span id="time503">X</span> ms</small>
245
</div>
246
247
248
249
<br/>
250
<div style="width: 33%; display: inline-block;">
251
- <div data-netdata="system.processes"
252
- data-chart-library="dygraph"
253
- data-width="100%"
254
- data-height="200"
255
- data-after="-300"
256
- data-dt-element-name="time201"
257
- ></div>
258
- <br/>
259
- <small>rendered in <span id="time201">X</span> ms</small>
260
-</div>
261
-<div style="width: 33%; display: inline-block;">
262
- <div data-netdata="system.ipv4"
263
- data-chart-library="dygraph"
264
- data-width="100%"
265
- data-height="200"
266
- data-after="-300"
267
- data-dt-element-name="time202"
268
- ></div>
269
- <br/>
270
- <small>rendered in <span id="time202">X</span> ms</small>
271
-</div>
272
-<div style="width: 33%; display: inline-block;">
273
- <div data-netdata="system.cpu"
274
- data-chart-library="dygraph"
275
- data-width="100%"
276
- data-height="200"
277
- data-after="-300"
278
- data-dt-element-name="time203"
279
- ></div>
280
- <br/>
281
- <small>rendered in <span id="time203">X</span> ms</small>
282
-</div>
283
-<div style="width: 33%; display: inline-block;">
284
- <div data-netdata="system.io"
285
- data-chart-library="dygraph"
286
- data-width="100%"
287
- data-height="200"
288
- data-after="-300"
289
- data-dt-element-name="time204"
290
- ></div>
291
- <br/>
292
- <small>rendered in <span id="time204">X</span> ms</small>
293
-</div>
294
-<div style="width: 33%; display: inline-block;">
295
- <div data-netdata="apps.cpu"
296
- data-chart-library="dygraph"
297
- data-width="100%"
298
- data-height="200"
299
- data-after="-300"
300
- data-dt-element-name="time205"
301
- ></div>
302
- <br/>
303
- <small>rendered in <span id="time205">X</span> ms</small>
304
-</div>
305
-<div style="width: 33%; display: inline-block;">
306
- <div data-netdata="netdata.net"
307
- data-chart-library="dygraph"
308
- data-width="100%"
309
- data-height="200"
310
- data-after="-300"
311
- data-dt-element-name="time206"
312
- ></div>
313
- <br/>
314
- <small>rendered in <span id="time206">X</span> ms</small>
315
-</div>
316
-<div style="width: 33%; display: inline-block;">
317
- <div data-netdata="netdata.server_cpu"
318
- data-chart-library="dygraph"
319
- data-width="100%"
320
- data-height="200"
321
- data-after="-300"
322
- data-dt-element-name="time207"
323
- ></div>
324
- <br/>
325
- <small>rendered in <span id="time207">X</span> ms</small>
326
-</div>
327
-<div style="width: 33%; display: inline-block;">
328
- <div data-netdata="netdata.requests"
329
- data-chart-library="dygraph"
330
- data-width="100%"
331
- data-height="200"
332
- data-after="-300"
333
- data-dt-element-name="time208"
334
- ></div>
335
- <br/>
336
- <small>rendered in <span id="time208">X</span> ms</small>
337
-</div>
338
-<div style="width: 33%; display: inline-block;">
339
- <div data-netdata="net.gstag0"
340
- data-chart-library="dygraph"
341
- data-width="100%"
342
- data-height="200"
343
- data-after="-300"
344
- data-dt-element-name="time209"
345
- ></div>
346
- <br/>
347
- <small>rendered in <span id="time209">X</span> ms</small>
251
+ <div data-netdata="system.processes"
252
+ data-chart-library="dygraph"
253
+ data-width="100%"
254
+ data-height="200"
255
+ data-after="-300"
256
+ data-dt-element-name="time201"
257
+ ></div>
258
+ <br/>
259
+ <small>rendered in <span id="time201">X</span> ms</small>
260
+</div>
261
+<div style="width: 33%; display: inline-block;">
262
+ <div data-netdata="system.ipv4"
263
+ data-chart-library="dygraph"
264
+ data-width="100%"
265
+ data-height="200"
266
+ data-after="-300"
267
+ data-dt-element-name="time202"
268
+ ></div>
269
+ <br/>
270
+ <small>rendered in <span id="time202">X</span> ms</small>
271
+</div>
272
+<div style="width: 33%; display: inline-block;">
273
+ <div data-netdata="system.cpu"
274
+ data-chart-library="dygraph"
275
+ data-width="100%"
276
+ data-height="200"
277
+ data-after="-300"
278
+ data-dt-element-name="time203"
279
+ ></div>
280
+ <br/>
281
+ <small>rendered in <span id="time203">X</span> ms</small>
282
+</div>
283
+<div style="width: 33%; display: inline-block;">
284
+ <div data-netdata="system.io"
285
+ data-chart-library="dygraph"
286
+ data-width="100%"
287
+ data-height="200"
288
+ data-after="-300"
289
+ data-dt-element-name="time204"
290
+ ></div>
291
+ <br/>
292
+ <small>rendered in <span id="time204">X</span> ms</small>
293
+</div>
294
+<div style="width: 33%; display: inline-block;">
295
+ <div data-netdata="apps.cpu"
296
+ data-chart-library="dygraph"
297
+ data-width="100%"
298
+ data-height="200"
299
+ data-after="-300"
300
+ data-dt-element-name="time205"
301
+ ></div>
302
+ <br/>
303
+ <small>rendered in <span id="time205">X</span> ms</small>
304
+</div>
305
+<div style="width: 33%; display: inline-block;">
306
+ <div data-netdata="netdata.net"
307
+ data-chart-library="dygraph"
308
+ data-width="100%"
309
+ data-height="200"
310
+ data-after="-300"
311
+ data-dt-element-name="time206"
312
+ ></div>
313
+ <br/>
314
+ <small>rendered in <span id="time206">X</span> ms</small>
315
+</div>
316
+<div style="width: 33%; display: inline-block;">
317
+ <div data-netdata="netdata.server_cpu"
318
+ data-chart-library="dygraph"
319
+ data-width="100%"
320
+ data-height="200"
321
+ data-after="-300"
322
+ data-dt-element-name="time207"
323
+ ></div>
324
+ <br/>
325
+ <small>rendered in <span id="time207">X</span> ms</small>
326
+</div>
327
+<div style="width: 33%; display: inline-block;">
328
+ <div data-netdata="netdata.requests"
329
+ data-chart-library="dygraph"
330
+ data-width="100%"
331
+ data-height="200"
332
+ data-after="-300"
333
+ data-dt-element-name="time208"
334
+ ></div>
335
+ <br/>
336
+ <small>rendered in <span id="time208">X</span> ms</small>
337
+</div>
338
+<div style="width: 33%; display: inline-block;">
339
+ <div data-netdata="net.gstag0"
340
+ data-chart-library="dygraph"
341
+ data-width="100%"
342
+ data-height="200"
343
+ data-after="-300"
344
+ data-dt-element-name="time209"
345
+ ></div>
346
+ <br/>
347
+ <small>rendered in <span id="time209">X</span> ms</small>
348
</div>
349
350
@@ -353,82 +353,82 @@ Sparklines using dygraphs
353
<h1>EasyPieChart</h1>
354
<br/>
355
<div style="width: 33%; display: inline-block;">
356
- <div style="display: inline-block; position: relative;">
357
- <div data-netdata="system.processes"
358
- data-chart-library="easypiechart"
359
- data-width="200"
360
- data-height="200"
361
- data-after="-300"
362
- data-points="300"
363
- data-dt-element-name="time601"
364
- ></div>
365
- <br/>
366
- <small>rendered in <span id="time601">X</span> ms</small>
367
- </div>
368
- <div style="display: inline-block; position: relative;">
369
- <div data-netdata="system.processes"
370
- data-chart-library="easypiechart"
371
- data-width="150"
372
- data-height="150"
373
- data-after="-300"
374
- data-points="150"
375
- data-dt-element-name="time601a"
376
- ></div>
377
- <br/>
378
- <small>rendered in <span id="time601a">X</span> ms</small>
379
- </div>
380
-</div>
381
-<div style="width: 33%; display: inline-block;">
382
- <div style="display: inline-block; position: relative;">
383
- <div data-netdata="system.ipv4"
384
- data-chart-library="easypiechart"
385
- data-width="200"
386
- data-height="200"
387
- data-after="-300"
388
- data-points="300"
389
- data-dt-element-name="time602"
390
- ></div>
391
- <br/>
392
- <small>rendered in <span id="time602">X</span> ms</small>
393
- </div>
394
- <div style="display: inline-block; position: relative;">
395
- <div data-netdata="system.ipv4"
396
- data-chart-library="easypiechart"
397
- data-width="100"
398
- data-height="100"
399
- data-after="-300"
400
- data-points="150"
401
- data-dt-element-name="time602a"
402
- ></div>
403
- <br/>
404
- <small>rendered in <span id="time602a">X</span> ms</small>
405
- </div>
406
-</div>
407
-<div style="width: 33%; display: inline-block;">
408
- <div style="display: inline-block; position: relative;">
409
- <div data-netdata="system.cpu"
410
- data-chart-library="easypiechart"
411
- data-width="200"
412
- data-height="200"
413
- data-after="-300"
414
- data-points="300"
415
- data-dt-element-name="time603"
416
- ></div>
417
- <br/>
418
- <small>rendered in <span id="time603">X</span> ms</small>
419
- </div>
420
- <div style="display: inline-block; position: relative;">
421
- <div data-netdata="system.cpu"
422
- data-chart-library="easypiechart"
423
- data-width="75"
424
- data-height="75"
425
- data-after="-300"
426
- data-points="150"
427
- data-dt-element-name="time603a"
428
- ></div>
429
- <br/>
430
- <small>rendered in <span id="time603a">X</span> ms</small>
431
- </div>
356
+ <div style="display: inline-block; position: relative;">
357
+ <div data-netdata="system.processes"
358
+ data-chart-library="easypiechart"
359
+ data-width="200"
360
+ data-height="200"
361
+ data-after="-300"
362
+ data-points="300"
363
+ data-dt-element-name="time601"
364
+ ></div>
365
+ <br/>
366
+ <small>rendered in <span id="time601">X</span> ms</small>
367
+ </div>
368
+ <div style="display: inline-block; position: relative;">
369
+ <div data-netdata="system.processes"
370
+ data-chart-library="easypiechart"
371
+ data-width="150"
372
+ data-height="150"
373
+ data-after="-300"
374
+ data-points="150"
375
+ data-dt-element-name="time601a"
376
+ ></div>
377
+ <br/>
378
+ <small>rendered in <span id="time601a">X</span> ms</small>
379
+ </div>
380
+</div>
381
+<div style="width: 33%; display: inline-block;">
382
+ <div style="display: inline-block; position: relative;">
383
+ <div data-netdata="system.ipv4"
384
+ data-chart-library="easypiechart"
385
+ data-width="200"
386
+ data-height="200"
387
+ data-after="-300"
388
+ data-points="300"
389
+ data-dt-element-name="time602"
390
+ ></div>
391
+ <br/>
392
+ <small>rendered in <span id="time602">X</span> ms</small>
393
+ </div>
394
+ <div style="display: inline-block; position: relative;">
395
+ <div data-netdata="system.ipv4"
396
+ data-chart-library="easypiechart"
397
+ data-width="100"
398
+ data-height="100"
399
+ data-after="-300"
400
+ data-points="150"
401
+ data-dt-element-name="time602a"
402
+ ></div>
403
+ <br/>
404
+ <small>rendered in <span id="time602a">X</span> ms</small>
405
+ </div>
406
+</div>
407
+<div style="width: 33%; display: inline-block;">
408
+ <div style="display: inline-block; position: relative;">
409
+ <div data-netdata="system.cpu"
410
+ data-chart-library="easypiechart"
411
+ data-width="200"
412
+ data-height="200"
413
+ data-after="-300"
414
+ data-points="300"
415
+ data-dt-element-name="time603"
416
+ ></div>
417
+ <br/>
418
+ <small>rendered in <span id="time603">X</span> ms</small>
419
+ </div>
420
+ <div style="display: inline-block; position: relative;">
421
+ <div data-netdata="system.cpu"
422
+ data-chart-library="easypiechart"
423
+ data-width="75"
424
+ data-height="75"
425
+ data-after="-300"
426
+ data-points="150"
427
+ data-dt-element-name="time603a"
428
+ ></div>
429
+ <br/>
430
+ <small>rendered in <span id="time603a">X</span> ms</small>
431
+ </div>
432
</div>
433
434
@@ -436,82 +436,82 @@ Sparklines using dygraphs
436
<h1>Gauge.js</h1>
437
<br/>
438
<div style="width: 33%; display: inline-block;">
439
- <div style="display: inline-block; position: relative;">
440
- <div data-netdata="system.processes"
441
- data-chart-library="gauge"
442
- data-width="250"
443
- data-height="200"
444
- data-after="-300"
445
- data-points="300"
446
- data-dt-element-name="time701"
447
- ></div>
448
- <br/>
449
- <small>rendered in <span id="time701">X</span> ms</small>
450
- </div>
451
- <div style="display: inline-block; position: relative;">
452
- <div data-netdata="system.processes"
453
- data-chart-library="gauge"
454
- data-width="125"
455
- data-height="100"
456
- data-after="-300"
457
- data-points="150"
458
- data-dt-element-name="time701a"
459
- ></div>
460
- <br/>
461
- <small>rendered in <span id="time701a">X</span> ms</small>
462
- </div>
463
-</div>
464
-<div style="width: 33%; display: inline-block;">
465
- <div style="display: inline-block; position: relative;">
466
- <div data-netdata="system.ipv4"
467
- data-chart-library="gauge"
468
- data-width="250"
469
- data-height="200"
470
- data-after="-300"
471
- data-points="300"
472
- data-dt-element-name="time702"
473
- ></div>
474
- <br/>
475
- <small>rendered in <span id="time702">X</span> ms</small>
476
- </div>
477
- <div style="display: inline-block; position: relative;">
478
- <div data-netdata="system.ipv4"
479
- data-chart-library="gauge"
480
- data-width="125"
481
- data-height="100"
482
- data-after="-300"
483
- data-points="150"
484
- data-dt-element-name="time702a"
485
- ></div>
486
- <br/>
487
- <small>rendered in <span id="time702a">X</span> ms</small>
488
- </div>
489
-</div>
490
-<div style="width: 33%; display: inline-block;">
491
- <div style="display: inline-block; position: relative;">
492
- <div data-netdata="system.cpu"
493
- data-chart-library="gauge"
494
- data-width="250"
495
- data-height="200"
496
- data-after="-300"
497
- data-points="300"
498
- data-dt-element-name="time703"
499
- ></div>
500
- <br/>
501
- <small>rendered in <span id="time703">X</span> ms</small>
502
- </div>
503
- <div style="display: inline-block; position: relative;">
504
- <div data-netdata="system.cpu"
505
- data-chart-library="gauge"
506
- data-width="125"
507
- data-height="100"
508
- data-after="-300"
509
- data-points="150"
510
- data-dt-element-name="time703a"
511
- ></div>
512
- <br/>
513
- <small>rendered in <span id="time703a">X</span> ms</small>
514
- </div>
439
+ <div style="display: inline-block; position: relative;">
440
+ <div data-netdata="system.processes"
441
+ data-chart-library="gauge"
442
+ data-width="250"
443
+ data-height="200"
444
+ data-after="-300"
445
+ data-points="300"
446
+ data-dt-element-name="time701"
447
+ ></div>
448
+ <br/>
449
+ <small>rendered in <span id="time701">X</span> ms</small>
450
+ </div>
451
+ <div style="display: inline-block; position: relative;">
452
+ <div data-netdata="system.processes"
453
+ data-chart-library="gauge"
454
+ data-width="125"
455
+ data-height="100"
456
+ data-after="-300"
457
+ data-points="150"
458
+ data-dt-element-name="time701a"
459
+ ></div>
460
+ <br/>
461
+ <small>rendered in <span id="time701a">X</span> ms</small>
462
+ </div>
463
+</div>
464
+<div style="width: 33%; display: inline-block;">
465
+ <div style="display: inline-block; position: relative;">
466
+ <div data-netdata="system.ipv4"
467
+ data-chart-library="gauge"
468
+ data-width="250"
469
+ data-height="200"
470
+ data-after="-300"
471
+ data-points="300"
472
+ data-dt-element-name="time702"
473
+ ></div>
474
+ <br/>
475
+ <small>rendered in <span id="time702">X</span> ms</small>
476
+ </div>
477
+ <div style="display: inline-block; position: relative;">
478
+ <div data-netdata="system.ipv4"
479
+ data-chart-library="gauge"
480
+ data-width="125"
481
+ data-height="100"
482
+ data-after="-300"
483
+ data-points="150"
484
+ data-dt-element-name="time702a"
485
+ ></div>
486
+ <br/>
487
+ <small>rendered in <span id="time702a">X</span> ms</small>
488
+ </div>
489
+</div>
490
+<div style="width: 33%; display: inline-block;">
491
+ <div style="display: inline-block; position: relative;">
492
+ <div data-netdata="system.cpu"
493
+ data-chart-library="gauge"
494
+ data-width="250"
495
+ data-height="200"
496
+ data-after="-300"
497
+ data-points="300"
498
+ data-dt-element-name="time703"
499
+ ></div>
500
+ <br/>
501
+ <small>rendered in <span id="time703">X</span> ms</small>
502
+ </div>
503
+ <div style="display: inline-block; position: relative;">
504
+ <div data-netdata="system.cpu"
505
+ data-chart-library="gauge"
506
+ data-width="125"
507
+ data-height="100"
508
+ data-after="-300"
509
+ data-points="150"
510
+ data-dt-element-name="time703a"
511
+ ></div>
512
+ <br/>
513
+ <small>rendered in <span id="time703a">X</span> ms</small>
514
+ </div>
515
</div>
516
517
@@ -521,37 +521,37 @@ NetData was originaly developed with Google Charts.
521
NetData is a complete Google Visualization API provider.
522
<br/>
523
<div style="width: 33%; display: inline-block;">
524
- <div data-netdata="system.processes"
525
- data-chart-library="google"
526
- data-width="100%"
527
- data-height="200"
528
- data-after="-300"
529
- data-dt-element-name="time301"
530
- ></div>
531
- <br/>
532
- <small>rendered in <span id="time301">X</span> ms</small>
524
+ <div data-netdata="system.processes"
525
+ data-chart-library="google"
526
+ data-width="100%"
527
+ data-height="200"
528
+ data-after="-300"
529
+ data-dt-element-name="time301"
530
+ ></div>
531
+ <br/>
532
+ <small>rendered in <span id="time301">X</span> ms</small>
533
</div>
534
<div style="width: 33%; display: inline-block;">
535
- <div data-netdata="system.ipv4"
536
- data-chart-library="google"
537
- data-width="100%"
538
- data-height="200"
539
- data-after="-300"
540
- data-dt-element-name="time302"
541
- ></div>
542
- <br/>
543
- <small>rendered in <span id="time302">X</span> ms</small>
535
+ <div data-netdata="system.ipv4"
536
+ data-chart-library="google"
537
+ data-width="100%"
538
+ data-height="200"
539
+ data-after="-300"
540
+ data-dt-element-name="time302"
541
+ ></div>
542
+ <br/>
543
+ <small>rendered in <span id="time302">X</span> ms</small>
544
</div>
545
<div style="width: 33%; display: inline-block;">
546
- <div data-netdata="system.cpu"
547
- data-chart-library="google"
548
- data-width="100%"
549
- data-height="200"
550
- data-after="-300"
551
- data-dt-element-name="time303"
552
- ></div>
553
- <br/>
554
- <small>rendered in <span id="time303">X</span> ms</small>
546
+ <div data-netdata="system.cpu"
547
+ data-chart-library="google"
548
+ data-width="100%"
549
+ data-height="200"
550
+ data-after="-300"
551
+ data-dt-element-name="time303"
552
+ ></div>
553
+ <br/>
554
+ <small>rendered in <span id="time303">X</span> ms</small>
555
</div>
556
557
@@ -564,37 +564,37 @@ NetData is a complete Google Visualization API provider.
564
Unfortunatelly, Morris Charts are very slow. Here we force them to lower their detail to get acceptable results.
565
<br/>
566
<div style="width: 33%; display: inline-block;">
567
- <div data-netdata="system.processes"
568
- data-chart-library="morris"
569
- data-width="100%"
570
- data-height="200"
571
- data-after="-300"
572
- data-dt-element-name="time401"
573
- ></div>
574
- <br/>
575
- <small>rendered in <span id="time401">X</span> ms</small>
567
+ <div data-netdata="system.processes"
568
+ data-chart-library="morris"
569
+ data-width="100%"
570
+ data-height="200"
571
+ data-after="-300"
572
+ data-dt-element-name="time401"
573
+ ></div>
574
+ <br/>
575
+ <small>rendered in <span id="time401">X</span> ms</small>
576
</div>
577
<div style="width: 33%; display: inline-block;">
578
- <div data-netdata="system.ipv4"
579
- data-chart-library="morris"
580
- data-width="100%"
581
- data-height="200"
582
- data-after="-300"
583
- data-dt-element-name="time402"
584
- ></div>
585
- <br/>
586
- <small>rendered in <span id="time402">X</span> ms</small>
578
+ <div data-netdata="system.ipv4"
579
+ data-chart-library="morris"
580
+ data-width="100%"
581
+ data-height="200"
582
+ data-after="-300"
583
+ data-dt-element-name="time402"
584
+ ></div>
585
+ <br/>
586
+ <small>rendered in <span id="time402">X</span> ms</small>
587
</div>
588
<div style="width: 33%; display: inline-block;">
589
- <div data-netdata="system.cpu"
590
- data-chart-library="morris"
591
- data-width="100%"
592
- data-height="200"
593
- data-after="-300"
594
- data-dt-element-name="time403"
595
- ></div>
596
- <br/>
597
- <small>rendered in <span id="time403">X</span> ms</small>
589
+ <div data-netdata="system.cpu"
590
+ data-chart-library="morris"
591
+ data-width="100%"
592
+ data-height="200"
593
+ data-after="-300"
594
+ data-dt-element-name="time403"
595
+ ></div>
596
+ <br/>
597
+ <small>rendered in <span id="time403">X</span> ms</small>
598
</div>
599
600
@@ -610,37 +610,37 @@ C3 charts are not usable in large scale. They suffer from the following issues:
610
So, to avoid flashing the charts, we destroy and re-create the charts on each update. Also, since they manipulate the data with javascript we were forced to lower the detail they render to get acceptable speeds.
611
<br/>
612
<div style="width: 33%; display: inline-block;">
613
- <div data-netdata="system.processes"
614
- data-chart-library="c3"
615
- data-width="100%"
616
- data-height="200"
617
- data-after="-300"
618
- data-dt-element-name="time801"
619
- ></div>
620
- <br/>
621
- <small>rendered in <span id="time801">X</span> ms</small>
613
+ <div data-netdata="system.processes"
614
+ data-chart-library="c3"
615
+ data-width="100%"
616
+ data-height="200"
617
+ data-after="-300"
618
+ data-dt-element-name="time801"
619
+ ></div>
620
+ <br/>
621
+ <small>rendered in <span id="time801">X</span> ms</small>
622
</div>
623
<div style="width: 33%; display: inline-block;">
624
- <div data-netdata="system.ipv4"
625
- data-chart-library="c3"
626
- data-width="100%"
627
- data-height="200"
628
- data-after="-300"
629
- data-dt-element-name="time802"
630
- ></div>
631
- <br/>
632
- <small>rendered in <span id="time802">X</span> ms</small>
624
+ <div data-netdata="system.ipv4"
625
+ data-chart-library="c3"
626
+ data-width="100%"
627
+ data-height="200"
628
+ data-after="-300"
629
+ data-dt-element-name="time802"
630
+ ></div>
631
+ <br/>
632
+ <small>rendered in <span id="time802">X</span> ms</small>
633
</div>
634
<div style="width: 33%; display: inline-block;">
635
- <div data-netdata="system.cpu"
636
- data-chart-library="c3"
637
- data-width="100%"
638
- data-height="200"
639
- data-after="-300"
640
- data-dt-element-name="time803"
641
- ></div>
642
- <br/>
643
- <small>rendered in <span id="time803">X</span> ms</small>
635
+ <div data-netdata="system.cpu"
636
+ data-chart-library="c3"
637
+ data-width="100%"
638
+ data-height="200"
639
+ data-after="-300"
640
+ data-dt-element-name="time803"
641
+ ></div>
642
+ <br/>
643
+ <small>rendered in <span id="time803">X</span> ms</small>
644
</div>
645
646
@@ -650,9 +650,9 @@ So, to avoid flashing the charts, we destroy and re-create the charts on each up
650
</div> <!-- 1st container -->
651
</body>
652
</html>
653
- <!-- you can set your netdata server globally, by ucommenting this -->
654
- <!-- you can also give a different server per chart, with the attribute: data-host="http://netdata.server:19999" -->
655
- <!-- <script> netdataServer = "http://box:19999"; </script> -->
653
+ <!-- you can set your netdata server globally, by ucommenting this -->
654
+ <!-- you can also give a different server per chart, with the attribute: data-host="http://netdata.server:19999" -->
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?v39"></script>
657
+ <!-- load the dashboard manager - it will do the rest -->
658
+ <script type="text/javascript" src="dashboard.js?v39"></script>
web/dashboard.js
+5725
-5725
@@ -1,21 +1,21 @@
1
// You can set the following variables before loading this script:
2
//
3
-// var netdataNoDygraphs = true; // do not use dygraph
4
-// var netdataNoSparklines = true; // do not use sparkline
5
-// var netdataNoPeitys = true; // do not use peity
6
-// var netdataNoGoogleCharts = true; // do not use google
7
-// var netdataNoMorris = true; // do not use morris
8
-// var netdataNoEasyPieChart = true; // do not use easy pie chart
9
-// var netdataNoGauge = true; // do not use gauge.js
10
-// var netdataNoD3 = true; // do not use D3
11
-// var netdataNoC3 = true; // do not use C3
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
16
-// var netdataRegistryCallback = null; // Callback function that will be invoked with one param,
3
+// var netdataNoDygraphs = true; // do not use dygraph
4
+// var netdataNoSparklines = true; // do not use sparkline
5
+// var netdataNoPeitys = true; // do not use peity
6
+// var netdataNoGoogleCharts = true; // do not use google
7
+// var netdataNoMorris = true; // do not use morris
8
+// var netdataNoEasyPieChart = true; // do not use easy pie chart
9
+// var netdataNoGauge = true; // do not use gauge.js
10
+// var netdataNoD3 = true; // do not use D3
11
+// var netdataNoC3 = true; // do not use C3
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
16
+// var netdataRegistryCallback = null; // Callback function that will be invoked with one param,
17
// the URLs from the registry
18
-// var netdataShowHelp = true; // enable/disable help
18
+// var netdataShowHelp = true; // enable/disable help
19
//
20
// You can also set the default netdata server, using the following.
21
// When this variable is not set, we assume the page is hosted on your
@@ -24,5737 +24,5737 @@
24
25
//(function(window, document, undefined) {
26
27
- // ------------------------------------------------------------------------
28
- // compatibility fixes
29
-
30
- // fix IE issue with console
31
- if(!window.console) { window.console = { log: function(){} }; }
32
-
33
- // if string.endsWith is not defined, define it
34
- if(typeof String.prototype.endsWith !== 'function') {
35
- String.prototype.endsWith = function(s) {
36
- if(s.length > this.length) return false;
37
- return this.slice(-s.length) === s;
38
- };
39
- }
40
-
41
- // if string.startsWith is not defined, define it
42
- if(typeof String.prototype.startsWith !== 'function') {
43
- String.prototype.startsWith = function(s) {
44
- if(s.length > this.length) return false;
45
- return this.slice(s.length) === s;
46
- };
47
- }
48
-
49
- // global namespace
50
- var NETDATA = window.NETDATA || {};
51
-
52
- // ----------------------------------------------------------------------------------------------------------------
53
- // Detect the netdata server
54
-
55
- // http://stackoverflow.com/questions/984510/what-is-my-script-src-url
56
- // http://stackoverflow.com/questions/6941533/get-protocol-domain-and-port-from-url
57
- NETDATA._scriptSource = function() {
58
- var script = null;
59
-
60
- if(typeof document.currentScript !== 'undefined') {
61
- script = document.currentScript;
62
- }
63
- else {
64
- var all_scripts = document.getElementsByTagName('script');
65
- script = all_scripts[all_scripts.length - 1];
66
- }
67
-
68
- if (typeof script.getAttribute.length !== 'undefined')
69
- script = script.src;
70
- else
71
- script = script.getAttribute('src', -1);
72
-
73
- return script;
74
- };
75
-
76
- if(typeof netdataServer !== 'undefined')
77
- NETDATA.serverDefault = netdataServer;
78
- else {
79
- var s = NETDATA._scriptSource();
80
- if(s) NETDATA.serverDefault = s.replace(/\/dashboard.js(\?.*)*$/g, "");
81
- else {
82
- console.log('WARNING: Cannot detect the URL of the netdata server.');
83
- NETDATA.serverDefault = null;
84
- }
85
- }
86
-
87
- if(NETDATA.serverDefault === null)
88
- NETDATA.serverDefault = '';
89
- else if(NETDATA.serverDefault.slice(-1) !== '/')
90
- NETDATA.serverDefault += '/';
91
-
92
- // default URLs for all the external files we need
93
- // make them RELATIVE so that the whole thing can also be
94
- // installed under a web server
95
- NETDATA.jQuery = NETDATA.serverDefault + 'lib/jquery-1.12.0.min.js';
96
- NETDATA.peity_js = NETDATA.serverDefault + 'lib/jquery.peity.min.js';
97
- NETDATA.sparkline_js = NETDATA.serverDefault + 'lib/jquery.sparkline.min.js';
98
- NETDATA.easypiechart_js = NETDATA.serverDefault + 'lib/jquery.easypiechart.min.js';
99
- NETDATA.gauge_js = NETDATA.serverDefault + 'lib/gauge.min.js';
100
- NETDATA.dygraph_js = NETDATA.serverDefault + 'lib/dygraph-combined.js';
101
- NETDATA.dygraph_smooth_js = NETDATA.serverDefault + 'lib/dygraph-smooth-plotter.js';
102
- NETDATA.raphael_js = NETDATA.serverDefault + 'lib/raphael-min.js';
103
- NETDATA.morris_js = NETDATA.serverDefault + 'lib/morris.min.js';
104
- NETDATA.d3_js = NETDATA.serverDefault + 'lib/d3.min.js';
105
- NETDATA.c3_js = NETDATA.serverDefault + 'lib/c3.min.js';
106
- NETDATA.c3_css = NETDATA.serverDefault + 'css/c3.min.css';
107
- NETDATA.morris_css = NETDATA.serverDefault + 'css/morris.css';
108
- NETDATA.google_js = 'https://www.google.com/jsapi';
109
-
110
- NETDATA.themes = {
111
- white: {
112
- bootstrap_css: NETDATA.serverDefault + 'css/bootstrap.min.css',
113
- dashboard_css: NETDATA.serverDefault + 'dashboard.css',
114
- background: '#FFFFFF',
115
- foreground: '#000000',
116
- grid: '#DDDDDD',
117
- axis: '#CCCCCC',
118
- colors: [ '#3366CC', '#DC3912', '#109618', '#FF9900', '#990099', '#DD4477',
119
- '#3B3EAC', '#66AA00', '#0099C6', '#B82E2E', '#AAAA11', '#5574A6',
120
- '#994499', '#22AA99', '#6633CC', '#E67300', '#316395', '#8B0707',
121
- '#329262', '#3B3EAC' ],
122
- easypiechart_track: '#f0f0f0',
123
- easypiechart_scale: '#dfe0e0',
124
- gauge_pointer: '#C0C0C0',
125
- gauge_stroke: '#F0F0F0',
126
- gauge_gradient: false
127
- },
128
- slate: {
129
- bootstrap_css: NETDATA.serverDefault + 'css/bootstrap.slate.min.css',
130
- dashboard_css: NETDATA.serverDefault + 'dashboard.slate.css',
131
- background: '#272b30',
132
- foreground: '#C8C8C8',
133
- grid: '#373b40',
134
- axis: '#373b40',
135
-/* colors: [ '#55bb33', '#ff2222', '#0099C6', '#faa11b', '#adbce0', '#DDDD00',
136
- '#4178ba', '#f58122', '#a5cc39', '#f58667', '#f5ef89', '#cf93c0',
137
- '#a5d18a', '#b8539d', '#3954a3', '#c8a9cf', '#c7de8a', '#fad20a',
138
- '#a6a479', '#a66da8' ],
27
+ // ------------------------------------------------------------------------
28
+ // compatibility fixes
29
+
30
+ // fix IE issue with console
31
+ if(!window.console) { window.console = { log: function(){} }; }
32
+
33
+ // if string.endsWith is not defined, define it
34
+ if(typeof String.prototype.endsWith !== 'function') {
35
+ String.prototype.endsWith = function(s) {
36
+ if(s.length > this.length) return false;
37
+ return this.slice(-s.length) === s;
38
+ };
39
+ }
40
+
41
+ // if string.startsWith is not defined, define it
42
+ if(typeof String.prototype.startsWith !== 'function') {
43
+ String.prototype.startsWith = function(s) {
44
+ if(s.length > this.length) return false;
45
+ return this.slice(s.length) === s;
46
+ };
47
+ }
48
+
49
+ // global namespace
50
+ var NETDATA = window.NETDATA || {};
51
+
52
+ // ----------------------------------------------------------------------------------------------------------------
53
+ // Detect the netdata server
54
+
55
+ // http://stackoverflow.com/questions/984510/what-is-my-script-src-url
56
+ // http://stackoverflow.com/questions/6941533/get-protocol-domain-and-port-from-url
57
+ NETDATA._scriptSource = function() {
58
+ var script = null;
59
+
60
+ if(typeof document.currentScript !== 'undefined') {
61
+ script = document.currentScript;
62
+ }
63
+ else {
64
+ var all_scripts = document.getElementsByTagName('script');
65
+ script = all_scripts[all_scripts.length - 1];
66
+ }
67
+
68
+ if (typeof script.getAttribute.length !== 'undefined')
69
+ script = script.src;
70
+ else
71
+ script = script.getAttribute('src', -1);
72
+
73
+ return script;
74
+ };
75
+
76
+ if(typeof netdataServer !== 'undefined')
77
+ NETDATA.serverDefault = netdataServer;
78
+ else {
79
+ var s = NETDATA._scriptSource();
80
+ if(s) NETDATA.serverDefault = s.replace(/\/dashboard.js(\?.*)*$/g, "");
81
+ else {
82
+ console.log('WARNING: Cannot detect the URL of the netdata server.');
83
+ NETDATA.serverDefault = null;
84
+ }
85
+ }
86
+
87
+ if(NETDATA.serverDefault === null)
88
+ NETDATA.serverDefault = '';
89
+ else if(NETDATA.serverDefault.slice(-1) !== '/')
90
+ NETDATA.serverDefault += '/';
91
+
92
+ // default URLs for all the external files we need
93
+ // make them RELATIVE so that the whole thing can also be
94
+ // installed under a web server
95
+ NETDATA.jQuery = NETDATA.serverDefault + 'lib/jquery-1.12.0.min.js';
96
+ NETDATA.peity_js = NETDATA.serverDefault + 'lib/jquery.peity.min.js';
97
+ NETDATA.sparkline_js = NETDATA.serverDefault + 'lib/jquery.sparkline.min.js';
98
+ NETDATA.easypiechart_js = NETDATA.serverDefault + 'lib/jquery.easypiechart.min.js';
99
+ NETDATA.gauge_js = NETDATA.serverDefault + 'lib/gauge.min.js';
100
+ NETDATA.dygraph_js = NETDATA.serverDefault + 'lib/dygraph-combined.js';
101
+ NETDATA.dygraph_smooth_js = NETDATA.serverDefault + 'lib/dygraph-smooth-plotter.js';
102
+ NETDATA.raphael_js = NETDATA.serverDefault + 'lib/raphael-min.js';
103
+ NETDATA.morris_js = NETDATA.serverDefault + 'lib/morris.min.js';
104
+ NETDATA.d3_js = NETDATA.serverDefault + 'lib/d3.min.js';
105
+ NETDATA.c3_js = NETDATA.serverDefault + 'lib/c3.min.js';
106
+ NETDATA.c3_css = NETDATA.serverDefault + 'css/c3.min.css';
107
+ NETDATA.morris_css = NETDATA.serverDefault + 'css/morris.css';
108
+ NETDATA.google_js = 'https://www.google.com/jsapi';
109
+
110
+ NETDATA.themes = {
111
+ white: {
112
+ bootstrap_css: NETDATA.serverDefault + 'css/bootstrap.min.css',
113
+ dashboard_css: NETDATA.serverDefault + 'dashboard.css',
114
+ background: '#FFFFFF',
115
+ foreground: '#000000',
116
+ grid: '#DDDDDD',
117
+ axis: '#CCCCCC',
118
+ colors: [ '#3366CC', '#DC3912', '#109618', '#FF9900', '#990099', '#DD4477',
119
+ '#3B3EAC', '#66AA00', '#0099C6', '#B82E2E', '#AAAA11', '#5574A6',
120
+ '#994499', '#22AA99', '#6633CC', '#E67300', '#316395', '#8B0707',
121
+ '#329262', '#3B3EAC' ],
122
+ easypiechart_track: '#f0f0f0',
123
+ easypiechart_scale: '#dfe0e0',
124
+ gauge_pointer: '#C0C0C0',
125
+ gauge_stroke: '#F0F0F0',
126
+ gauge_gradient: false
127
+ },
128
+ slate: {
129
+ bootstrap_css: NETDATA.serverDefault + 'css/bootstrap.slate.min.css',
130
+ dashboard_css: NETDATA.serverDefault + 'dashboard.slate.css',
131
+ background: '#272b30',
132
+ foreground: '#C8C8C8',
133
+ grid: '#373b40',
134
+ axis: '#373b40',
135
+/* colors: [ '#55bb33', '#ff2222', '#0099C6', '#faa11b', '#adbce0', '#DDDD00',
136
+ '#4178ba', '#f58122', '#a5cc39', '#f58667', '#f5ef89', '#cf93c0',
137
+ '#a5d18a', '#b8539d', '#3954a3', '#c8a9cf', '#c7de8a', '#fad20a',
138
+ '#a6a479', '#a66da8' ],
139
*/
140
- colors: [ '#66AA00', '#FE3912', '#3366CC', '#D66300', '#0099C6', '#DDDD00',
141
- '#5054e6', '#EE9911', '#BB44CC', '#e45757', '#ef0aef', '#CC7700',
142
- '#22AA99', '#109618', '#905bfd', '#f54882', '#4381bf', '#ff3737',
143
- '#329262', '#3B3EFF' ],
144
- easypiechart_track: '#373b40',
145
- easypiechart_scale: '#373b40',
146
- gauge_pointer: '#474b50',
147
- gauge_stroke: '#373b40',
148
- gauge_gradient: false
149
- }
150
- };
151
-
152
- if(typeof netdataTheme !== 'undefined' && typeof NETDATA.themes[netdataTheme] !== 'undefined')
153
- NETDATA.themes.current = NETDATA.themes[netdataTheme];
154
- else
155
- NETDATA.themes.current = NETDATA.themes.white;
156
-
157
- if(typeof netdataShowHelp === 'undefined')
158
- netdataShowHelp = true;
159
-
160
- NETDATA.colors = NETDATA.themes.current.colors;
161
-
162
- // these are the colors Google Charts are using
163
- // we have them here to attempt emulate their look and feel on the other chart libraries
164
- // http://there4.io/2012/05/02/google-chart-color-list/
165
- //NETDATA.colors = [ '#3366CC', '#DC3912', '#FF9900', '#109618', '#990099', '#3B3EAC', '#0099C6',
166
- // '#DD4477', '#66AA00', '#B82E2E', '#316395', '#994499', '#22AA99', '#AAAA11',
167
- // '#6633CC', '#E67300', '#8B0707', '#329262', '#5574A6', '#3B3EAC' ];
140
+ colors: [ '#66AA00', '#FE3912', '#3366CC', '#D66300', '#0099C6', '#DDDD00',
141
+ '#5054e6', '#EE9911', '#BB44CC', '#e45757', '#ef0aef', '#CC7700',
142
+ '#22AA99', '#109618', '#905bfd', '#f54882', '#4381bf', '#ff3737',
143
+ '#329262', '#3B3EFF' ],
144
+ easypiechart_track: '#373b40',
145
+ easypiechart_scale: '#373b40',
146
+ gauge_pointer: '#474b50',
147
+ gauge_stroke: '#373b40',
148
+ gauge_gradient: false
149
+ }
150
+ };
151
+
152
+ if(typeof netdataTheme !== 'undefined' && typeof NETDATA.themes[netdataTheme] !== 'undefined')
153
+ NETDATA.themes.current = NETDATA.themes[netdataTheme];
154
+ else
155
+ NETDATA.themes.current = NETDATA.themes.white;
156
+
157
+ if(typeof netdataShowHelp === 'undefined')
158
+ netdataShowHelp = true;
159
+
160
+ NETDATA.colors = NETDATA.themes.current.colors;
161
+
162
+ // these are the colors Google Charts are using
163
+ // we have them here to attempt emulate their look and feel on the other chart libraries
164
+ // http://there4.io/2012/05/02/google-chart-color-list/
165
+ //NETDATA.colors = [ '#3366CC', '#DC3912', '#FF9900', '#109618', '#990099', '#3B3EAC', '#0099C6',
166
+ // '#DD4477', '#66AA00', '#B82E2E', '#316395', '#994499', '#22AA99', '#AAAA11',
167
+ // '#6633CC', '#E67300', '#8B0707', '#329262', '#5574A6', '#3B3EAC' ];
168
169
- // an alternative set
170
- // http://www.mulinblog.com/a-color-palette-optimized-for-data-visualization/
171
- // (blue) (red) (orange) (green) (pink) (brown) (purple) (yellow) (gray)
172
- //NETDATA.colors = [ '#5DA5DA', '#F15854', '#FAA43A', '#60BD68', '#F17CB0', '#B2912F', '#B276B2', '#DECF3F', '#4D4D4D' ];
169
+ // an alternative set
170
+ // http://www.mulinblog.com/a-color-palette-optimized-for-data-visualization/
171
+ // (blue) (red) (orange) (green) (pink) (brown) (purple) (yellow) (gray)
172
+ //NETDATA.colors = [ '#5DA5DA', '#F15854', '#FAA43A', '#60BD68', '#F17CB0', '#B2912F', '#B276B2', '#DECF3F', '#4D4D4D' ];
173
174
- // ----------------------------------------------------------------------------------------------------------------
175
- // the defaults for all charts
174
+ // ----------------------------------------------------------------------------------------------------------------
175
+ // the defaults for all charts
176
177
- // if the user does not specify any of these, the following will be used
177
+ // if the user does not specify any of these, the following will be used
178
179
- NETDATA.chartDefaults = {
180
- host: NETDATA.serverDefault, // the server to get data from
181
- width: '100%', // the chart width - can be null
182
- height: '100%', // the chart height - can be null
183
- min_width: null, // the chart minimum width - can be null
184
- library: 'dygraph', // the graphing library to use
185
- method: 'average', // the grouping method
186
- before: 0, // panning
187
- after: -600, // panning
188
- pixels_per_point: 1, // the detail of the chart
189
- fill_luminance: 0.8 // luminance of colors in solit areas
190
- };
179
+ NETDATA.chartDefaults = {
180
+ host: NETDATA.serverDefault, // the server to get data from
181
+ width: '100%', // the chart width - can be null
182
+ height: '100%', // the chart height - can be null
183
+ min_width: null, // the chart minimum width - can be null
184
+ library: 'dygraph', // the graphing library to use
185
+ method: 'average', // the grouping method
186
+ before: 0, // panning
187
+ after: -600, // panning
188
+ pixels_per_point: 1, // the detail of the chart
189
+ fill_luminance: 0.8 // luminance of colors in solit areas
190
+ };
191
192
- // ----------------------------------------------------------------------------------------------------------------
193
- // global options
192
+ // ----------------------------------------------------------------------------------------------------------------
193
+ // global options
194
195
- NETDATA.options = {
196
- pauseCallback: null, // a callback when we are really paused
195
+ NETDATA.options = {
196
+ pauseCallback: null, // a callback when we are really paused
197
198
- pause: false, // when enabled we don't auto-refresh the charts
198
+ pause: false, // when enabled we don't auto-refresh the charts
199
200
- targets: null, // an array of all the state objects that are
201
- // currently active (independently of their
202
- // viewport visibility)
200
+ targets: null, // an array of all the state objects that are
201
+ // currently active (independently of their
202
+ // viewport visibility)
203
204
- updated_dom: true, // when true, the DOM has been updated with
205
- // new elements we have to check.
204
+ updated_dom: true, // when true, the DOM has been updated with
205
+ // new elements we have to check.
206
207
- auto_refresher_fast_weight: 0, // this is the current time in ms, spent
208
- // rendering charts continiously.
209
- // used with .current.fast_render_timeframe
207
+ auto_refresher_fast_weight: 0, // this is the current time in ms, spent
208
+ // rendering charts continiously.
209
+ // used with .current.fast_render_timeframe
210
211
- page_is_visible: true, // when true, this page is visible
211
+ page_is_visible: true, // when true, this page is visible
212
213
- auto_refresher_stop_until: 0, // timestamp in ms - used internaly, to stop the
214
- // auto-refresher for some time (when a chart is
215
- // performing pan or zoom, we need to stop refreshing
216
- // all other charts, to have the maximum speed for
217
- // rendering the chart that is panned or zoomed).
218
- // Used with .current.global_pan_sync_time
213
+ auto_refresher_stop_until: 0, // timestamp in ms - used internaly, to stop the
214
+ // auto-refresher for some time (when a chart is
215
+ // performing pan or zoom, we need to stop refreshing
216
+ // all other charts, to have the maximum speed for
217
+ // rendering the chart that is panned or zoomed).
218
+ // Used with .current.global_pan_sync_time
219
220
- last_resized: new Date().getTime(), // the timestamp of the last resize request
220
+ last_resized: new Date().getTime(), // the timestamp of the last resize request
221
222
- last_page_scroll: 0, // the timestamp the last time the page was scrolled
222
+ last_page_scroll: 0, // the timestamp the last time the page was scrolled
223
224
- // the current profile
225
- // we may have many...
226
- current: {
227
- pixels_per_point: 1, // the minimum pixels per point for all charts
228
- // increase this to speed javascript up
229
- // each chart library has its own limit too
230
- // the max of this and the chart library is used
231
- // the final is calculated every time, so a change
232
- // here will have immediate effect on the next chart
233
- // update
224
+ // the current profile
225
+ // we may have many...
226
+ current: {
227
+ pixels_per_point: 1, // the minimum pixels per point for all charts
228
+ // increase this to speed javascript up
229
+ // each chart library has its own limit too
230
+ // the max of this and the chart library is used
231
+ // the final is calculated every time, so a change
232
+ // here will have immediate effect on the next chart
233
+ // update
234
235
- idle_between_charts: 100, // ms - how much time to wait between chart updates
235
+ idle_between_charts: 100, // ms - how much time to wait between chart updates
236
237
- fast_render_timeframe: 200, // ms - render continously until this time of continious
238
- // rendering has been reached
239
- // this setting is used to make it render e.g. 10
240
- // charts at once, sleep idle_between_charts time
241
- // and continue for another 10 charts.
237
+ fast_render_timeframe: 200, // ms - render continously until this time of continious
238
+ // rendering has been reached
239
+ // this setting is used to make it render e.g. 10
240
+ // charts at once, sleep idle_between_charts time
241
+ // and continue for another 10 charts.
242
243
- idle_between_loops: 500, // ms - if all charts have been updated, wait this
244
- // time before starting again.
243
+ idle_between_loops: 500, // ms - if all charts have been updated, wait this
244
+ // time before starting again.
245
246
- idle_parallel_loops: 100, // ms - the time between parallel refresher updates
246
+ idle_parallel_loops: 100, // ms - the time between parallel refresher updates
247
248
- idle_lost_focus: 500, // ms - when the window does not have focus, check
249
- // if focus has been regained, every this time
248
+ idle_lost_focus: 500, // ms - when the window does not have focus, check
249
+ // if focus has been regained, every this time
250
251
- global_pan_sync_time: 1000, // ms - when you pan or zoon a chart, the background
252
- // autorefreshing of charts is paused for this amount
253
- // of time
251
+ global_pan_sync_time: 1000, // ms - when you pan or zoon a chart, the background
252
+ // autorefreshing of charts is paused for this amount
253
+ // of time
254
255
- sync_selection_delay: 1500, // ms - when you pan or zoom a chart, wait this amount
256
- // of time before setting up synchronized selections
257
- // on hover.
258
-
259
- sync_selection: true, // enable or disable selection sync
260
-
261
- pan_and_zoom_delay: 50, // when panning or zooming, how ofter to update the chart
262
-
263
- sync_pan_and_zoom: true, // enable or disable pan and zoom sync
264
-
265
- pan_and_zoom_data_padding: true, // fetch more data for the master chart when panning or zooming
266
-
267
- update_only_visible: true, // enable or disable visibility management
268
-
269
- parallel_refresher: true, // enable parallel refresh of charts
270
-
271
- concurrent_refreshes: true, // when parallel_refresher is enabled, sync also the charts
272
-
273
- destroy_on_hide: false, // destroy charts when they are not visible
274
-
275
- show_help: netdataShowHelp, // when enabled the charts will show some help
276
- show_help_delay_show_ms: 500,
277
- show_help_delay_hide_ms: 0,
278
-
279
- eliminate_zero_dimensions: true, // do not show dimensions with just zeros
280
-
281
- stop_updates_when_focus_is_lost: true, // boolean - shall we stop auto-refreshes when document does not have user focus
282
- stop_updates_while_resizing: 1000, // ms - time to stop auto-refreshes while resizing the charts
283
-
284
- double_click_speed: 500, // ms - time between clicks / taps to detect double click/tap
285
-
286
- smooth_plot: true, // enable smooth plot, where possible
287
-
288
- charts_selection_animation_delay: 50, // delay to animate charts when syncing selection
289
-
290
- color_fill_opacity_line: 1.0,
291
- color_fill_opacity_area: 0.2,
292
- color_fill_opacity_stacked: 0.8,
293
-
294
- pan_and_zoom_factor: 0.25, // the increment when panning and zooming with the toolbox
295
- pan_and_zoom_factor_multiplier_control: 2.0,
296
- pan_and_zoom_factor_multiplier_shift: 3.0,
297
- pan_and_zoom_factor_multiplier_alt: 4.0,
298
-
299
- setOptionCallback: function() { ; }
300
- },
301
-
302
- debug: {
303
- show_boxes: false,
304
- main_loop: false,
305
- focus: false,
306
- visibility: false,
307
- chart_data_url: false,
308
- chart_errors: false, // FIXME
309
- chart_timing: false,
310
- chart_calls: false,
311
- libraries: false,
312
- dygraph: false
313
- }
314
- };
315
-
316
- NETDATA.statistics = {
317
- refreshes_total: 0,
318
- refreshes_active: 0,
319
- refreshes_active_max: 0
320
- };
321
-
322
-
323
- // ----------------------------------------------------------------------------------------------------------------
324
- // local storage options
325
-
326
- NETDATA.localStorage = {
327
- default: {},
328
- current: {},
329
- callback: {} // only used for resetting back to defaults
330
- };
331
-
332
- NETDATA.localStorageGet = function(key, def, callback) {
333
- var ret = def;
334
-
335
- if(typeof NETDATA.localStorage.default[key.toString()] === 'undefined') {
336
- NETDATA.localStorage.default[key.toString()] = def;
337
- NETDATA.localStorage.callback[key.toString()] = callback;
338
- }
339
-
340
- if(typeof Storage !== "undefined" && typeof localStorage === 'object') {
341
- try {
342
- // console.log('localStorage: loading "' + key.toString() + '"');
343
- ret = localStorage.getItem(key.toString());
344
- // console.log('netdata loaded: ' + key.toString() + ' = ' + ret.toString());
345
- if(ret === null || ret === 'undefined') {
346
- // console.log('localStorage: cannot load it, saving "' + key.toString() + '" with value "' + JSON.stringify(def) + '"');
347
- localStorage.setItem(key.toString(), JSON.stringify(def));
348
- ret = def;
349
- }
350
- else {
351
- // console.log('localStorage: got "' + key.toString() + '" with value "' + ret + '"');
352
- ret = JSON.parse(ret);
353
- // console.log('localStorage: loaded "' + key.toString() + '" as value ' + ret + ' of type ' + typeof(ret));
354
- }
355
- }
356
- catch(error) {
357
- console.log('localStorage: failed to read "' + key.toString() + '", using default: "' + def.toString() + '"');
358
- ret = def;
359
- }
360
- }
361
-
362
- if(typeof ret === 'undefined' || ret === 'undefined') {
363
- console.log('localStorage: LOADED UNDEFINED "' + key.toString() + '" as value ' + ret + ' of type ' + typeof(ret));
364
- ret = def;
365
- }
366
-
367
- NETDATA.localStorage.current[key.toString()] = ret;
368
- return ret;
369
- };
370
-
371
- NETDATA.localStorageSet = function(key, value, callback) {
372
- if(typeof value === 'undefined' || value === 'undefined') {
373
- console.log('localStorage: ATTEMPT TO SET UNDEFINED "' + key.toString() + '" as value ' + value + ' of type ' + typeof(value));
374
- }
375
-
376
- if(typeof NETDATA.localStorage.default[key.toString()] === 'undefined') {
377
- NETDATA.localStorage.default[key.toString()] = value;
378
- NETDATA.localStorage.current[key.toString()] = value;
379
- NETDATA.localStorage.callback[key.toString()] = callback;
380
- }
381
-
382
- if(typeof Storage !== "undefined" && typeof localStorage === 'object') {
383
- // console.log('localStorage: saving "' + key.toString() + '" with value "' + JSON.stringify(value) + '"');
384
- try {
385
- localStorage.setItem(key.toString(), JSON.stringify(value));
386
- }
387
- catch(e) {
388
- console.log('localStorage: failed to save "' + key.toString() + '" with value: "' + value.toString() + '"');
389
- }
390
- }
391
-
392
- NETDATA.localStorage.current[key.toString()] = value;
393
- return value;
394
- };
395
-
396
- NETDATA.localStorageGetRecursive = function(obj, prefix, callback) {
397
- for(var i in obj) {
398
- if(typeof obj[i] === 'object') {
399
- //console.log('object ' + prefix + '.' + i.toString());
400
- NETDATA.localStorageGetRecursive(obj[i], prefix + '.' + i.toString(), callback);
401
- continue;
402
- }
403
-
404
- obj[i] = NETDATA.localStorageGet(prefix + '.' + i.toString(), obj[i], callback);
405
- }
406
- };
407
-
408
- NETDATA.setOption = function(key, value) {
409
- if(key.toString() === 'setOptionCallback') {
410
- if(typeof NETDATA.options.current.setOptionCallback === 'function') {
411
- NETDATA.options.current[key.toString()] = value;
412
- NETDATA.options.current.setOptionCallback();
413
- }
414
- }
415
- else if(NETDATA.options.current[key.toString()] !== value) {
416
- var name = 'options.' + key.toString();
417
-
418
- if(typeof NETDATA.localStorage.default[name.toString()] === 'undefined')
419
- console.log('localStorage: setOption() on unsaved option: "' + name.toString() + '", value: ' + value);
420
-
421
- //console.log(NETDATA.localStorage);
422
- //console.log('setOption: setting "' + key.toString() + '" to "' + value + '" of type ' + typeof(value) + ' original type ' + typeof(NETDATA.options.current[key.toString()]));
423
- //console.log(NETDATA.options);
424
- NETDATA.options.current[key.toString()] = NETDATA.localStorageSet(name.toString(), value, null);
425
-
426
- if(typeof NETDATA.options.current.setOptionCallback === 'function')
427
- NETDATA.options.current.setOptionCallback();
428
- }
429
-
430
- return true;
431
- };
432
-
433
- NETDATA.getOption = function(key) {
434
- return NETDATA.options.current[key.toString()];
435
- };
436
-
437
- // read settings from local storage
438
- NETDATA.localStorageGetRecursive(NETDATA.options.current, 'options', null);
439
-
440
- // always start with this option enabled.
441
- NETDATA.setOption('stop_updates_when_focus_is_lost', true);
442
-
443
- NETDATA.resetOptions = function() {
444
- for(var i in NETDATA.localStorage.default) {
445
- var a = i.split('.');
446
-
447
- if(a[0] === 'options') {
448
- if(a[1] === 'setOptionCallback') continue;
449
- if(typeof NETDATA.localStorage.default[i] === 'undefined') continue;
450
- if(NETDATA.options.current[i] === NETDATA.localStorage.default[i]) continue;
451
-
452
- NETDATA.setOption(a[1], NETDATA.localStorage.default[i]);
453
- }
454
- else if(a[0] === 'chart_heights') {
455
- if(typeof NETDATA.localStorage.callback[i] === 'function' && typeof NETDATA.localStorage.default[i] !== 'undefined') {
456
- NETDATA.localStorage.callback[i](NETDATA.localStorage.default[i]);
457
- }
458
- }
459
- }
460
- }
461
-
462
- // ----------------------------------------------------------------------------------------------------------------
463
-
464
- if(NETDATA.options.debug.main_loop === true)
465
- console.log('welcome to NETDATA');
466
-
467
- NETDATA.onresize = function() {
468
- NETDATA.options.last_resized = new Date().getTime();
469
- NETDATA.onscroll();
470
- };
471
-
472
- NETDATA.onscroll = function() {
473
- // console.log('onscroll');
474
-
475
- NETDATA.options.last_page_scroll = new Date().getTime();
476
- if(NETDATA.options.targets === null) return;
477
-
478
- // when the user scrolls he sees that we have
479
- // hidden all the not-visible charts
480
- // using this little function we try to switch
481
- // the charts back to visible quickly
482
- var targets = NETDATA.options.targets;
483
- var len = targets.length;
484
- while(len--) targets[len].isVisible();
485
- };
486
-
487
- window.onresize = NETDATA.onresize;
488
- window.onscroll = NETDATA.onscroll;
489
-
490
- // ----------------------------------------------------------------------------------------------------------------
491
- // Error Handling
492
-
493
- NETDATA.errorCodes = {
494
- 100: { message: "Cannot load chart library", alert: true },
495
- 101: { message: "Cannot load jQuery", alert: true },
496
- 402: { message: "Chart library not found", alert: false },
497
- 403: { message: "Chart library not enabled/is failed", alert: false },
498
- 404: { message: "Chart not found", alert: false },
499
- 405: { message: "Cannot download charts index from server", alert: true },
500
- 406: { message: "Invalid charts index downloaded from server", alert: true },
501
- 407: { message: "Cannot HELLO netdata server", alert: false },
502
- 408: { message: "Netdata servers sent invalid response to HELLO", alert: false },
503
- 409: { message: "Cannot ACCESS netdata registry", alert: false },
504
- 410: { message: "Netdata registry ACCESS failed", alert: false },
505
- 411: { message: "Netdata registry server send invalid response to DELETE ", alert: false },
506
- 412: { message: "Netdata registry DELETE failed", alert: false },
507
- 413: { message: "Netdata registry server send invalid response to SWITCH ", alert: false },
508
- 414: { message: "Netdata registry SWITCH failed", alert: false }
509
- };
510
- NETDATA.errorLast = {
511
- code: 0,
512
- message: "",
513
- datetime: 0
514
- };
515
-
516
- NETDATA.error = function(code, msg) {
517
- NETDATA.errorLast.code = code;
518
- NETDATA.errorLast.message = msg;
519
- NETDATA.errorLast.datetime = new Date().getTime();
520
-
521
- console.log("ERROR " + code + ": " + NETDATA.errorCodes[code].message + ": " + msg);
522
-
523
- var ret = true;
524
- if(typeof netdataErrorCallback === 'function') {
525
- ret = netdataErrorCallback('system', code, msg);
526
- }
527
-
528
- if(ret && NETDATA.errorCodes[code].alert)
529
- alert("ERROR " + code + ": " + NETDATA.errorCodes[code].message + ": " + msg);
530
- };
531
-
532
- NETDATA.errorReset = function() {
533
- NETDATA.errorLast.code = 0;
534
- NETDATA.errorLast.message = "You are doing fine!";
535
- NETDATA.errorLast.datetime = 0;
536
- };
537
-
538
- // ----------------------------------------------------------------------------------------------------------------
539
- // Chart Registry
540
-
541
- // When multiple charts need the same chart, we avoid downloading it
542
- // multiple times (and having it in browser memory multiple time)
543
- // by using this registry.
544
-
545
- // Every time we download a chart definition, we save it here with .add()
546
- // Then we try to get it back with .get(). If that fails, we download it.
547
-
548
- NETDATA.chartRegistry = {
549
- charts: {},
550
-
551
- fixid: function(id) {
552
- return id.replace(/:/g, "_").replace(/\//g, "_");
553
- },
554
-
555
- add: function(host, id, data) {
556
- host = this.fixid(host);
557
- id = this.fixid(id);
558
-
559
- if(typeof this.charts[host] === 'undefined')
560
- this.charts[host] = {};
561
-
562
- //console.log('added ' + host + '/' + id);
563
- this.charts[host][id] = data;
564
- },
565
-
566
- get: function(host, id) {
567
- host = this.fixid(host);
568
- id = this.fixid(id);
569
-
570
- if(typeof this.charts[host] === 'undefined')
571
- return null;
572
-
573
- if(typeof this.charts[host][id] === 'undefined')
574
- return null;
575
-
576
- //console.log('cached ' + host + '/' + id);
577
- return this.charts[host][id];
578
- },
579
-
580
- downloadAll: function(host, callback) {
581
- while(host.slice(-1) === '/')
582
- host = host.substring(0, host.length - 1);
583
-
584
- var self = this;
585
-
586
- $.ajax({
587
- url: host + '/api/v1/charts',
588
- async: true,
589
- cache: false,
590
- xhrFields: { withCredentials: true } // required for the cookie
591
- })
592
- .done(function(data) {
593
- if(data !== null) {
594
- var h = NETDATA.chartRegistry.fixid(host);
595
- self.charts[h] = data.charts;
596
- }
597
- else NETDATA.error(406, host + '/api/v1/charts');
598
-
599
- if(typeof callback === 'function')
600
- callback(data);
601
- })
602
- .fail(function() {
603
- NETDATA.error(405, host + '/api/v1/charts');
604
-
605
- if(typeof callback === 'function')
606
- callback(null);
607
- });
608
- }
609
- };
610
-
611
- // ----------------------------------------------------------------------------------------------------------------
612
- // Global Pan and Zoom on charts
613
-
614
- // Using this structure are synchronize all the charts, so that
615
- // when you pan or zoom one, all others are automatically refreshed
616
- // to the same timespan.
617
-
618
- NETDATA.globalPanAndZoom = {
619
- seq: 0, // timestamp ms
620
- // every time a chart is panned or zoomed
621
- // we set the timestamp here
622
- // then we use it as a sequence number
623
- // to find if other charts are syncronized
624
- // to this timerange
625
-
626
- master: null, // the master chart (state), to which all others
627
- // are synchronized
628
-
629
- force_before_ms: null, // the timespan to sync all other charts
630
- force_after_ms: null,
631
-
632
- callback: null,
633
-
634
- // set a new master
635
- setMaster: function(state, after, before) {
636
- if(NETDATA.options.current.sync_pan_and_zoom === false)
637
- return;
638
-
639
- if(this.master !== null && this.master !== state)
640
- this.master.resetChart(true, true);
641
-
642
- var now = new Date().getTime();
643
- this.master = state;
644
- this.seq = now;
645
- this.force_after_ms = after;
646
- this.force_before_ms = before;
647
- NETDATA.options.auto_refresher_stop_until = now + NETDATA.options.current.global_pan_sync_time;
648
-
649
- if(typeof this.callback === 'function')
650
- this.callback(true, after, before);
651
- },
652
-
653
- // clear the master
654
- clearMaster: function() {
655
- if(this.master !== null) {
656
- var st = this.master;
657
- this.master = null;
658
- st.resetChart();
659
- }
660
-
661
- this.master = null;
662
- this.seq = 0;
663
- this.force_after_ms = null;
664
- this.force_before_ms = null;
665
- NETDATA.options.auto_refresher_stop_until = 0;
666
-
667
- if(typeof this.callback === 'function')
668
- this.callback(false, 0, 0);
669
- },
670
-
671
- // is the given state the master of the global
672
- // pan and zoom sync?
673
- isMaster: function(state) {
674
- if(this.master === state) return true;
675
- return false;
676
- },
677
-
678
- // are we currently have a global pan and zoom sync?
679
- isActive: function() {
680
- if(this.master !== null && this.force_before_ms !== null && this.force_after_ms !== null && this.seq !== 0) return true;
681
- return false;
682
- },
683
-
684
- // check if a chart, other than the master
685
- // needs to be refreshed, due to the global pan and zoom
686
- shouldBeAutoRefreshed: function(state) {
687
- if(this.master === null || this.seq === 0)
688
- return false;
689
-
690
- //if(state.needsRecreation())
691
- // return true;
692
-
693
- if(state.tm.pan_and_zoom_seq === this.seq)
694
- return false;
695
-
696
- return true;
697
- }
698
- };
699
-
700
- // ----------------------------------------------------------------------------------------------------------------
701
- // dimensions selection
702
-
703
- // FIXME
704
- // move color assignment to dimensions, here
705
-
706
- dimensionStatus = function(parent, label, name_div, value_div, color) {
707
- this.enabled = false;
708
- this.parent = parent;
709
- this.label = label;
710
- this.name_div = null;
711
- this.value_div = null;
712
- this.color = NETDATA.themes.current.foreground;
713
-
714
- if(parent.selected_count > parent.unselected_count)
715
- this.selected = true;
716
- else
717
- this.selected = false;
718
-
719
- this.setOptions(name_div, value_div, color);
720
- };
721
-
722
- dimensionStatus.prototype.invalidate = function() {
723
- this.name_div = null;
724
- this.value_div = null;
725
- this.enabled = false;
726
- };
727
-
728
- dimensionStatus.prototype.setOptions = function(name_div, value_div, color) {
729
- this.color = color;
730
-
731
- if(this.name_div != name_div) {
732
- this.name_div = name_div;
733
- this.name_div.title = this.label;
734
- this.name_div.style.color = this.color;
735
- if(this.selected === false)
736
- this.name_div.className = 'netdata-legend-name not-selected';
737
- else
738
- this.name_div.className = 'netdata-legend-name selected';
739
- }
740
-
741
- if(this.value_div != value_div) {
742
- this.value_div = value_div;
743
- this.value_div.title = this.label;
744
- this.value_div.style.color = this.color;
745
- if(this.selected === false)
746
- this.value_div.className = 'netdata-legend-value not-selected';
747
- else
748
- this.value_div.className = 'netdata-legend-value selected';
749
- }
750
-
751
- this.enabled = true;
752
- this.setHandler();
753
- };
754
-
755
- dimensionStatus.prototype.setHandler = function() {
756
- if(this.enabled === false) return;
757
-
758
- var ds = this;
759
-
760
- // this.name_div.onmousedown = this.value_div.onmousedown = function(e) {
761
- this.name_div.onclick = this.value_div.onclick = function(e) {
762
- e.preventDefault();
763
- if(ds.isSelected()) {
764
- // this is selected
765
- if(e.shiftKey === true || e.ctrlKey === true) {
766
- // control or shift key is pressed -> unselect this (except is none will remain selected, in which case select all)
767
- ds.unselect();
768
-
769
- if(ds.parent.countSelected() === 0)
770
- ds.parent.selectAll();
771
- }
772
- else {
773
- // no key is pressed -> select only this (except if it is the only selected already, in which case select all)
774
- if(ds.parent.countSelected() === 1) {
775
- ds.parent.selectAll();
776
- }
777
- else {
778
- ds.parent.selectNone();
779
- ds.select();
780
- }
781
- }
782
- }
783
- else {
784
- // this is not selected
785
- if(e.shiftKey === true || e.ctrlKey === true) {
786
- // control or shift key is pressed -> select this too
787
- ds.select();
788
- }
789
- else {
790
- // no key is pressed -> select only this
791
- ds.parent.selectNone();
792
- ds.select();
793
- }
794
- }
795
-
796
- ds.parent.state.redrawChart();
797
- }
798
- };
799
-
800
- dimensionStatus.prototype.select = function() {
801
- if(this.enabled === false) return;
802
-
803
- this.name_div.className = 'netdata-legend-name selected';
804
- this.value_div.className = 'netdata-legend-value selected';
805
- this.selected = true;
806
- };
807
-
808
- dimensionStatus.prototype.unselect = function() {
809
- if(this.enabled === false) return;
810
-
811
- this.name_div.className = 'netdata-legend-name not-selected';
812
- this.value_div.className = 'netdata-legend-value hidden';
813
- this.selected = false;
814
- };
815
-
816
- dimensionStatus.prototype.isSelected = function() {
817
- return(this.enabled === true && this.selected === true);
818
- };
819
-
820
- // ----------------------------------------------------------------------------------------------------------------
821
-
822
- dimensionsVisibility = function(state) {
823
- this.state = state;
824
- this.len = 0;
825
- this.dimensions = {};
826
- this.selected_count = 0;
827
- this.unselected_count = 0;
828
- };
829
-
830
- dimensionsVisibility.prototype.dimensionAdd = function(label, name_div, value_div, color) {
831
- if(typeof this.dimensions[label] === 'undefined') {
832
- this.len++;
833
- this.dimensions[label] = new dimensionStatus(this, label, name_div, value_div, color);
834
- }
835
- else
836
- this.dimensions[label].setOptions(name_div, value_div, color);
837
-
838
- return this.dimensions[label];
839
- };
840
-
841
- dimensionsVisibility.prototype.dimensionGet = function(label) {
842
- return this.dimensions[label];
843
- };
844
-
845
- dimensionsVisibility.prototype.invalidateAll = function() {
846
- for(var d in this.dimensions)
847
- this.dimensions[d].invalidate();
848
- };
849
-
850
- dimensionsVisibility.prototype.selectAll = function() {
851
- for(var d in this.dimensions)
852
- this.dimensions[d].select();
853
- };
854
-
855
- dimensionsVisibility.prototype.countSelected = function() {
856
- var i = 0;
857
- for(var d in this.dimensions)
858
- if(this.dimensions[d].isSelected()) i++;
859
-
860
- return i;
861
- };
862
-
863
- dimensionsVisibility.prototype.selectNone = function() {
864
- for(var d in this.dimensions)
865
- this.dimensions[d].unselect();
866
- };
867
-
868
- dimensionsVisibility.prototype.selected2BooleanArray = function(array) {
869
- var ret = new Array();
870
- this.selected_count = 0;
871
- this.unselected_count = 0;
872
-
873
- for(var i = 0, len = array.length; i < len ; i++) {
874
- var ds = this.dimensions[array[i]];
875
- if(typeof ds === 'undefined') {
876
- // console.log(array[i] + ' is not found');
877
- ret.push(false);
878
- continue;
879
- }
880
-
881
- if(ds.isSelected()) {
882
- ret.push(true);
883
- this.selected_count++;
884
- }
885
- else {
886
- ret.push(false);
887
- this.unselected_count++;
888
- }
889
- }
890
-
891
- if(this.selected_count === 0 && this.unselected_count !== 0) {
892
- this.selectAll();
893
- return this.selected2BooleanArray(array);
894
- }
895
-
896
- return ret;
897
- };
898
-
899
-
900
- // ----------------------------------------------------------------------------------------------------------------
901
- // global selection sync
902
-
903
- NETDATA.globalSelectionSync = {
904
- state: null,
905
- dont_sync_before: 0,
906
- last_t: 0,
907
- slaves: [],
908
-
909
- stop: function() {
910
- if(this.state !== null)
911
- this.state.globalSelectionSyncStop();
912
- },
913
-
914
- delay: function() {
915
- if(this.state !== null) {
916
- this.state.globalSelectionSyncDelay();
917
- }
918
- }
919
- };
920
-
921
- // ----------------------------------------------------------------------------------------------------------------
922
- // Our state object, where all per-chart values are stored
923
-
924
- chartState = function(element) {
925
- var self = $(element);
926
- this.element = element;
927
-
928
- // IMPORTANT:
929
- // all private functions should use 'that', instead of 'this'
930
- var that = this;
931
-
932
- /* error() - private
933
- * show an error instead of the chart
934
- */
935
- var error = function(msg) {
936
- var ret = true;
937
-
938
- if(typeof netdataErrorCallback === 'function') {
939
- ret = netdataErrorCallback('chart', that.id, msg);
940
- }
941
-
942
- if(ret) {
943
- that.element.innerHTML = that.id + ': ' + msg;
944
- that.enabled = false;
945
- that.current = that.pan;
946
- }
947
- };
948
-
949
- // GUID - a unique identifier for the chart
950
- this.uuid = NETDATA.guid();
951
-
952
- // string - the name of chart
953
- this.id = self.data('netdata');
954
-
955
- // string - the key for localStorage settings
956
- this.settings_id = self.data('id') || null;
957
-
958
- // the user given dimensions of the element
959
- this.width = self.data('width') || NETDATA.chartDefaults.width;
960
- this.height = self.data('height') || NETDATA.chartDefaults.height;
961
-
962
- if(this.settings_id !== null) {
963
- this.height = NETDATA.localStorageGet('chart_heights.' + this.settings_id, this.height, function(height) {
964
- // this is the callback that will be called
965
- // if and when the user resets all localStorage variables
966
- // to their defaults
967
-
968
- resizeChartToHeight(height);
969
- });
970
- }
971
-
972
- // string - the netdata server URL, without any path
973
- this.host = self.data('host') || NETDATA.chartDefaults.host;
974
-
975
- // make sure the host does not end with /
976
- // all netdata API requests use absolute paths
977
- while(this.host.slice(-1) === '/')
978
- this.host = this.host.substring(0, this.host.length - 1);
979
-
980
- // string - the grouping method requested by the user
981
- this.method = self.data('method') || NETDATA.chartDefaults.method;
982
-
983
- // the time-range requested by the user
984
- this.after = self.data('after') || NETDATA.chartDefaults.after;
985
- this.before = self.data('before') || NETDATA.chartDefaults.before;
986
-
987
- // the pixels per point requested by the user
988
- this.pixels_per_point = self.data('pixels-per-point') || 1;
989
- this.points = self.data('points') || null;
990
-
991
- // the dimensions requested by the user
992
- this.dimensions = self.data('dimensions') || null;
993
-
994
- // the chart library requested by the user
995
- this.library_name = self.data('chart-library') || NETDATA.chartDefaults.library;
996
-
997
- // object - the chart library used
998
- this.library = null;
999
-
1000
- // color management
1001
- this.colors = null;
1002
- this.colors_assigned = {};
1003
- this.colors_available = null;
1004
-
1005
- // the element already created by the user
1006
- this.element_message = null;
1007
-
1008
- // the element with the chart
1009
- this.element_chart = null;
1010
-
1011
- // the element with the legend of the chart (if created by us)
1012
- this.element_legend = null;
1013
- this.element_legend_childs = {
1014
- hidden: null,
1015
- title_date: null,
1016
- title_time: null,
1017
- title_units: null,
1018
- nano: null,
1019
- nano_options: null,
1020
- series: null
1021
- };
1022
-
1023
- this.chart_url = null; // string - the url to download chart info
1024
- this.chart = null; // object - the chart as downloaded from the server
1025
-
1026
- this.title = self.data('title') || null; // the title of the chart
1027
- this.units = self.data('units') || null; // the units of the chart dimensions
1028
- this.append_options = self.data('append-options') || null; // the units of the chart dimensions
1029
-
1030
- this.running = false; // boolean - true when the chart is being refreshed now
1031
- this.validated = false; // boolean - has the chart been validated?
1032
- this.enabled = true; // boolean - is the chart enabled for refresh?
1033
- this.paused = false; // boolean - is the chart paused for any reason?
1034
- this.selected = false; // boolean - is the chart shown a selection?
1035
- this.debug = false; // boolean - console.log() debug info about this chart
1036
-
1037
- this.netdata_first = 0; // milliseconds - the first timestamp in netdata
1038
- this.netdata_last = 0; // milliseconds - the last timestamp in netdata
1039
- this.requested_after = null; // milliseconds - the timestamp of the request after param
1040
- this.requested_before = null; // milliseconds - the timestamp of the request before param
1041
- this.requested_padding = null;
1042
- this.view_after = 0;
1043
- this.view_before = 0;
1044
-
1045
- this.auto = {
1046
- name: 'auto',
1047
- autorefresh: true,
1048
- force_update_at: 0, // the timestamp to force the update at
1049
- force_before_ms: null,
1050
- force_after_ms: null
1051
- };
1052
- this.pan = {
1053
- name: 'pan',
1054
- autorefresh: false,
1055
- force_update_at: 0, // the timestamp to force the update at
1056
- force_before_ms: null,
1057
- force_after_ms: null
1058
- };
1059
- this.zoom = {
1060
- name: 'zoom',
1061
- autorefresh: false,
1062
- force_update_at: 0, // the timestamp to force the update at
1063
- force_before_ms: null,
1064
- force_after_ms: null
1065
- };
1066
-
1067
- // this is a pointer to one of the sub-classes below
1068
- // auto, pan, zoom
1069
- this.current = this.auto;
1070
-
1071
- // check the requested library is available
1072
- // we don't initialize it here - it will be initialized when
1073
- // this chart will be first used
1074
- if(typeof NETDATA.chartLibraries[that.library_name] === 'undefined') {
1075
- NETDATA.error(402, that.library_name);
1076
- error('chart library "' + that.library_name + '" is not found');
1077
- return;
1078
- }
1079
- else if(NETDATA.chartLibraries[that.library_name].enabled === false) {
1080
- NETDATA.error(403, that.library_name);
1081
- error('chart library "' + that.library_name + '" is not enabled');
1082
- return;
1083
- }
1084
- else
1085
- that.library = NETDATA.chartLibraries[that.library_name];
1086
-
1087
- // milliseconds - the time the last refresh took
1088
- this.refresh_dt_ms = 0;
1089
-
1090
- // if we need to report the rendering speed
1091
- // find the element that needs to be updated
1092
- var refresh_dt_element_name = self.data('dt-element-name') || null; // string - the element to print refresh_dt_ms
1093
-
1094
- if(refresh_dt_element_name !== null)
1095
- this.refresh_dt_element = document.getElementById(refresh_dt_element_name) || null;
1096
- else
1097
- this.refresh_dt_element = null;
1098
-
1099
- this.dimensions_visibility = new dimensionsVisibility(this);
1100
-
1101
- this._updating = false;
1102
-
1103
- // ============================================================================================================
1104
- // PRIVATE FUNCTIONS
1105
-
1106
- var createDOM = function() {
1107
- if(that.enabled === false) return;
1108
-
1109
- if(that.element_message !== null) that.element_message.innerHTML = '';
1110
- if(that.element_legend !== null) that.element_legend.innerHTML = '';
1111
- if(that.element_chart !== null) that.element_chart.innerHTML = '';
1112
-
1113
- that.element.innerHTML = '';
1114
-
1115
- that.element_message = document.createElement('div');
1116
- that.element_message.className = ' netdata-message hidden';
1117
- that.element.appendChild(that.element_message);
1118
-
1119
- that.element_chart = document.createElement('div');
1120
- that.element_chart.id = that.library_name + '-' + that.uuid + '-chart';
1121
- that.element.appendChild(that.element_chart);
1122
-
1123
- if(that.hasLegend() === true) {
1124
- that.element.className = "netdata-container-with-legend";
1125
- that.element_chart.className = 'netdata-chart-with-legend-right netdata-' + that.library_name + '-chart-with-legend-right';
1126
-
1127
- that.element_legend = document.createElement('div');
1128
- that.element_legend.className = 'netdata-chart-legend netdata-' + that.library_name + '-legend';
1129
- that.element.appendChild(that.element_legend);
1130
- }
1131
- else {
1132
- that.element.className = "netdata-container";
1133
- that.element_chart.className = ' netdata-chart netdata-' + that.library_name + '-chart';
1134
-
1135
- that.element_legend = null;
1136
- }
1137
- that.element_legend_childs.series = null;
1138
-
1139
- if(typeof(that.width) === 'string')
1140
- $(that.element).css('width', that.width);
1141
- else if(typeof(that.width) === 'number')
1142
- $(that.element).css('width', that.width + 'px');
1143
-
1144
- if(typeof(that.library.aspect_ratio) === 'undefined') {
1145
- if(typeof(that.height) === 'string')
1146
- $(that.element).css('height', that.height);
1147
- else if(typeof(that.height) === 'number')
1148
- $(that.element).css('height', that.height + 'px');
1149
- }
1150
- else {
1151
- var w = that.element.offsetWidth;
1152
- if(w === null || w === 0) {
1153
- // the div is hidden
1154
- // this will resize the chart when next viewed
1155
- that.tm.last_resized = 0;
1156
- }
1157
- else
1158
- $(that.element).css('height', (that.element.offsetWidth * that.library.aspect_ratio / 100).toString() + 'px');
1159
- }
1160
-
1161
- if(NETDATA.chartDefaults.min_width !== null)
1162
- $(that.element).css('min-width', NETDATA.chartDefaults.min_width);
1163
-
1164
- that.tm.last_dom_created = new Date().getTime();
1165
-
1166
- showLoading();
1167
- };
1168
-
1169
- /* init() private
1170
- * initialize state variables
1171
- * destroy all (possibly) created state elements
1172
- * create the basic DOM for a chart
1173
- */
1174
- var init = function() {
1175
- if(that.enabled === false) return;
1176
-
1177
- that.paused = false;
1178
- that.selected = false;
1179
-
1180
- that.chart_created = false; // boolean - is the library.create() been called?
1181
- that.updates_counter = 0; // numeric - the number of refreshes made so far
1182
- that.updates_since_last_unhide = 0; // numeric - the number of refreshes made since the last time the chart was unhidden
1183
- that.updates_since_last_creation = 0; // numeric - the number of refreshes made since the last time the chart was created
1184
-
1185
- that.tm = {
1186
- last_initialized: 0, // milliseconds - the timestamp it was last initialized
1187
- last_dom_created: 0, // milliseconds - the timestamp its DOM was last created
1188
- last_mode_switch: 0, // milliseconds - the timestamp it switched modes
1189
-
1190
- last_info_downloaded: 0, // milliseconds - the timestamp we downloaded the chart
1191
- last_updated: 0, // the timestamp the chart last updated with data
1192
- pan_and_zoom_seq: 0, // the sequence number of the global synchronization
1193
- // between chart.
1194
- // Used with NETDATA.globalPanAndZoom.seq
1195
- last_visible_check: 0, // the time we last checked if it is visible
1196
- last_resized: 0, // the time the chart was resized
1197
- last_hidden: 0, // the time the chart was hidden
1198
- last_unhidden: 0, // the time the chart was unhidden
1199
- last_autorefreshed: 0 // the time the chart was last refreshed
1200
- };
1201
-
1202
- that.data = null; // the last data as downloaded from the netdata server
1203
- that.data_url = 'invalid://'; // string - the last url used to update the chart
1204
- that.data_points = 0; // number - the number of points returned from netdata
1205
- that.data_after = 0; // milliseconds - the first timestamp of the data
1206
- that.data_before = 0; // milliseconds - the last timestamp of the data
1207
- that.data_update_every = 0; // milliseconds - the frequency to update the data
1208
-
1209
- that.tm.last_initialized = new Date().getTime();
1210
- createDOM();
1211
-
1212
- that.setMode('auto');
1213
- };
1214
-
1215
- var maxMessageFontSize = function() {
1216
- // normally we want a font size, as tall as the element
1217
- var h = that.element_message.clientHeight;
1218
-
1219
- // but give it some air, 20% let's say, or 5 pixels min
1220
- var lost = Math.max(h * 0.2, 5);
1221
- h -= lost;
1222
-
1223
- // center the text, vertically
1224
- var paddingTop = (lost - 5) / 2;
1225
-
1226
- // but check the width too
1227
- // it should fit 10 characters in it
1228
- var w = that.element_message.clientWidth / 10;
1229
- if(h > w) {
1230
- paddingTop += (h - w) / 2;
1231
- h = w;
1232
- }
1233
-
1234
- // and don't make it too huge
1235
- // 5% of the screen size is good
1236
- if(h > screen.height / 20) {
1237
- paddingTop += (h - (screen.height / 20)) / 2;
1238
- h = screen.height / 20;
1239
- }
1240
-
1241
- // set it
1242
- that.element_message.style.fontSize = h.toString() + 'px';
1243
- that.element_message.style.paddingTop = paddingTop.toString() + 'px';
1244
- };
1245
-
1246
- var showMessage = function(msg) {
1247
- that.element_message.className = 'netdata-message';
1248
- that.element_message.innerHTML = msg;
1249
- that.element_message.style.fontSize = 'x-small';
1250
- that.element_message.style.paddingTop = '0px';
1251
- that.___messageHidden___ = undefined;
1252
- };
1253
-
1254
- var showMessageIcon = function(icon) {
1255
- that.element_message.innerHTML = icon;
1256
- that.element_message.className = 'netdata-message icon';
1257
- maxMessageFontSize();
1258
- that.___messageHidden___ = undefined;
1259
- };
1260
-
1261
- var hideMessage = function() {
1262
- if(typeof that.___messageHidden___ === 'undefined') {
1263
- that.___messageHidden___ = true;
1264
- that.element_message.className = 'netdata-message hidden';
1265
- }
1266
- };
1267
-
1268
- var showRendering = function() {
1269
- var icon;
1270
- if(that.chart !== null) {
1271
- if(that.chart.chart_type === 'line')
1272
- icon = '<i class="fa fa-line-chart"></i>';
1273
- else
1274
- icon = '<i class="fa fa-area-chart"></i>';
1275
- }
1276
- else
1277
- icon = '<i class="fa fa-area-chart"></i>';
1278
-
1279
- showMessageIcon(icon + ' netdata');
1280
- };
1281
-
1282
- var showLoading = function() {
1283
- if(that.chart_created === false) {
1284
- showMessageIcon('<i class="fa fa-refresh"></i> netdata');
1285
- return true;
1286
- }
1287
- return false;
1288
- };
1289
-
1290
- var isHidden = function() {
1291
- if(typeof that.___chartIsHidden___ !== 'undefined')
1292
- return true;
1293
-
1294
- return false;
1295
- };
1296
-
1297
- // hide the chart, when it is not visible - called from isVisible()
1298
- var hideChart = function() {
1299
- // hide it, if it is not already hidden
1300
- if(isHidden() === true) return;
1301
-
1302
- if(that.chart_created === true) {
1303
- if(NETDATA.options.current.destroy_on_hide === true) {
1304
- // we should destroy it
1305
- init();
1306
- }
1307
- else {
1308
- showRendering();
1309
- that.element_chart.style.display = 'none';
1310
- if(that.element_legend !== null) that.element_legend.style.display = 'none';
1311
- that.tm.last_hidden = new Date().getTime();
1312
-
1313
- // de-allocate data
1314
- // This works, but I not sure there are no corner cases somewhere
1315
- // so it is commented - if the user has memory issues he can
1316
- // set Destroy on Hide for all charts
1317
- // that.data = null;
1318
- }
1319
- }
1320
-
1321
- that.___chartIsHidden___ = true;
1322
- };
1323
-
1324
- // unhide the chart, when it is visible - called from isVisible()
1325
- var unhideChart = function() {
1326
- if(isHidden() === false) return;
1327
-
1328
- that.___chartIsHidden___ = undefined;
1329
- that.updates_since_last_unhide = 0;
1330
-
1331
- if(that.chart_created === false) {
1332
- // we need to re-initialize it, to show our background
1333
- // logo in bootstrap tabs, until the chart loads
1334
- init();
1335
- }
1336
- else {
1337
- that.tm.last_unhidden = new Date().getTime();
1338
- that.element_chart.style.display = '';
1339
- if(that.element_legend !== null) that.element_legend.style.display = '';
1340
- resizeChart();
1341
- hideMessage();
1342
- }
1343
- };
1344
-
1345
- var canBeRendered = function() {
1346
- if(isHidden() === true || that.isVisible(true) === false)
1347
- return false;
1348
-
1349
- return true;
1350
- };
1351
-
1352
- // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
1353
- var callChartLibraryUpdateSafely = function(data) {
1354
- var status;
1355
-
1356
- if(canBeRendered() === false)
1357
- return false;
1358
-
1359
- if(NETDATA.options.debug.chart_errors === true)
1360
- status = that.library.update(that, data);
1361
- else {
1362
- try {
1363
- status = that.library.update(that, data);
1364
- }
1365
- catch(err) {
1366
- status = false;
1367
- }
1368
- }
1369
-
1370
- if(status === false) {
1371
- error('chart failed to be updated as ' + that.library_name);
1372
- return false;
1373
- }
1374
-
1375
- return true;
1376
- };
1377
-
1378
- // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
1379
- var callChartLibraryCreateSafely = function(data) {
1380
- var status;
1381
-
1382
- if(canBeRendered() === false)
1383
- return false;
1384
-
1385
- if(NETDATA.options.debug.chart_errors === true)
1386
- status = that.library.create(that, data);
1387
- else {
1388
- try {
1389
- status = that.library.create(that, data);
1390
- }
1391
- catch(err) {
1392
- status = false;
1393
- }
1394
- }
1395
-
1396
- if(status === false) {
1397
- error('chart failed to be created as ' + that.library_name);
1398
- return false;
1399
- }
1400
-
1401
- that.chart_created = true;
1402
- that.updates_since_last_creation = 0;
1403
- return true;
1404
- };
1405
-
1406
- // ----------------------------------------------------------------------------------------------------------------
1407
- // Chart Resize
1408
-
1409
- // resizeChart() - private
1410
- // to be called just before the chart library to make sure that
1411
- // a properly sized dom is available
1412
- var resizeChart = function() {
1413
- if(that.isVisible() === true && that.tm.last_resized < NETDATA.options.last_resized) {
1414
- if(that.chart_created === false) return;
1415
-
1416
- if(that.needsRecreation()) {
1417
- init();
1418
- }
1419
- else if(typeof that.library.resize === 'function') {
1420
- that.library.resize(that);
1421
-
1422
- if(that.element_legend_childs.nano !== null && that.element_legend_childs.nano_options !== null)
1423
- $(that.element_legend_childs.nano).nanoScroller();
1424
-
1425
- maxMessageFontSize();
1426
- }
1427
-
1428
- that.tm.last_resized = new Date().getTime();
1429
- }
1430
- };
1431
-
1432
- // this is the actual chart resize algorithm
1433
- // it will:
1434
- // - resize the entire container
1435
- // - update the internal states
1436
- // - resize the chart as the div changes height
1437
- // - update the scrollbar of the legend
1438
- var resizeChartToHeight = function(h) {
1439
- // console.log(h);
1440
- that.element.style.height = h;
1441
-
1442
- if(that.settings_id !== null)
1443
- NETDATA.localStorageSet('chart_heights.' + that.settings_id, h);
1444
-
1445
- var now = new Date().getTime();
1446
- NETDATA.options.last_page_scroll = now;
1447
- NETDATA.options.auto_refresher_stop_until = now + NETDATA.options.current.stop_updates_while_resizing;
1448
-
1449
- // force a resize
1450
- that.tm.last_resized = 0;
1451
- resizeChart();
1452
- };
1453
-
1454
- this.resizeHandler = function(e) {
1455
- e.preventDefault();
1456
-
1457
- if(typeof this.event_resize === 'undefined'
1458
- || this.event_resize.chart_original_w === 'undefined'
1459
- || this.event_resize.chart_original_h === 'undefined')
1460
- this.event_resize = {
1461
- chart_original_w: this.element.clientWidth,
1462
- chart_original_h: this.element.clientHeight,
1463
- last: 0
1464
- };
1465
-
1466
- if(e.type === 'touchstart') {
1467
- this.event_resize.mouse_start_x = e.touches.item(0).pageX;
1468
- this.event_resize.mouse_start_y = e.touches.item(0).pageY;
1469
- }
1470
- else {
1471
- this.event_resize.mouse_start_x = e.clientX;
1472
- this.event_resize.mouse_start_y = e.clientY;
1473
- }
1474
-
1475
- this.event_resize.chart_start_w = this.element.clientWidth;
1476
- this.event_resize.chart_start_h = this.element.clientHeight;
1477
- this.event_resize.chart_last_w = this.element.clientWidth;
1478
- this.event_resize.chart_last_h = this.element.clientHeight;
1479
-
1480
- var now = new Date().getTime();
1481
- if(now - this.event_resize.last <= NETDATA.options.current.double_click_speed) {
1482
- // double click / double tap event
1483
-
1484
- // the optimal height of the chart
1485
- // showing the entire legend
1486
- var optimal = this.event_resize.chart_last_h
1487
- + this.element_legend_childs.content.scrollHeight
1488
- - this.element_legend_childs.content.clientHeight;
1489
-
1490
- // if we are not optimal, be optimal
1491
- if(this.event_resize.chart_last_h != optimal)
1492
- resizeChartToHeight(optimal.toString() + 'px');
1493
-
1494
- // else if we do not have the original height
1495
- // reset to the original height
1496
- else if(this.event_resize.chart_last_h != this.event_resize.chart_original_h)
1497
- resizeChartToHeight(this.event_resize.chart_original_h.toString() + 'px');
1498
- }
1499
- else {
1500
- this.event_resize.last = now;
1501
-
1502
- // process movement event
1503
- document.onmousemove =
1504
- document.ontouchmove =
1505
- this.element_legend_childs.resize_handler.onmousemove =
1506
- this.element_legend_childs.resize_handler.ontouchmove =
1507
- function(e) {
1508
- var y = null;
1509
-
1510
- switch(e.type) {
1511
- case 'mousemove': y = e.clientY; break;
1512
- case 'touchmove': y = e.touches.item(e.touches - 1).pageY; break;
1513
- }
1514
-
1515
- if(y !== null) {
1516
- var newH = that.event_resize.chart_start_h + y - that.event_resize.mouse_start_y;
1517
-
1518
- if(newH >= 70 && newH !== that.event_resize.chart_last_h) {
1519
- resizeChartToHeight(newH.toString() + 'px');
1520
- that.event_resize.chart_last_h = newH;
1521
- }
1522
- }
1523
- };
1524
-
1525
- // process end event
1526
- document.onmouseup =
1527
- document.ontouchend =
1528
- this.element_legend_childs.resize_handler.onmouseup =
1529
- this.element_legend_childs.resize_handler.ontouchend =
1530
- function(e) {
1531
- // remove all the hooks
1532
- document.onmouseup =
1533
- document.onmousemove =
1534
- document.ontouchmove =
1535
- document.ontouchend =
1536
- that.element_legend_childs.resize_handler.onmousemove =
1537
- that.element_legend_childs.resize_handler.ontouchmove =
1538
- that.element_legend_childs.resize_handler.onmouseout =
1539
- that.element_legend_childs.resize_handler.onmouseup =
1540
- that.element_legend_childs.resize_handler.ontouchend =
1541
- null;
1542
-
1543
- // allow auto-refreshes
1544
- NETDATA.options.auto_refresher_stop_until = 0;
1545
- };
1546
- }
1547
- };
1548
-
1549
-
1550
- var noDataToShow = function() {
1551
- showMessageIcon('<i class="fa fa-warning"></i> empty');
1552
- that.legendUpdateDOM();
1553
- that.tm.last_autorefreshed = new Date().getTime();
1554
- // that.data_update_every = 30 * 1000;
1555
- //that.element_chart.style.display = 'none';
1556
- //if(that.element_legend !== null) that.element_legend.style.display = 'none';
1557
- //that.___chartIsHidden___ = true;
1558
- };
1559
-
1560
- // ============================================================================================================
1561
- // PUBLIC FUNCTIONS
1562
-
1563
- this.error = function(msg) {
1564
- error(msg);
1565
- };
1566
-
1567
- this.setMode = function(m) {
1568
- if(this.current !== null && this.current.name === m) return;
1569
-
1570
- if(m === 'auto')
1571
- this.current = this.auto;
1572
- else if(m === 'pan')
1573
- this.current = this.pan;
1574
- else if(m === 'zoom')
1575
- this.current = this.zoom;
1576
- else
1577
- this.current = this.auto;
1578
-
1579
- this.current.force_update_at = 0;
1580
- this.current.force_before_ms = null;
1581
- this.current.force_after_ms = null;
1582
-
1583
- this.tm.last_mode_switch = new Date().getTime();
1584
- };
1585
-
1586
- // ----------------------------------------------------------------------------------------------------------------
1587
- // global selection sync
1588
-
1589
- // prevent to global selection sync for some time
1590
- this.globalSelectionSyncDelay = function(ms) {
1591
- if(NETDATA.options.current.sync_selection === false)
1592
- return;
1593
-
1594
- if(typeof ms === 'number')
1595
- NETDATA.globalSelectionSync.dont_sync_before = new Date().getTime() + ms;
1596
- else
1597
- NETDATA.globalSelectionSync.dont_sync_before = new Date().getTime() + NETDATA.options.current.sync_selection_delay;
1598
- };
1599
-
1600
- // can we globally apply selection sync?
1601
- this.globalSelectionSyncAbility = function() {
1602
- if(NETDATA.options.current.sync_selection === false)
1603
- return false;
1604
-
1605
- if(NETDATA.globalSelectionSync.dont_sync_before > new Date().getTime())
1606
- return false;
1607
-
1608
- return true;
1609
- };
1610
-
1611
- this.globalSelectionSyncIsMaster = function() {
1612
- if(NETDATA.globalSelectionSync.state === this)
1613
- return true;
1614
- else
1615
- return false;
1616
- };
1617
-
1618
- // this chart is the master of the global selection sync
1619
- this.globalSelectionSyncBeMaster = function() {
1620
- // am I the master?
1621
- if(this.globalSelectionSyncIsMaster()) {
1622
- if(this.debug === true)
1623
- this.log('sync: I am the master already.');
1624
-
1625
- return;
1626
- }
1627
-
1628
- if(NETDATA.globalSelectionSync.state) {
1629
- if(this.debug === true)
1630
- this.log('sync: I am not the sync master. Resetting global sync.');
1631
-
1632
- this.globalSelectionSyncStop();
1633
- }
1634
-
1635
- // become the master
1636
- if(this.debug === true)
1637
- this.log('sync: becoming sync master.');
1638
-
1639
- this.selected = true;
1640
- NETDATA.globalSelectionSync.state = this;
1641
-
1642
- // find the all slaves
1643
- var targets = NETDATA.options.targets;
1644
- var len = targets.length;
1645
- while(len--) {
1646
- st = targets[len];
1647
-
1648
- if(st === this) {
1649
- if(this.debug === true)
1650
- st.log('sync: not adding me to sync');
1651
- }
1652
- else if(st.globalSelectionSyncIsEligible()) {
1653
- if(this.debug === true)
1654
- st.log('sync: adding to sync as slave');
1655
-
1656
- st.globalSelectionSyncBeSlave();
1657
- }
1658
- }
1659
-
1660
- // this.globalSelectionSyncDelay(100);
1661
- };
1662
-
1663
- // can the chart participate to the global selection sync as a slave?
1664
- this.globalSelectionSyncIsEligible = function() {
1665
- if(this.enabled === true
1666
- && this.library !== null
1667
- && typeof this.library.setSelection === 'function'
1668
- && this.isVisible() === true
1669
- && this.chart_created === true)
1670
- return true;
1671
-
1672
- return false;
1673
- };
1674
-
1675
- // this chart becomes a slave of the global selection sync
1676
- this.globalSelectionSyncBeSlave = function() {
1677
- if(NETDATA.globalSelectionSync.state !== this)
1678
- NETDATA.globalSelectionSync.slaves.push(this);
1679
- };
1680
-
1681
- // sync all the visible charts to the given time
1682
- // this is to be called from the chart libraries
1683
- this.globalSelectionSync = function(t) {
1684
- if(this.globalSelectionSyncAbility() === false) {
1685
- if(this.debug === true)
1686
- this.log('sync: cannot sync (yet?).');
1687
-
1688
- return;
1689
- }
1690
-
1691
- if(this.globalSelectionSyncIsMaster() === false) {
1692
- if(this.debug === true)
1693
- this.log('sync: trying to be sync master.');
1694
-
1695
- this.globalSelectionSyncBeMaster();
1696
-
1697
- if(this.globalSelectionSyncAbility() === false) {
1698
- if(this.debug === true)
1699
- this.log('sync: cannot sync (yet?).');
1700
-
1701
- return;
1702
- }
1703
- }
1704
-
1705
- NETDATA.globalSelectionSync.last_t = t;
1706
- $.each(NETDATA.globalSelectionSync.slaves, function(i, st) {
1707
- st.setSelection(t);
1708
- });
1709
- };
1710
-
1711
- // stop syncing all charts to the given time
1712
- this.globalSelectionSyncStop = function() {
1713
- if(NETDATA.globalSelectionSync.slaves.length) {
1714
- if(this.debug === true)
1715
- this.log('sync: cleaning up...');
1716
-
1717
- $.each(NETDATA.globalSelectionSync.slaves, function(i, st) {
1718
- if(st === that) {
1719
- if(that.debug === true)
1720
- st.log('sync: not adding me to sync stop');
1721
- }
1722
- else {
1723
- if(that.debug === true)
1724
- st.log('sync: removed slave from sync');
1725
-
1726
- st.clearSelection();
1727
- }
1728
- });
1729
-
1730
- NETDATA.globalSelectionSync.last_t = 0;
1731
- NETDATA.globalSelectionSync.slaves = [];
1732
- NETDATA.globalSelectionSync.state = null;
1733
- }
1734
-
1735
- this.clearSelection();
1736
- };
1737
-
1738
- this.setSelection = function(t) {
1739
- if(typeof this.library.setSelection === 'function') {
1740
- if(this.library.setSelection(this, t) === true)
1741
- this.selected = true;
1742
- else
1743
- this.selected = false;
1744
- }
1745
- else this.selected = true;
1746
-
1747
- if(this.selected === true && this.debug === true)
1748
- this.log('selection set to ' + t.toString());
1749
-
1750
- return this.selected;
1751
- };
1752
-
1753
- this.clearSelection = function() {
1754
- if(this.selected === true) {
1755
- if(typeof this.library.clearSelection === 'function') {
1756
- if(this.library.clearSelection(this) === true)
1757
- this.selected = false;
1758
- else
1759
- this.selected = true;
1760
- }
1761
- else this.selected = false;
1762
-
1763
- if(this.selected === false && this.debug === true)
1764
- this.log('selection cleared');
1765
-
1766
- this.legendReset();
1767
- }
1768
-
1769
- return this.selected;
1770
- };
1771
-
1772
- // find if a timestamp (ms) is shown in the current chart
1773
- this.timeIsVisible = function(t) {
1774
- if(t >= this.data_after && t <= this.data_before)
1775
- return true;
1776
- return false;
1777
- };
1778
-
1779
- this.calculateRowForTime = function(t) {
1780
- if(this.timeIsVisible(t) === false) return -1;
1781
- return Math.floor((t - this.data_after) / this.data_update_every);
1782
- };
1783
-
1784
- // ----------------------------------------------------------------------------------------------------------------
1785
-
1786
- // console logging
1787
- this.log = function(msg) {
1788
- console.log(this.id + ' (' + this.library_name + ' ' + this.uuid + '): ' + msg);
1789
- };
1790
-
1791
- this.pauseChart = function() {
1792
- if(this.paused === false) {
1793
- if(this.debug === true)
1794
- this.log('pauseChart()');
1795
-
1796
- this.paused = true;
1797
- }
1798
- };
1799
-
1800
- this.unpauseChart = function() {
1801
- if(this.paused === true) {
1802
- if(this.debug === true)
1803
- this.log('unpauseChart()');
1804
-
1805
- this.paused = false;
1806
- }
1807
- };
1808
-
1809
- this.resetChart = function(dont_clear_master, dont_update) {
1810
- if(this.debug === true)
1811
- this.log('resetChart(' + dont_clear_master + ', ' + dont_update + ') called');
1812
-
1813
- if(typeof dont_clear_master === 'undefined')
1814
- dont_clear_master = false;
1815
-
1816
- if(typeof dont_update === 'undefined')
1817
- dont_update = false;
1818
-
1819
- if(dont_clear_master !== true && NETDATA.globalPanAndZoom.isMaster(this) === true) {
1820
- if(this.debug === true)
1821
- this.log('resetChart() diverting to clearMaster().');
1822
- // this will call us back with master === true
1823
- NETDATA.globalPanAndZoom.clearMaster();
1824
- return;
1825
- }
1826
-
1827
- this.clearSelection();
1828
-
1829
- this.tm.pan_and_zoom_seq = 0;
1830
-
1831
- this.setMode('auto');
1832
- this.current.force_update_at = 0;
1833
- this.current.force_before_ms = null;
1834
- this.current.force_after_ms = null;
1835
- this.tm.last_autorefreshed = 0;
1836
- this.paused = false;
1837
- this.selected = false;
1838
- this.enabled = true;
1839
- // this.debug = false;
1840
-
1841
- // do not update the chart here
1842
- // or the chart will flip-flop when it is the master
1843
- // of a selection sync and another chart becomes
1844
- // the new master
1845
-
1846
- if(dont_update !== true && this.isVisible() === true) {
1847
- this.updateChart();
1848
- }
1849
- };
1850
-
1851
- this.updateChartPanOrZoom = function(after, before) {
1852
- var logme = 'updateChartPanOrZoom(' + after + ', ' + before + '): ';
1853
- var ret = true;
1854
-
1855
- if(this.debug === true)
1856
- this.log(logme);
1857
-
1858
- if(before < after) {
1859
- if(this.debug === true)
1860
- this.log(logme + 'flipped parameters, rejecting it.');
1861
-
1862
- return false;
1863
- }
1864
-
1865
- if(typeof this.fixed_min_duration === 'undefined')
1866
- this.fixed_min_duration = Math.round((this.chartWidth() / 30) * this.chart.update_every * 1000);
1867
-
1868
- var min_duration = this.fixed_min_duration;
1869
- var current_duration = Math.round(this.view_before - this.view_after);
1870
-
1871
- // round the numbers
1872
- after = Math.round(after);
1873
- before = Math.round(before);
1874
-
1875
- // align them to update_every
1876
- // stretching them further away
1877
- after -= after % this.data_update_every;
1878
- before += this.data_update_every - (before % this.data_update_every);
1879
-
1880
- // the final wanted duration
1881
- var wanted_duration = before - after;
1882
-
1883
- // to allow panning, accept just a point below our minimum
1884
- if((current_duration - this.data_update_every) < min_duration)
1885
- min_duration = current_duration - this.data_update_every;
1886
-
1887
- // we do it, but we adjust to minimum size and return false
1888
- // when the wanted size is below the current and the minimum
1889
- // and we zoom
1890
- if(wanted_duration < current_duration && wanted_duration < min_duration) {
1891
- if(this.debug === true)
1892
- this.log(logme + 'too small: min_duration: ' + (min_duration / 1000).toString() + ', wanted: ' + (wanted_duration / 1000).toString());
1893
-
1894
- min_duration = this.fixed_min_duration;
1895
-
1896
- var dt = (min_duration - wanted_duration) / 2;
1897
- before += dt;
1898
- after -= dt;
1899
- wanted_duration = before - after;
1900
- ret = false;
1901
- }
1902
-
1903
- var tolerance = this.data_update_every * 2;
1904
- var movement = Math.abs(before - this.view_before);
1905
-
1906
- if(Math.abs(current_duration - wanted_duration) <= tolerance && movement <= tolerance && ret === true) {
1907
- if(this.debug === true)
1908
- this.log(logme + 'REJECTING UPDATE: current/min duration: ' + (current_duration / 1000).toString() + '/' + (this.fixed_min_duration / 1000).toString() + ', wanted duration: ' + (wanted_duration / 1000).toString() + ', duration diff: ' + (Math.round(Math.abs(current_duration - wanted_duration) / 1000)).toString() + ', movement: ' + (movement / 1000).toString() + ', tolerance: ' + (tolerance / 1000).toString() + ', returning: ' + false);
1909
- return false;
1910
- }
1911
-
1912
- if(this.current.name === 'auto') {
1913
- this.log(logme + 'caller called me with mode: ' + this.current.name);
1914
- this.setMode('pan');
1915
- }
1916
-
1917
- if(this.debug === true)
1918
- this.log(logme + 'ACCEPTING UPDATE: current/min duration: ' + (current_duration / 1000).toString() + '/' + (this.fixed_min_duration / 1000).toString() + ', wanted duration: ' + (wanted_duration / 1000).toString() + ', duration diff: ' + (Math.round(Math.abs(current_duration - wanted_duration) / 1000)).toString() + ', movement: ' + (movement / 1000).toString() + ', tolerance: ' + (tolerance / 1000).toString() + ', returning: ' + ret);
1919
-
1920
- this.current.force_update_at = new Date().getTime() + NETDATA.options.current.pan_and_zoom_delay;
1921
- this.current.force_after_ms = after;
1922
- this.current.force_before_ms = before;
1923
- NETDATA.globalPanAndZoom.setMaster(this, after, before);
1924
- return ret;
1925
- };
1926
-
1927
- this.legendFormatValue = function(value) {
1928
- if(value === null || value === 'undefined') return '-';
1929
- if(typeof value !== 'number') return value;
1930
-
1931
- var abs = Math.abs(value);
1932
- if(abs >= 1000) return (Math.round(value)).toLocaleString();
1933
- if(abs >= 100 ) return (Math.round(value * 10) / 10).toLocaleString();
1934
- if(abs >= 1 ) return (Math.round(value * 100) / 100).toLocaleString();
1935
- if(abs >= 0.1 ) return (Math.round(value * 1000) / 1000).toLocaleString();
1936
- return (Math.round(value * 10000) / 10000).toLocaleString();
1937
- };
1938
-
1939
- this.legendSetLabelValue = function(label, value) {
1940
- var series = this.element_legend_childs.series[label];
1941
- if(typeof series === 'undefined') return;
1942
- if(series.value === null && series.user === null) return;
1943
-
1944
- // if the value has not changed, skip DOM update
1945
- //if(series.last === value) return;
1946
-
1947
- var s, r;
1948
- if(typeof value === 'number') {
1949
- var v = Math.abs(value);
1950
- s = r = this.legendFormatValue(value);
1951
-
1952
- if(typeof series.last === 'number') {
1953
- if(v > series.last) s += '<i class="fa fa-angle-up" style="width: 8px; text-align: center; overflow: hidden; vertical-align: middle;"></i>';
1954
- else if(v < series.last) s += '<i class="fa fa-angle-down" style="width: 8px; text-align: center; overflow: hidden; vertical-align: middle;"></i>';
1955
- else s += '<i class="fa fa-angle-left" style="width: 8px; text-align: center; overflow: hidden; vertical-align: middle;"></i>';
1956
- }
1957
- else s += '<i class="fa fa-angle-right" style="width: 8px; text-align: center; overflow: hidden; vertical-align: middle;"></i>';
1958
- series.last = v;
1959
- }
1960
- else {
1961
- s = r = value;
1962
- series.last = value;
1963
- }
1964
-
1965
- if(series.value !== null) series.value.innerHTML = s;
1966
- if(series.user !== null) series.user.innerHTML = r;
1967
- };
1968
-
1969
- this.legendSetDate = function(ms) {
1970
- if(typeof ms !== 'number') {
1971
- this.legendShowUndefined();
1972
- return;
1973
- }
1974
-
1975
- var d = new Date(ms);
1976
-
1977
- if(this.element_legend_childs.title_date)
1978
- this.element_legend_childs.title_date.innerHTML = d.toLocaleDateString();
1979
-
1980
- if(this.element_legend_childs.title_time)
1981
- this.element_legend_childs.title_time.innerHTML = d.toLocaleTimeString();
1982
-
1983
- if(this.element_legend_childs.title_units)
1984
- this.element_legend_childs.title_units.innerHTML = this.units;
1985
- };
1986
-
1987
- this.legendShowUndefined = function() {
1988
- if(this.element_legend_childs.title_date)
1989
- this.element_legend_childs.title_date.innerHTML = ' ';
1990
-
1991
- if(this.element_legend_childs.title_time)
1992
- this.element_legend_childs.title_time.innerHTML = this.chart.name;
1993
-
1994
- if(this.element_legend_childs.title_units)
1995
- this.element_legend_childs.title_units.innerHTML = ' ';
1996
-
1997
- if(this.data && this.element_legend_childs.series !== null) {
1998
- var labels = this.data.dimension_names;
1999
- var i = labels.length;
2000
- while(i--) {
2001
- var label = labels[i];
2002
-
2003
- if(typeof label === 'undefined') continue;
2004
- if(typeof this.element_legend_childs.series[label] === 'undefined') continue;
2005
- this.legendSetLabelValue(label, null);
2006
- }
2007
- }
2008
- };
2009
-
2010
- this.legendShowLatestValues = function() {
2011
- if(this.chart === null) return;
2012
- if(this.selected) return;
2013
-
2014
- if(this.data === null || this.element_legend_childs.series === null) {
2015
- this.legendShowUndefined();
2016
- return;
2017
- }
2018
-
2019
- var show_undefined = true;
2020
- if(Math.abs(this.netdata_last - this.view_before) <= this.data_update_every)
2021
- show_undefined = false;
2022
-
2023
- if(show_undefined) {
2024
- this.legendShowUndefined();
2025
- return;
2026
- }
2027
-
2028
- this.legendSetDate(this.view_before);
2029
-
2030
- var labels = this.data.dimension_names;
2031
- var i = labels.length;
2032
- while(i--) {
2033
- var label = labels[i];
2034
-
2035
- if(typeof label === 'undefined') continue;
2036
- if(typeof this.element_legend_childs.series[label] === 'undefined') continue;
2037
-
2038
- if(show_undefined)
2039
- this.legendSetLabelValue(label, null);
2040
- else
2041
- this.legendSetLabelValue(label, this.data.view_latest_values[i]);
2042
- }
2043
- };
2044
-
2045
- this.legendReset = function() {
2046
- this.legendShowLatestValues();
2047
- };
2048
-
2049
- // this should be called just ONCE per dimension per chart
2050
- this._chartDimensionColor = function(label) {
2051
- if(this.colors === null) this.chartColors();
2052
-
2053
- if(typeof this.colors_assigned[label] === 'undefined') {
2054
- if(this.colors_available.length === 0) {
2055
- for(var i = 0, len = NETDATA.themes.current.colors.length; i < len ; i++)
2056
- this.colors_available.push(NETDATA.themes.current.colors[i]);
2057
- }
2058
-
2059
- this.colors_assigned[label] = this.colors_available.shift();
2060
-
2061
- if(this.debug === true)
2062
- this.log('label "' + label + '" got color "' + this.colors_assigned[label]);
2063
- }
2064
- else {
2065
- if(this.debug === true)
2066
- this.log('label "' + label + '" already has color "' + this.colors_assigned[label] + '"');
2067
- }
2068
-
2069
- this.colors.push(this.colors_assigned[label]);
2070
- return this.colors_assigned[label];
2071
- };
2072
-
2073
- this.chartColors = function() {
2074
- if(this.colors !== null) return this.colors;
2075
-
2076
- this.colors = new Array();
2077
- this.colors_available = new Array();
2078
- var i, len;
2079
-
2080
- var c = $(this.element).data('colors');
2081
- // this.log('read colors: ' + c);
2082
- if(typeof c !== 'undefined' && c !== null && c.length > 0) {
2083
- if(typeof c !== 'string') {
2084
- this.log('invalid color given: ' + c + ' (give a space separated list of colors)');
2085
- }
2086
- else {
2087
- c = c.split(' ');
2088
- var added = 0;
2089
-
2090
- while(added < 20) {
2091
- for(i = 0, len = c.length; i < len ; i++) {
2092
- added++;
2093
- this.colors_available.push(c[i]);
2094
- // this.log('adding color: ' + c[i]);
2095
- }
2096
- }
2097
- }
2098
- }
2099
-
2100
- // push all the standard colors too
2101
- for(i = 0, len = NETDATA.themes.current.colors.length; i < len ; i++)
2102
- this.colors_available.push(NETDATA.themes.current.colors[i]);
2103
-
2104
- return this.colors;
2105
- };
2106
-
2107
- this.legendUpdateDOM = function() {
2108
- var needed = false;
2109
-
2110
- // check that the legend DOM is up to date for the downloaded dimensions
2111
- if(typeof this.element_legend_childs.series !== 'object' || this.element_legend_childs.series === null) {
2112
- // this.log('the legend does not have any series - requesting legend update');
2113
- needed = true;
2114
- }
2115
- else if(this.data === null) {
2116
- // this.log('the chart does not have any data - requesting legend update');
2117
- needed = true;
2118
- }
2119
- else if(typeof this.element_legend_childs.series.labels_key === 'undefined') {
2120
- needed = true;
2121
- }
2122
- else {
2123
- var labels = this.data.dimension_names.toString();
2124
- if(labels !== this.element_legend_childs.series.labels_key) {
2125
- needed = true;
2126
-
2127
- if(this.debug === true)
2128
- this.log('NEW LABELS: "' + labels + '" NOT EQUAL OLD LABELS: "' + this.element_legend_childs.series.labels_key + '"');
2129
- }
2130
- }
2131
-
2132
- if(needed === false) {
2133
- // make sure colors available
2134
- this.chartColors();
2135
-
2136
- // do we have to update the current values?
2137
- // we do this, only when the visible chart is current
2138
- if(Math.abs(this.netdata_last - this.view_before) <= this.data_update_every) {
2139
- if(this.debug === true)
2140
- this.log('chart is in latest position... updating values on legend...');
2141
-
2142
- //var labels = this.data.dimension_names;
2143
- //var i = labels.length;
2144
- //while(i--)
2145
- // this.legendSetLabelValue(labels[i], this.data.latest_values[i]);
2146
- }
2147
- return;
2148
- }
2149
- if(this.colors === null) {
2150
- // this is the first time we update the chart
2151
- // let's assign colors to all dimensions
2152
- if(this.library.track_colors() === true)
2153
- for(var dim in this.chart.dimensions)
2154
- this._chartDimensionColor(this.chart.dimensions[dim].name);
2155
- }
2156
- // we will re-generate the colors for the chart
2157
- // based on the selected dimensions
2158
- this.colors = null;
2159
-
2160
- if(this.debug === true)
2161
- this.log('updating Legend DOM');
2162
-
2163
- // mark all dimensions as invalid
2164
- this.dimensions_visibility.invalidateAll();
2165
-
2166
- var genLabel = function(state, parent, dim, name, count) {
2167
- var color = state._chartDimensionColor(name);
2168
-
2169
- var user_element = null;
2170
- var user_id = self.data('show-value-of-' + dim + '-at') || null;
2171
- if(user_id !== null) {
2172
- user_element = document.getElementById(user_id) || null;
2173
- if(user_element === null)
2174
- state.log('Cannot find element with id: ' + user_id);
2175
- }
2176
-
2177
- state.element_legend_childs.series[name] = {
2178
- name: document.createElement('span'),
2179
- value: document.createElement('span'),
2180
- user: user_element,
2181
- last: null
2182
- };
2183
-
2184
- var label = state.element_legend_childs.series[name];
2185
-
2186
- // create the dimension visibility tracking for this label
2187
- state.dimensions_visibility.dimensionAdd(name, label.name, label.value, color);
2188
-
2189
- var rgb = NETDATA.colorHex2Rgb(color);
2190
- label.name.innerHTML = '<table class="netdata-legend-name-table-'
2191
- + state.chart.chart_type
2192
- + '" style="background-color: '
2193
- + 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + NETDATA.options.current['color_fill_opacity_' + state.chart.chart_type] + ')'
2194
- + '"><tr class="netdata-legend-name-tr"><td class="netdata-legend-name-td"></td></tr></table>'
2195
-
2196
- var text = document.createTextNode(' ' + name);
2197
- label.name.appendChild(text);
2198
-
2199
- if(count > 0)
2200
- parent.appendChild(document.createElement('br'));
2201
-
2202
- parent.appendChild(label.name);
2203
- parent.appendChild(label.value);
2204
- };
2205
-
2206
- var content = document.createElement('div');
2207
-
2208
- if(this.hasLegend()) {
2209
- this.element_legend_childs = {
2210
- content: content,
2211
- resize_handler: document.createElement('div'),
2212
- toolbox: document.createElement('div'),
2213
- toolbox_left: document.createElement('div'),
2214
- toolbox_right: document.createElement('div'),
2215
- toolbox_reset: document.createElement('div'),
2216
- toolbox_zoomin: document.createElement('div'),
2217
- toolbox_zoomout: document.createElement('div'),
2218
- toolbox_volume: document.createElement('div'),
2219
- title_date: document.createElement('span'),
2220
- title_time: document.createElement('span'),
2221
- title_units: document.createElement('span'),
2222
- nano: document.createElement('div'),
2223
- nano_options: {
2224
- paneClass: 'netdata-legend-series-pane',
2225
- sliderClass: 'netdata-legend-series-slider',
2226
- contentClass: 'netdata-legend-series-content',
2227
- enabledClass: '__enabled',
2228
- flashedClass: '__flashed',
2229
- activeClass: '__active',
2230
- tabIndex: -1,
2231
- alwaysVisible: true,
2232
- sliderMinHeight: 10
2233
- },
2234
- series: {}
2235
- };
2236
-
2237
- this.element_legend.innerHTML = '';
2238
-
2239
- if(this.library.toolboxPanAndZoom !== null) {
2240
-
2241
- function get_pan_and_zoom_step(event) {
2242
- if (event.ctrlKey)
2243
- return NETDATA.options.current.pan_and_zoom_factor * NETDATA.options.current.pan_and_zoom_factor_multiplier_control;
2244
-
2245
- else if (event.shiftKey)
2246
- return NETDATA.options.current.pan_and_zoom_factor * NETDATA.options.current.pan_and_zoom_factor_multiplier_shift;
2247
-
2248
- else if (event.altKey)
2249
- return NETDATA.options.current.pan_and_zoom_factor * NETDATA.options.current.pan_and_zoom_factor_multiplier_alt;
2250
-
2251
- else
2252
- return NETDATA.options.current.pan_and_zoom_factor;
2253
- }
2254
-
2255
- this.element_legend_childs.toolbox.className += ' netdata-legend-toolbox';
2256
- this.element.appendChild(this.element_legend_childs.toolbox);
2257
-
2258
- this.element_legend_childs.toolbox_left.className += ' netdata-legend-toolbox-button';
2259
- this.element_legend_childs.toolbox_left.innerHTML = '<i class="fa fa-backward"></i>';
2260
- this.element_legend_childs.toolbox.appendChild(this.element_legend_childs.toolbox_left);
2261
- this.element_legend_childs.toolbox_left.onclick = function(e) {
2262
- e.preventDefault();
2263
-
2264
- var step = (that.view_before - that.view_after) * get_pan_and_zoom_step(e);
2265
- var before = that.view_before - step;
2266
- var after = that.view_after - step;
2267
- if(after >= that.netdata_first)
2268
- that.library.toolboxPanAndZoom(that, after, before);
2269
- };
2270
- if(NETDATA.options.current.show_help === true)
2271
- $(this.element_legend_childs.toolbox_left).popover({
2272
- container: "body",
2273
- animation: false,
2274
- html: true,
2275
- trigger: 'hover',
2276
- placement: 'bottom',
2277
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2278
- title: 'Pan Left',
2279
- content: 'Pan the chart to the left. You can also <b>drag it</b> with your mouse or your finger (on touch devices).<br/><small>Help, can be disabled from the settings.</small>'
2280
- });
2281
-
2282
-
2283
- this.element_legend_childs.toolbox_reset.className += ' netdata-legend-toolbox-button';
2284
- this.element_legend_childs.toolbox_reset.innerHTML = '<i class="fa fa-play"></i>';
2285
- this.element_legend_childs.toolbox.appendChild(this.element_legend_childs.toolbox_reset);
2286
- this.element_legend_childs.toolbox_reset.onclick = function(e) {
2287
- e.preventDefault();
2288
- NETDATA.resetAllCharts(that);
2289
- };
2290
- if(NETDATA.options.current.show_help === true)
2291
- $(this.element_legend_childs.toolbox_reset).popover({
2292
- container: "body",
2293
- animation: false,
2294
- html: true,
2295
- trigger: 'hover',
2296
- placement: 'bottom',
2297
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2298
- title: 'Chart Reset',
2299
- content: 'Reset all the charts to their default auto-refreshing state. You can also <b>double click</b> the chart contents with your mouse or your finger (on touch devices).<br/><small>Help, can be disabled from the settings.</small>'
2300
- });
2301
-
2302
- this.element_legend_childs.toolbox_right.className += ' netdata-legend-toolbox-button';
2303
- this.element_legend_childs.toolbox_right.innerHTML = '<i class="fa fa-forward"></i>';
2304
- this.element_legend_childs.toolbox.appendChild(this.element_legend_childs.toolbox_right);
2305
- this.element_legend_childs.toolbox_right.onclick = function(e) {
2306
- e.preventDefault();
2307
- var step = (that.view_before - that.view_after) * get_pan_and_zoom_step(e);
2308
- var before = that.view_before + step;
2309
- var after = that.view_after + step;
2310
- if(before <= that.netdata_last)
2311
- that.library.toolboxPanAndZoom(that, after, before);
2312
- };
2313
- if(NETDATA.options.current.show_help === true)
2314
- $(this.element_legend_childs.toolbox_right).popover({
2315
- container: "body",
2316
- animation: false,
2317
- html: true,
2318
- trigger: 'hover',
2319
- placement: 'bottom',
2320
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2321
- title: 'Pan Right',
2322
- content: 'Pan the chart to the right. You can also <b>drag it</b> with your mouse or your finger (on touch devices).<br/><small>Help, can be disabled from the settings.</small>'
2323
- });
2324
-
2325
-
2326
- this.element_legend_childs.toolbox_zoomin.className += ' netdata-legend-toolbox-button';
2327
- this.element_legend_childs.toolbox_zoomin.innerHTML = '<i class="fa fa-plus"></i>';
2328
- this.element_legend_childs.toolbox.appendChild(this.element_legend_childs.toolbox_zoomin);
2329
- this.element_legend_childs.toolbox_zoomin.onclick = function(e) {
2330
- e.preventDefault();
2331
- var dt = ((that.view_before - that.view_after) * (get_pan_and_zoom_step(e) * 0.8) / 2);
2332
- var before = that.view_before - dt;
2333
- var after = that.view_after + dt;
2334
- that.library.toolboxPanAndZoom(that, after, before);
2335
- };
2336
- if(NETDATA.options.current.show_help === true)
2337
- $(this.element_legend_childs.toolbox_zoomin).popover({
2338
- container: "body",
2339
- animation: false,
2340
- html: true,
2341
- trigger: 'hover',
2342
- placement: 'bottom',
2343
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2344
- title: 'Chart Zoom In',
2345
- content: 'Zoom in the chart. You can also press SHIFT and select an area of the chart to zoom in. On Chrome and Opera, you can press the SHIFT or the ALT keys and then use the mouse wheel to zoom in or out.<br/><small>Help, can be disabled from the settings.</small>'
2346
- });
2347
-
2348
- this.element_legend_childs.toolbox_zoomout.className += ' netdata-legend-toolbox-button';
2349
- this.element_legend_childs.toolbox_zoomout.innerHTML = '<i class="fa fa-minus"></i>';
2350
- this.element_legend_childs.toolbox.appendChild(this.element_legend_childs.toolbox_zoomout);
2351
- this.element_legend_childs.toolbox_zoomout.onclick = function(e) {
2352
- e.preventDefault();
2353
- var dt = (((that.view_before - that.view_after) / (1.0 - (get_pan_and_zoom_step(e) * 0.8)) - (that.view_before - that.view_after)) / 2);
2354
- var before = that.view_before + dt;
2355
- var after = that.view_after - dt;
2356
-
2357
- that.library.toolboxPanAndZoom(that, after, before);
2358
- };
2359
- if(NETDATA.options.current.show_help === true)
2360
- $(this.element_legend_childs.toolbox_zoomout).popover({
2361
- container: "body",
2362
- animation: false,
2363
- html: true,
2364
- trigger: 'hover',
2365
- placement: 'bottom',
2366
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2367
- title: 'Chart Zoom Out',
2368
- content: 'Zoom out the chart. On Chrome and Opera, you can also press the SHIFT or the ALT keys and then use the mouse wheel to zoom in or out.<br/><small>Help, can be disabled from the settings.</small>'
2369
- });
2370
-
2371
- //this.element_legend_childs.toolbox_volume.className += ' netdata-legend-toolbox-button';
2372
- //this.element_legend_childs.toolbox_volume.innerHTML = '<i class="fa fa-sort-amount-desc"></i>';
2373
- //this.element_legend_childs.toolbox_volume.title = 'Visible Volume';
2374
- //this.element_legend_childs.toolbox.appendChild(this.element_legend_childs.toolbox_volume);
2375
- //this.element_legend_childs.toolbox_volume.onclick = function(e) {
2376
- //e.preventDefault();
2377
- //alert('clicked toolbox_volume on ' + that.id);
2378
- //}
2379
- }
2380
- else {
2381
- this.element_legend_childs.toolbox = null;
2382
- this.element_legend_childs.toolbox_left = null;
2383
- this.element_legend_childs.toolbox_reset = null;
2384
- this.element_legend_childs.toolbox_right = null;
2385
- this.element_legend_childs.toolbox_zoomin = null;
2386
- this.element_legend_childs.toolbox_zoomout = null;
2387
- this.element_legend_childs.toolbox_volume = null;
2388
- }
2389
-
2390
- this.element_legend_childs.resize_handler.className += " netdata-legend-resize-handler";
2391
- this.element_legend_childs.resize_handler.innerHTML = '<i class="fa fa-chevron-up"></i><i class="fa fa-chevron-down"></i>';
2392
- this.element.appendChild(this.element_legend_childs.resize_handler);
2393
- if(NETDATA.options.current.show_help === true)
2394
- $(this.element_legend_childs.resize_handler).popover({
2395
- container: "body",
2396
- animation: false,
2397
- html: true,
2398
- trigger: 'hover',
2399
- placement: 'bottom',
2400
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2401
- title: 'Chart Resize',
2402
- content: 'Drag this point with your mouse or your finger (on touch devices), to resize the chart vertically. You can also <b>double click it</b> or <b>double tap it</b> to reset between 2 states: the default and the one that fits all the values.<br/><small>Help, can be disabled from the settings.</small>'
2403
- });
2404
-
2405
- // mousedown event
2406
- this.element_legend_childs.resize_handler.onmousedown =
2407
- function(e) {
2408
- that.resizeHandler(e);
2409
- };
2410
-
2411
- // touchstart event
2412
- this.element_legend_childs.resize_handler.addEventListener('touchstart', function(e) {
2413
- that.resizeHandler(e);
2414
- }, false);
2415
-
2416
- this.element_legend_childs.title_date.className += " netdata-legend-title-date";
2417
- this.element_legend.appendChild(this.element_legend_childs.title_date);
2418
-
2419
- this.element_legend.appendChild(document.createElement('br'));
2420
-
2421
- this.element_legend_childs.title_time.className += " netdata-legend-title-time";
2422
- this.element_legend.appendChild(this.element_legend_childs.title_time);
2423
-
2424
- this.element_legend.appendChild(document.createElement('br'));
2425
-
2426
- this.element_legend_childs.title_units.className += " netdata-legend-title-units";
2427
- this.element_legend.appendChild(this.element_legend_childs.title_units);
2428
-
2429
- this.element_legend.appendChild(document.createElement('br'));
2430
-
2431
- this.element_legend_childs.nano.className = 'netdata-legend-series';
2432
- this.element_legend.appendChild(this.element_legend_childs.nano);
2433
-
2434
- content.className = 'netdata-legend-series-content';
2435
- this.element_legend_childs.nano.appendChild(content);
2436
-
2437
- if(NETDATA.options.current.show_help === true)
2438
- $(content).popover({
2439
- container: "body",
2440
- animation: false,
2441
- html: true,
2442
- trigger: 'hover',
2443
- placement: 'bottom',
2444
- title: 'Chart Legend',
2445
- delay: { show: NETDATA.options.current.show_help_delay_show_ms, hide: NETDATA.options.current.show_help_delay_hide_ms },
2446
- content: 'You can click or tap on the values or the labels to select dimentions. By pressing SHIFT or CONTROL, you can enable or disable multiple dimensions.<br/><small>Help, can be disabled from the settings.</small>'
2447
- });
2448
- }
2449
- else {
2450
- this.element_legend_childs = {
2451
- content: content,
2452
- resize_handler: null,
2453
- toolbox: null,
2454
- toolbox_left: null,
2455
- toolbox_right: null,
2456
- toolbox_reset: null,
2457
- toolbox_zoomin: null,
2458
- toolbox_zoomout: null,
2459
- toolbox_volume: null,
2460
- title_date: null,
2461
- title_time: null,
2462
- title_units: null,
2463
- nano: null,
2464
- nano_options: null,
2465
- series: {}
2466
- };
2467
- }
2468
-
2469
- if(this.data) {
2470
- this.element_legend_childs.series.labels_key = this.data.dimension_names.toString();
2471
- if(this.debug === true)
2472
- this.log('labels from data: "' + this.element_legend_childs.series.labels_key + '"');
2473
-
2474
- for(var i = 0, len = this.data.dimension_names.length; i < len ;i++) {
2475
- genLabel(this, content, this.data.dimension_ids[i], this.data.dimension_names[i], i);
2476
- }
2477
- }
2478
- else {
2479
- var tmp = new Array();
2480
- for(var dim in this.chart.dimensions) {
2481
- tmp.push(this.chart.dimensions[dim].name);
2482
- genLabel(this, content, dim, this.chart.dimensions[dim].name, i);
2483
- }
2484
- this.element_legend_childs.series.labels_key = tmp.toString();
2485
- if(this.debug === true)
2486
- this.log('labels from chart: "' + this.element_legend_childs.series.labels_key + '"');
2487
- }
2488
-
2489
- // create a hidden div to be used for hidding
2490
- // the original legend of the chart library
2491
- var el = document.createElement('div');
2492
- if(this.element_legend !== null)
2493
- this.element_legend.appendChild(el);
2494
- el.style.display = 'none';
2495
-
2496
- this.element_legend_childs.hidden = document.createElement('div');
2497
- el.appendChild(this.element_legend_childs.hidden);
2498
-
2499
- if(this.element_legend_childs.nano !== null && this.element_legend_childs.nano_options !== null)
2500
- $(this.element_legend_childs.nano).nanoScroller(this.element_legend_childs.nano_options);
2501
-
2502
- this.legendShowLatestValues();
2503
- };
2504
-
2505
- this.hasLegend = function() {
2506
- if(typeof this.___hasLegendCache___ !== 'undefined')
2507
- return this.___hasLegendCache___;
2508
-
2509
- var leg = false;
2510
- if(this.library && this.library.legend(this) === 'right-side') {
2511
- var legend = $(this.element).data('legend') || 'yes';
2512
- if(legend === 'yes') leg = true;
2513
- }
2514
-
2515
- this.___hasLegendCache___ = leg;
2516
- return leg;
2517
- };
2518
-
2519
- this.legendWidth = function() {
2520
- return (this.hasLegend())?140:0;
2521
- };
2522
-
2523
- this.legendHeight = function() {
2524
- return $(this.element).height();
2525
- };
2526
-
2527
- this.chartWidth = function() {
2528
- return $(this.element).width() - this.legendWidth();
2529
- };
2530
-
2531
- this.chartHeight = function() {
2532
- return $(this.element).height();
2533
- };
2534
-
2535
- this.chartPixelsPerPoint = function() {
2536
- // force an options provided detail
2537
- var px = this.pixels_per_point;
2538
-
2539
- if(this.library && px < this.library.pixels_per_point(this))
2540
- px = this.library.pixels_per_point(this);
2541
-
2542
- if(px < NETDATA.options.current.pixels_per_point)
2543
- px = NETDATA.options.current.pixels_per_point;
2544
-
2545
- return px;
2546
- };
2547
-
2548
- this.needsRecreation = function() {
2549
- return (
2550
- this.chart_created === true
2551
- && this.library
2552
- && this.library.autoresize() === false
2553
- && this.tm.last_resized < NETDATA.options.last_resized
2554
- );
2555
- };
2556
-
2557
- this.chartURL = function() {
2558
- var after, before, points_multiplier = 1;
2559
- if(NETDATA.globalPanAndZoom.isActive() && NETDATA.globalPanAndZoom.isMaster(this) === false) {
2560
- this.tm.pan_and_zoom_seq = NETDATA.globalPanAndZoom.seq;
2561
-
2562
- after = Math.round(NETDATA.globalPanAndZoom.force_after_ms / 1000);
2563
- before = Math.round(NETDATA.globalPanAndZoom.force_before_ms / 1000);
2564
- this.view_after = after * 1000;
2565
- this.view_before = before * 1000;
2566
-
2567
- this.requested_padding = null;
2568
- points_multiplier = 1;
2569
- }
2570
- else if(this.current.force_before_ms !== null && this.current.force_after_ms !== null) {
2571
- this.tm.pan_and_zoom_seq = 0;
2572
-
2573
- before = Math.round(this.current.force_before_ms / 1000);
2574
- after = Math.round(this.current.force_after_ms / 1000);
2575
- this.view_after = after * 1000;
2576
- this.view_before = before * 1000;
2577
-
2578
- if(NETDATA.options.current.pan_and_zoom_data_padding === true) {
2579
- this.requested_padding = Math.round((before - after) / 2);
2580
- after -= this.requested_padding;
2581
- before += this.requested_padding;
2582
- this.requested_padding *= 1000;
2583
- points_multiplier = 2;
2584
- }
2585
-
2586
- this.current.force_before_ms = null;
2587
- this.current.force_after_ms = null;
2588
- }
2589
- else {
2590
- this.tm.pan_and_zoom_seq = 0;
2591
-
2592
- before = this.before;
2593
- after = this.after;
2594
- this.view_after = after * 1000;
2595
- this.view_before = before * 1000;
2596
-
2597
- this.requested_padding = null;
2598
- points_multiplier = 1;
2599
- }
2600
-
2601
- this.requested_after = after * 1000;
2602
- this.requested_before = before * 1000;
2603
-
2604
- this.data_points = this.points || Math.round(this.chartWidth() / this.chartPixelsPerPoint());
2605
-
2606
- // build the data URL
2607
- this.data_url = this.host + this.chart.data_url;
2608
- this.data_url += "&format=" + this.library.format();
2609
- this.data_url += "&points=" + (this.data_points * points_multiplier).toString();
2610
- this.data_url += "&group=" + this.method;
2611
- this.data_url += "&options=" + this.library.options(this);
2612
- this.data_url += '|jsonwrap';
2613
-
2614
- if(NETDATA.options.current.eliminate_zero_dimensions === true)
2615
- this.data_url += '|nonzero';
2616
-
2617
- if(this.append_options !== null)
2618
- this.data_url += '|' + this.append_options.toString();
2619
-
2620
- if(after)
2621
- this.data_url += "&after=" + after.toString();
2622
-
2623
- if(before)
2624
- this.data_url += "&before=" + before.toString();
2625
-
2626
- if(this.dimensions)
2627
- this.data_url += "&dimensions=" + this.dimensions;
2628
-
2629
- if(NETDATA.options.debug.chart_data_url === true || this.debug === true)
2630
- this.log('chartURL(): ' + this.data_url + ' WxH:' + this.chartWidth() + 'x' + this.chartHeight() + ' points: ' + this.data_points + ' library: ' + this.library_name);
2631
- };
2632
-
2633
- this.redrawChart = function() {
2634
- if(this.data !== null)
2635
- this.updateChartWithData(this.data);
2636
- };
2637
-
2638
- this.updateChartWithData = function(data) {
2639
- if(this.debug === true)
2640
- this.log('updateChartWithData() called.');
2641
-
2642
- // this may force the chart to be re-created
2643
- resizeChart();
2644
-
2645
- this.data = data;
2646
- this.updates_counter++;
2647
- this.updates_since_last_unhide++;
2648
- this.updates_since_last_creation++;
2649
-
2650
- var started = new Date().getTime();
2651
-
2652
- // if the result is JSON, find the latest update-every
2653
- this.data_update_every = data.view_update_every * 1000;
2654
- this.data_after = data.after * 1000;
2655
- this.data_before = data.before * 1000;
2656
- this.netdata_first = data.first_entry * 1000;
2657
- this.netdata_last = data.last_entry * 1000;
2658
- this.data_points = data.points;
2659
- data.state = this;
2660
-
2661
- if(NETDATA.options.current.pan_and_zoom_data_padding === true && this.requested_padding !== null) {
2662
- if(this.view_after < this.data_after) {
2663
- // console.log('adusting view_after from ' + this.view_after + ' to ' + this.data_after);
2664
- this.view_after = this.data_after;
2665
- }
2666
-
2667
- if(this.view_before > this.data_before) {
2668
- // console.log('adusting view_before from ' + this.view_before + ' to ' + this.data_before);
2669
- this.view_before = this.data_before;
2670
- }
2671
- }
2672
- else {
2673
- this.view_after = this.data_after;
2674
- this.view_before = this.data_before;
2675
- }
2676
-
2677
- if(this.debug === true) {
2678
- this.log('UPDATE No ' + this.updates_counter + ' COMPLETED');
2679
-
2680
- if(this.current.force_after_ms)
2681
- this.log('STATUS: forced : ' + (this.current.force_after_ms / 1000).toString() + ' - ' + (this.current.force_before_ms / 1000).toString());
2682
- else
2683
- this.log('STATUS: forced : unset');
2684
-
2685
- this.log('STATUS: requested : ' + (this.requested_after / 1000).toString() + ' - ' + (this.requested_before / 1000).toString());
2686
- this.log('STATUS: downloaded: ' + (this.data_after / 1000).toString() + ' - ' + (this.data_before / 1000).toString());
2687
- this.log('STATUS: rendered : ' + (this.view_after / 1000).toString() + ' - ' + (this.view_before / 1000).toString());
2688
- this.log('STATUS: points : ' + (this.data_points).toString());
2689
- }
2690
-
2691
- if(this.data_points === 0) {
2692
- noDataToShow();
2693
- return;
2694
- }
2695
-
2696
- if(this.updates_since_last_creation >= this.library.max_updates_to_recreate()) {
2697
- if(this.debug === true)
2698
- this.log('max updates of ' + this.updates_since_last_creation.toString() + ' reached. Forcing re-generation.');
2699
-
2700
- this.chart_created = false;
2701
- }
2702
-
2703
- // check and update the legend
2704
- this.legendUpdateDOM();
2705
-
2706
- if(this.chart_created === true
2707
- && typeof this.library.update === 'function') {
2708
-
2709
- if(this.debug === true)
2710
- this.log('updating chart...');
2711
-
2712
- if(callChartLibraryUpdateSafely(data) === false)
2713
- return;
2714
- }
2715
- else {
2716
- if(this.debug === true)
2717
- this.log('creating chart...');
2718
-
2719
- if(callChartLibraryCreateSafely(data) === false)
2720
- return;
2721
- }
2722
- hideMessage();
2723
- this.legendShowLatestValues();
2724
- if(this.selected === true)
2725
- NETDATA.globalSelectionSync.stop();
2726
-
2727
- // update the performance counters
2728
- var now = new Date().getTime();
2729
- this.tm.last_updated = now;
2730
-
2731
- // don't update last_autorefreshed if this chart is
2732
- // forced to be updated with global PanAndZoom
2733
- if(NETDATA.globalPanAndZoom.isActive())
2734
- this.tm.last_autorefreshed = 0;
2735
- else {
2736
- if(NETDATA.options.current.parallel_refresher === true && NETDATA.options.current.concurrent_refreshes === true)
2737
- this.tm.last_autorefreshed = now - (now % this.data_update_every);
2738
- else
2739
- this.tm.last_autorefreshed = now;
2740
- }
2741
-
2742
- this.refresh_dt_ms = now - started;
2743
- NETDATA.options.auto_refresher_fast_weight += this.refresh_dt_ms;
2744
-
2745
- if(this.refresh_dt_element !== null)
2746
- this.refresh_dt_element.innerHTML = this.refresh_dt_ms.toString();
2747
- };
2748
-
2749
- this.updateChart = function(callback) {
2750
- if(this.debug === true)
2751
- this.log('updateChart() called.');
2752
-
2753
- if(this._updating === true) {
2754
- if(this.debug === true)
2755
- this.log('I am already updating...');
2756
-
2757
- if(typeof callback === 'function') callback();
2758
- return false;
2759
- }
2760
-
2761
- // due to late initialization of charts and libraries
2762
- // we need to check this too
2763
- if(this.enabled === false) {
2764
- if(this.debug === true)
2765
- this.log('I am not enabled');
2766
-
2767
- if(typeof callback === 'function') callback();
2768
- return false;
2769
- }
2770
-
2771
- if(canBeRendered() === false) {
2772
- if(typeof callback === 'function') callback();
2773
- return false;
2774
- }
2775
-
2776
- if(this.chart === null) {
2777
- this.getChart(function() { that.updateChart(callback); });
2778
- return false;
2779
- }
2780
-
2781
- if(this.library.initialized === false) {
2782
- if(this.library.enabled === true) {
2783
- this.library.initialize(function() { that.updateChart(callback); });
2784
- return false;
2785
- }
2786
- else {
2787
- error('chart library "' + this.library_name + '" is not available.');
2788
- if(typeof callback === 'function') callback();
2789
- return false;
2790
- }
2791
- }
2792
-
2793
- this.clearSelection();
2794
- this.chartURL();
2795
-
2796
- if(this.debug === true)
2797
- this.log('updating from ' + this.data_url);
2798
-
2799
- NETDATA.statistics.refreshes_total++;
2800
- NETDATA.statistics.refreshes_active++;
2801
-
2802
- if(NETDATA.statistics.refreshes_active > NETDATA.statistics.refreshes_active_max)
2803
- NETDATA.statistics.refreshes_active_max = NETDATA.statistics.refreshes_active;
2804
-
2805
- this._updating = true;
2806
-
2807
- this.xhr = $.ajax( {
2808
- url: this.data_url,
2809
- cache: false,
2810
- async: true,
2811
- xhrFields: { withCredentials: true } // required for the cookie
2812
- })
2813
- .success(function(data) {
2814
- if(that.debug === true)
2815
- that.log('data received. updating chart.');
2816
-
2817
- that.updateChartWithData(data);
2818
- })
2819
- .fail(function() {
2820
- error('data download failed for url: ' + that.data_url);
2821
- })
2822
- .always(function() {
2823
- NETDATA.statistics.refreshes_active--;
2824
- that._updating = false;
2825
- if(typeof callback === 'function') callback();
2826
- });
2827
-
2828
- return true;
2829
- };
2830
-
2831
- this.isVisible = function(nocache) {
2832
- if(typeof nocache === 'undefined')
2833
- nocache = false;
2834
-
2835
- // this.log('last_visible_check: ' + this.tm.last_visible_check + ', last_page_scroll: ' + NETDATA.options.last_page_scroll);
2836
-
2837
- // caching - we do not evaluate the charts visibility
2838
- // if the page has not been scrolled since the last check
2839
- if(nocache === false && this.tm.last_visible_check > NETDATA.options.last_page_scroll)
2840
- return this.___isVisible___;
2841
-
2842
- this.tm.last_visible_check = new Date().getTime();
2843
-
2844
- var wh = window.innerHeight;
2845
- var x = this.element.getBoundingClientRect();
2846
- var ret = 0;
2847
- var tolerance = 0;
2848
-
2849
- if(x.width === 0 || x.height === 0) {
2850
- hideChart();
2851
- this.___isVisible___ = false;
2852
- return this.___isVisible___;
2853
- }
2854
-
2855
- if(x.top < 0 && -x.top > x.height) {
2856
- // the chart is entirely above
2857
- ret = -x.top - x.height;
2858
- }
2859
- else if(x.top > wh) {
2860
- // the chart is entirely below
2861
- ret = x.top - wh;
2862
- }
2863
-
2864
- if(ret > tolerance) {
2865
- // the chart is too far
2866
-
2867
- hideChart();
2868
- this.___isVisible___ = false;
2869
- return this.___isVisible___;
2870
- }
2871
- else {
2872
- // the chart is inside or very close
2873
-
2874
- unhideChart();
2875
- this.___isVisible___ = true;
2876
- return this.___isVisible___;
2877
- }
2878
- };
2879
-
2880
- this.isAutoRefreshable = function() {
2881
- return (this.current.autorefresh);
2882
- };
2883
-
2884
- this.canBeAutoRefreshed = function() {
2885
- var now = new Date().getTime();
2886
-
2887
- if(this.running === true) {
2888
- if(this.debug === true)
2889
- this.log('I am already running');
2890
-
2891
- return false;
2892
- }
2893
-
2894
- if(this.enabled === false) {
2895
- if(this.debug === true)
2896
- this.log('I am not enabled');
2897
-
2898
- return false;
2899
- }
2900
-
2901
- if(this.library === null || this.library.enabled === false) {
2902
- error('charting library "' + this.library_name + '" is not available');
2903
- if(this.debug === true)
2904
- this.log('My chart library ' + this.library_name + ' is not available');
2905
-
2906
- return false;
2907
- }
2908
-
2909
- if(this.isVisible() === false) {
2910
- if(NETDATA.options.debug.visibility === true || this.debug === true)
2911
- this.log('I am not visible');
2912
-
2913
- return false;
2914
- }
2915
-
2916
- if(this.current.force_update_at !== 0 && this.current.force_update_at < now) {
2917
- if(this.debug === true)
2918
- this.log('timed force update detected - allowing this update');
2919
-
2920
- this.current.force_update_at = 0;
2921
- return true;
2922
- }
2923
-
2924
- if(this.isAutoRefreshable() === true) {
2925
- // allow the first update, even if the page is not visible
2926
- if(this.updates_counter && this.updates_since_last_unhide && NETDATA.options.page_is_visible === false) {
2927
- if(NETDATA.options.debug.focus === true || this.debug === true)
2928
- this.log('canBeAutoRefreshed(): page does not have focus');
2929
-
2930
- return false;
2931
- }
2932
-
2933
- if(this.needsRecreation() === true) {
2934
- if(this.debug === true)
2935
- this.log('canBeAutoRefreshed(): needs re-creation.');
2936
-
2937
- return true;
2938
- }
2939
-
2940
- // options valid only for autoRefresh()
2941
- if(NETDATA.options.auto_refresher_stop_until === 0 || NETDATA.options.auto_refresher_stop_until < now) {
2942
- if(NETDATA.globalPanAndZoom.isActive()) {
2943
- if(NETDATA.globalPanAndZoom.shouldBeAutoRefreshed(this)) {
2944
- if(this.debug === true)
2945
- this.log('canBeAutoRefreshed(): global panning: I need an update.');
2946
-
2947
- return true;
2948
- }
2949
- else {
2950
- if(this.debug === true)
2951
- this.log('canBeAutoRefreshed(): global panning: I am already up to date.');
2952
-
2953
- return false;
2954
- }
2955
- }
2956
-
2957
- if(this.selected === true) {
2958
- if(this.debug === true)
2959
- this.log('canBeAutoRefreshed(): I have a selection in place.');
2960
-
2961
- return false;
2962
- }
2963
-
2964
- if(this.paused === true) {
2965
- if(this.debug === true)
2966
- this.log('canBeAutoRefreshed(): I am paused.');
2967
-
2968
- return false;
2969
- }
2970
-
2971
- if(now - this.tm.last_autorefreshed >= this.data_update_every) {
2972
- if(this.debug === true)
2973
- this.log('canBeAutoRefreshed(): It is time to update me.');
2974
-
2975
- return true;
2976
- }
2977
- }
2978
- }
2979
-
2980
- return false;
2981
- };
2982
-
2983
- this.autoRefresh = function(callback) {
2984
- if(this.canBeAutoRefreshed() === true && this.running === false) {
2985
- var state = this;
2986
-
2987
- state.running = true;
2988
- state.updateChart(function() {
2989
- state.running = false;
2990
-
2991
- if(typeof callback !== 'undefined')
2992
- callback();
2993
- });
2994
- }
2995
- else {
2996
- if(typeof callback !== 'undefined')
2997
- callback();
2998
- }
2999
- };
3000
-
3001
- this._defaultsFromDownloadedChart = function(chart) {
3002
- this.chart = chart;
3003
- this.chart_url = chart.url;
3004
- this.data_update_every = chart.update_every * 1000;
3005
- this.data_points = Math.round(this.chartWidth() / this.chartPixelsPerPoint());
3006
- this.tm.last_info_downloaded = new Date().getTime();
3007
-
3008
- if(this.title === null)
3009
- this.title = chart.title;
3010
-
3011
- if(this.units === null)
3012
- this.units = chart.units;
3013
- };
3014
-
3015
- // fetch the chart description from the netdata server
3016
- this.getChart = function(callback) {
3017
- this.chart = NETDATA.chartRegistry.get(this.host, this.id);
3018
- if(this.chart) {
3019
- this._defaultsFromDownloadedChart(this.chart);
3020
- if(typeof callback === 'function') callback();
3021
- }
3022
- else {
3023
- this.chart_url = "/api/v1/chart?chart=" + this.id;
3024
-
3025
- if(this.debug === true)
3026
- this.log('downloading ' + this.chart_url);
3027
-
3028
- $.ajax( {
3029
- url: this.host + this.chart_url,
3030
- cache: false,
3031
- async: true,
3032
- xhrFields: { withCredentials: true } // required for the cookie
3033
- })
3034
- .done(function(chart) {
3035
- chart.url = that.chart_url;
3036
- that._defaultsFromDownloadedChart(chart);
3037
- NETDATA.chartRegistry.add(that.host, that.id, chart);
3038
- })
3039
- .fail(function() {
3040
- NETDATA.error(404, that.chart_url);
3041
- error('chart not found on url "' + that.chart_url + '"');
3042
- })
3043
- .always(function() {
3044
- if(typeof callback === 'function') callback();
3045
- });
3046
- }
3047
- };
3048
-
3049
- // ============================================================================================================
3050
- // INITIALIZATION
3051
-
3052
- init();
3053
- };
3054
-
3055
- NETDATA.resetAllCharts = function(state) {
3056
- // first clear the global selection sync
3057
- // to make sure no chart is in selected state
3058
- state.globalSelectionSyncStop();
3059
-
3060
- // there are 2 possibilities here
3061
- // a. state is the global Pan and Zoom master
3062
- // b. state is not the global Pan and Zoom master
3063
- var master = true;
3064
- if(NETDATA.globalPanAndZoom.isMaster(state) === false)
3065
- master = false;
3066
-
3067
- // clear the global Pan and Zoom
3068
- // this will also refresh the master
3069
- // and unblock any charts currently mirroring the master
3070
- NETDATA.globalPanAndZoom.clearMaster();
3071
-
3072
- // if we were not the master, reset our status too
3073
- // this is required because most probably the mouse
3074
- // is over this chart, blocking it from auto-refreshing
3075
- if(master === false && (state.paused === true || state.selected === true))
3076
- state.resetChart();
3077
- };
3078
-
3079
- // get or create a chart state, given a DOM element
3080
- NETDATA.chartState = function(element) {
3081
- var state = $(element).data('netdata-state-object') || null;
3082
- if(state === null) {
3083
- state = new chartState(element);
3084
- $(element).data('netdata-state-object', state);
3085
- }
3086
- return state;
3087
- };
3088
-
3089
- // ----------------------------------------------------------------------------------------------------------------
3090
- // Library functions
3091
-
3092
- // Load a script without jquery
3093
- // This is used to load jquery - after it is loaded, we use jquery
3094
- NETDATA._loadjQuery = function(callback) {
3095
- if(typeof jQuery === 'undefined') {
3096
- if(NETDATA.options.debug.main_loop === true)
3097
- console.log('loading ' + NETDATA.jQuery);
3098
-
3099
- var script = document.createElement('script');
3100
- script.type = 'text/javascript';
3101
- script.async = true;
3102
- script.src = NETDATA.jQuery;
3103
-
3104
- // script.onabort = onError;
3105
- script.onerror = function(err, t) { NETDATA.error(101, NETDATA.jQuery); };
3106
- if(typeof callback === "function")
3107
- script.onload = callback;
3108
-
3109
- var s = document.getElementsByTagName('script')[0];
3110
- s.parentNode.insertBefore(script, s);
3111
- }
3112
- else if(typeof callback === "function")
3113
- callback();
3114
- };
3115
-
3116
- NETDATA._loadCSS = function(filename) {
3117
- // don't use jQuery here
3118
- // styles are loaded before jQuery
3119
- // to eliminate showing an unstyled page to the user
3120
-
3121
- var fileref = document.createElement("link");
3122
- fileref.setAttribute("rel", "stylesheet");
3123
- fileref.setAttribute("type", "text/css");
3124
- fileref.setAttribute("href", filename);
3125
-
3126
- if (typeof fileref !== 'undefined')
3127
- document.getElementsByTagName("head")[0].appendChild(fileref);
3128
- };
3129
-
3130
- NETDATA.colorHex2Rgb = function(hex) {
3131
- // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
3132
- var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
3133
- hex = hex.replace(shorthandRegex, function(m, r, g, b) {
3134
- return r + r + g + g + b + b;
3135
- });
3136
-
3137
- var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
3138
- return result ? {
3139
- r: parseInt(result[1], 16),
3140
- g: parseInt(result[2], 16),
3141
- b: parseInt(result[3], 16)
3142
- } : null;
3143
- };
3144
-
3145
- NETDATA.colorLuminance = function(hex, lum) {
3146
- // validate hex string
3147
- hex = String(hex).replace(/[^0-9a-f]/gi, '');
3148
- if (hex.length < 6)
3149
- hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
3150
-
3151
- lum = lum || 0;
3152
-
3153
- // convert to decimal and change luminosity
3154
- var rgb = "#", c, i;
3155
- for (i = 0; i < 3; i++) {
3156
- c = parseInt(hex.substr(i*2,2), 16);
3157
- c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
3158
- rgb += ("00"+c).substr(c.length);
3159
- }
3160
-
3161
- return rgb;
3162
- };
3163
-
3164
- NETDATA.guid = function() {
3165
- function s4() {
3166
- return Math.floor((1 + Math.random()) * 0x10000)
3167
- .toString(16)
3168
- .substring(1);
3169
- }
3170
-
3171
- return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
3172
- };
3173
-
3174
- NETDATA.zeropad = function(x) {
3175
- if(x > -10 && x < 10) return '0' + x.toString();
3176
- else return x.toString();
3177
- };
3178
-
3179
- // user function to signal us the DOM has been
3180
- // updated.
3181
- NETDATA.updatedDom = function() {
3182
- NETDATA.options.updated_dom = true;
3183
- };
3184
-
3185
- NETDATA.ready = function(callback) {
3186
- NETDATA.options.pauseCallback = callback;
3187
- };
3188
-
3189
- NETDATA.pause = function(callback) {
3190
- if(NETDATA.options.pause === true)
3191
- callback();
3192
- else
3193
- NETDATA.options.pauseCallback = callback;
3194
- };
3195
-
3196
- NETDATA.unpause = function() {
3197
- NETDATA.options.pauseCallback = null;
3198
- NETDATA.options.updated_dom = true;
3199
- NETDATA.options.pause = false;
3200
- };
3201
-
3202
- // ----------------------------------------------------------------------------------------------------------------
3203
-
3204
- // this is purely sequencial charts refresher
3205
- // it is meant to be autonomous
3206
- NETDATA.chartRefresherNoParallel = function(index) {
3207
- if(NETDATA.options.debug.mail_loop === true)
3208
- console.log('NETDATA.chartRefresherNoParallel(' + index + ')');
3209
-
3210
- if(NETDATA.options.updated_dom === true) {
3211
- // the dom has been updated
3212
- // get the dom parts again
3213
- NETDATA.parseDom(NETDATA.chartRefresher);
3214
- return;
3215
- }
3216
- if(index >= NETDATA.options.targets.length) {
3217
- if(NETDATA.options.debug.main_loop === true)
3218
- console.log('waiting to restart main loop...');
3219
-
3220
- NETDATA.options.auto_refresher_fast_weight = 0;
3221
-
3222
- setTimeout(function() {
3223
- NETDATA.chartRefresher();
3224
- }, NETDATA.options.current.idle_between_loops);
3225
- }
3226
- else {
3227
- var state = NETDATA.options.targets[index];
3228
-
3229
- if(NETDATA.options.auto_refresher_fast_weight < NETDATA.options.current.fast_render_timeframe) {
3230
- if(NETDATA.options.debug.main_loop === true)
3231
- console.log('fast rendering...');
3232
-
3233
- state.autoRefresh(function() {
3234
- NETDATA.chartRefresherNoParallel(++index);
3235
- });
3236
- }
3237
- else {
3238
- if(NETDATA.options.debug.main_loop === true) console.log('waiting for next refresh...');
3239
- NETDATA.options.auto_refresher_fast_weight = 0;
3240
-
3241
- setTimeout(function() {
3242
- state.autoRefresh(function() {
3243
- NETDATA.chartRefresherNoParallel(++index);
3244
- });
3245
- }, NETDATA.options.current.idle_between_charts);
3246
- }
3247
- }
3248
- };
3249
-
3250
- // this is part of the parallel refresher
3251
- // its cause is to refresh sequencially all the charts
3252
- // that depend on chart library initialization
3253
- // it will call the parallel refresher back
3254
- // as soon as it sees a chart that its chart library
3255
- // is initialized
3256
- NETDATA.chartRefresher_uninitialized = function() {
3257
- if(NETDATA.options.updated_dom === true) {
3258
- // the dom has been updated
3259
- // get the dom parts again
3260
- NETDATA.parseDom(NETDATA.chartRefresher);
3261
- return;
3262
- }
3263
-
3264
- if(NETDATA.options.sequencial.length === 0)
3265
- NETDATA.chartRefresher();
3266
- else {
3267
- var state = NETDATA.options.sequencial.pop();
3268
- if(state.library.initialized === true)
3269
- NETDATA.chartRefresher();
3270
- else
3271
- state.autoRefresh(NETDATA.chartRefresher_uninitialized);
3272
- }
3273
- };
3274
-
3275
- NETDATA.chartRefresherWaitTime = function() {
3276
- return NETDATA.options.current.idle_parallel_loops;
3277
- };
3278
-
3279
- // the default refresher
3280
- // it will create 2 sets of charts:
3281
- // - the ones that can be refreshed in parallel
3282
- // - the ones that depend on something else
3283
- // the first set will be executed in parallel
3284
- // the second will be given to NETDATA.chartRefresher_uninitialized()
3285
- NETDATA.chartRefresher = function() {
3286
- if(NETDATA.options.pause === true) {
3287
- // console.log('auto-refresher is paused');
3288
- setTimeout(NETDATA.chartRefresher,
3289
- NETDATA.chartRefresherWaitTime());
3290
- return;
3291
- }
3292
-
3293
- if(typeof NETDATA.options.pauseCallback === 'function') {
3294
- // console.log('auto-refresher is calling pauseCallback');
3295
- NETDATA.options.pause = true;
3296
- NETDATA.options.pauseCallback();
3297
- NETDATA.chartRefresher();
3298
- return;
3299
- }
3300
-
3301
- if(NETDATA.options.current.parallel_refresher === false) {
3302
- NETDATA.chartRefresherNoParallel(0);
3303
- return;
3304
- }
3305
-
3306
- if(NETDATA.options.updated_dom === true) {
3307
- // the dom has been updated
3308
- // get the dom parts again
3309
- NETDATA.parseDom(NETDATA.chartRefresher);
3310
- return;
3311
- }
3312
-
3313
- var parallel = new Array();
3314
- var targets = NETDATA.options.targets;
3315
- var len = targets.length;
3316
- var state;
3317
- while(len--) {
3318
- state = targets[len];
3319
- if(state.isVisible() === false || state.running === true)
3320
- continue;
3321
-
3322
- if(state.library.initialized === false) {
3323
- if(state.library.enabled === true) {
3324
- state.library.initialize(NETDATA.chartRefresher);
3325
- return;
3326
- }
3327
- else {
3328
- state.error('chart library "' + state.library_name + '" is not enabled.');
3329
- }
3330
- }
3331
-
3332
- parallel.unshift(state);
3333
- }
3334
-
3335
- if(parallel.length > 0) {
3336
- // this will execute the jobs in parallel
3337
- $(parallel).each(function() {
3338
- this.autoRefresh();
3339
- })
3340
- }
3341
-
3342
- // run the next refresh iteration
3343
- setTimeout(NETDATA.chartRefresher,
3344
- NETDATA.chartRefresherWaitTime());
3345
- };
3346
-
3347
- NETDATA.parseDom = function(callback) {
3348
- NETDATA.options.last_page_scroll = new Date().getTime();
3349
- NETDATA.options.updated_dom = false;
3350
-
3351
- var targets = $('div[data-netdata]'); //.filter(':visible');
3352
-
3353
- if(NETDATA.options.debug.main_loop === true)
3354
- console.log('DOM updated - there are ' + targets.length + ' charts on page.');
3355
-
3356
- NETDATA.options.targets = new Array();
3357
- var len = targets.length;
3358
- while(len--) {
3359
- // the initialization will take care of sizing
3360
- // and the "loading..." message
3361
- NETDATA.options.targets.push(NETDATA.chartState(targets[len]));
3362
- }
3363
-
3364
- if(typeof callback === 'function') callback();
3365
- };
3366
-
3367
- // this is the main function - where everything starts
3368
- NETDATA.start = function() {
3369
- // this should be called only once
3370
-
3371
- NETDATA.options.page_is_visible = true;
3372
-
3373
- $(window).blur(function() {
3374
- if(NETDATA.options.current.stop_updates_when_focus_is_lost === true) {
3375
- NETDATA.options.page_is_visible = false;
3376
- if(NETDATA.options.debug.focus === true)
3377
- console.log('Lost Focus!');
3378
- }
3379
- });
3380
-
3381
- $(window).focus(function() {
3382
- if(NETDATA.options.current.stop_updates_when_focus_is_lost === true) {
3383
- NETDATA.options.page_is_visible = true;
3384
- if(NETDATA.options.debug.focus === true)
3385
- console.log('Focus restored!');
3386
- }
3387
- });
3388
-
3389
- if(typeof document.hasFocus === 'function' && !document.hasFocus()) {
3390
- if(NETDATA.options.current.stop_updates_when_focus_is_lost === true) {
3391
- NETDATA.options.page_is_visible = false;
3392
- if(NETDATA.options.debug.focus === true)
3393
- console.log('Document has no focus!');
3394
- }
3395
- }
3396
-
3397
- // bootstrap tab switching
3398
- $('a[data-toggle="tab"]').on('shown.bs.tab', NETDATA.onscroll);
3399
-
3400
- // bootstrap modal switching
3401
- $('.modal').on('hidden.bs.modal', NETDATA.onscroll);
3402
- $('.modal').on('shown.bs.modal', NETDATA.onscroll);
3403
-
3404
- // bootstrap collapse switching
3405
- $('.collapse').on('hidden.bs.collapse', NETDATA.onscroll);
3406
- $('.collapse').on('shown.bs.collapse', NETDATA.onscroll);
3407
-
3408
- NETDATA.parseDom(NETDATA.chartRefresher);
3409
-
3410
- // Registry initialization
3411
- setTimeout(NETDATA.registry.init, 1000);
3412
- };
3413
-
3414
- // ----------------------------------------------------------------------------------------------------------------
3415
- // peity
3416
-
3417
- NETDATA.peityInitialize = function(callback) {
3418
- if(typeof netdataNoPeitys === 'undefined' || !netdataNoPeitys) {
3419
- $.ajax({
3420
- url: NETDATA.peity_js,
3421
- cache: true,
3422
- dataType: "script",
3423
- xhrFields: { withCredentials: true } // required for the cookie
3424
- })
3425
- .done(function() {
3426
- NETDATA.registerChartLibrary('peity', NETDATA.peity_js);
3427
- })
3428
- .fail(function() {
3429
- NETDATA.chartLibraries.peity.enabled = false;
3430
- NETDATA.error(100, NETDATA.peity_js);
3431
- })
3432
- .always(function() {
3433
- if(typeof callback === "function")
3434
- callback();
3435
- });
3436
- }
3437
- else {
3438
- NETDATA.chartLibraries.peity.enabled = false;
3439
- if(typeof callback === "function")
3440
- callback();
3441
- }
3442
- };
3443
-
3444
- NETDATA.peityChartUpdate = function(state, data) {
3445
- state.peity_instance.innerHTML = data.result;
3446
-
3447
- if(state.peity_options.stroke !== state.chartColors()[0]) {
3448
- state.peity_options.stroke = state.chartColors()[0];
3449
- if(state.chart.chart_type === 'line')
3450
- state.peity_options.fill = NETDATA.themes.current.background;
3451
- else
3452
- state.peity_options.fill = NETDATA.colorLuminance(state.chartColors()[0], NETDATA.chartDefaults.fill_luminance);
3453
- }
3454
-
3455
- $(state.peity_instance).peity('line', state.peity_options);
3456
- return true;
3457
- };
3458
-
3459
- NETDATA.peityChartCreate = function(state, data) {
3460
- state.peity_instance = document.createElement('div');
3461
- state.element_chart.appendChild(state.peity_instance);
3462
-
3463
- var self = $(state.element);
3464
- state.peity_options = {
3465
- stroke: NETDATA.themes.current.foreground,
3466
- strokeWidth: self.data('peity-strokewidth') || 1,
3467
- width: state.chartWidth(),
3468
- height: state.chartHeight(),
3469
- fill: NETDATA.themes.current.foreground
3470
- };
3471
-
3472
- NETDATA.peityChartUpdate(state, data);
3473
- return true;
3474
- };
3475
-
3476
- // ----------------------------------------------------------------------------------------------------------------
3477
- // sparkline
3478
-
3479
- NETDATA.sparklineInitialize = function(callback) {
3480
- if(typeof netdataNoSparklines === 'undefined' || !netdataNoSparklines) {
3481
- $.ajax({
3482
- url: NETDATA.sparkline_js,
3483
- cache: true,
3484
- dataType: "script",
3485
- xhrFields: { withCredentials: true } // required for the cookie
3486
- })
3487
- .done(function() {
3488
- NETDATA.registerChartLibrary('sparkline', NETDATA.sparkline_js);
3489
- })
3490
- .fail(function() {
3491
- NETDATA.chartLibraries.sparkline.enabled = false;
3492
- NETDATA.error(100, NETDATA.sparkline_js);
3493
- })
3494
- .always(function() {
3495
- if(typeof callback === "function")
3496
- callback();
3497
- });
3498
- }
3499
- else {
3500
- NETDATA.chartLibraries.sparkline.enabled = false;
3501
- if(typeof callback === "function")
3502
- callback();
3503
- }
3504
- };
3505
-
3506
- NETDATA.sparklineChartUpdate = function(state, data) {
3507
- state.sparkline_options.width = state.chartWidth();
3508
- state.sparkline_options.height = state.chartHeight();
3509
-
3510
- $(state.element_chart).sparkline(data.result, state.sparkline_options);
3511
- return true;
3512
- };
3513
-
3514
- NETDATA.sparklineChartCreate = function(state, data) {
3515
- var self = $(state.element);
3516
- var type = self.data('sparkline-type') || 'line';
3517
- var lineColor = self.data('sparkline-linecolor') || state.chartColors()[0];
3518
- var fillColor = self.data('sparkline-fillcolor') || (state.chart.chart_type === 'line')?NETDATA.themes.current.background:NETDATA.colorLuminance(lineColor, NETDATA.chartDefaults.fill_luminance);
3519
- var chartRangeMin = self.data('sparkline-chartrangemin') || undefined;
3520
- var chartRangeMax = self.data('sparkline-chartrangemax') || undefined;
3521
- var composite = self.data('sparkline-composite') || undefined;
3522
- var enableTagOptions = self.data('sparkline-enabletagoptions') || undefined;
3523
- var tagOptionPrefix = self.data('sparkline-tagoptionprefix') || undefined;
3524
- var tagValuesAttribute = self.data('sparkline-tagvaluesattribute') || undefined;
3525
- var disableHiddenCheck = self.data('sparkline-disablehiddencheck') || undefined;
3526
- var defaultPixelsPerValue = self.data('sparkline-defaultpixelspervalue') || undefined;
3527
- var spotColor = self.data('sparkline-spotcolor') || undefined;
3528
- var minSpotColor = self.data('sparkline-minspotcolor') || undefined;
3529
- var maxSpotColor = self.data('sparkline-maxspotcolor') || undefined;
3530
- var spotRadius = self.data('sparkline-spotradius') || undefined;
3531
- var valueSpots = self.data('sparkline-valuespots') || undefined;
3532
- var highlightSpotColor = self.data('sparkline-highlightspotcolor') || undefined;
3533
- var highlightLineColor = self.data('sparkline-highlightlinecolor') || undefined;
3534
- var lineWidth = self.data('sparkline-linewidth') || undefined;
3535
- var normalRangeMin = self.data('sparkline-normalrangemin') || undefined;
3536
- var normalRangeMax = self.data('sparkline-normalrangemax') || undefined;
3537
- var drawNormalOnTop = self.data('sparkline-drawnormalontop') || undefined;
3538
- var xvalues = self.data('sparkline-xvalues') || undefined;
3539
- var chartRangeClip = self.data('sparkline-chartrangeclip') || undefined;
3540
- var chartRangeMinX = self.data('sparkline-chartrangeminx') || undefined;
3541
- var chartRangeMaxX = self.data('sparkline-chartrangemaxx') || undefined;
3542
- var disableInteraction = self.data('sparkline-disableinteraction') || false;
3543
- var disableTooltips = self.data('sparkline-disabletooltips') || false;
3544
- var disableHighlight = self.data('sparkline-disablehighlight') || false;
3545
- var highlightLighten = self.data('sparkline-highlightlighten') || 1.4;
3546
- var highlightColor = self.data('sparkline-highlightcolor') || undefined;
3547
- var tooltipContainer = self.data('sparkline-tooltipcontainer') || undefined;
3548
- var tooltipClassname = self.data('sparkline-tooltipclassname') || undefined;
3549
- var tooltipFormat = self.data('sparkline-tooltipformat') || undefined;
3550
- var tooltipPrefix = self.data('sparkline-tooltipprefix') || undefined;
3551
- var tooltipSuffix = self.data('sparkline-tooltipsuffix') || ' ' + state.units;
3552
- var tooltipSkipNull = self.data('sparkline-tooltipskipnull') || true;
3553
- var tooltipValueLookups = self.data('sparkline-tooltipvaluelookups') || undefined;
3554
- var tooltipFormatFieldlist = self.data('sparkline-tooltipformatfieldlist') || undefined;
3555
- var tooltipFormatFieldlistKey = self.data('sparkline-tooltipformatfieldlistkey') || undefined;
3556
- var numberFormatter = self.data('sparkline-numberformatter') || function(n){ return n.toFixed(2); };
3557
- var numberDigitGroupSep = self.data('sparkline-numberdigitgroupsep') || undefined;
3558
- var numberDecimalMark = self.data('sparkline-numberdecimalmark') || undefined;
3559
- var numberDigitGroupCount = self.data('sparkline-numberdigitgroupcount') || undefined;
3560
- var animatedZooms = self.data('sparkline-animatedzooms') || false;
3561
-
3562
- if(spotColor === 'disable') spotColor='';
3563
- if(minSpotColor === 'disable') minSpotColor='';
3564
- if(maxSpotColor === 'disable') maxSpotColor='';
3565
-
3566
- state.sparkline_options = {
3567
- type: type,
3568
- lineColor: lineColor,
3569
- fillColor: fillColor,
3570
- chartRangeMin: chartRangeMin,
3571
- chartRangeMax: chartRangeMax,
3572
- composite: composite,
3573
- enableTagOptions: enableTagOptions,
3574
- tagOptionPrefix: tagOptionPrefix,
3575
- tagValuesAttribute: tagValuesAttribute,
3576
- disableHiddenCheck: disableHiddenCheck,
3577
- defaultPixelsPerValue: defaultPixelsPerValue,
3578
- spotColor: spotColor,
3579
- minSpotColor: minSpotColor,
3580
- maxSpotColor: maxSpotColor,
3581
- spotRadius: spotRadius,
3582
- valueSpots: valueSpots,
3583
- highlightSpotColor: highlightSpotColor,
3584
- highlightLineColor: highlightLineColor,
3585
- lineWidth: lineWidth,
3586
- normalRangeMin: normalRangeMin,
3587
- normalRangeMax: normalRangeMax,
3588
- drawNormalOnTop: drawNormalOnTop,
3589
- xvalues: xvalues,
3590
- chartRangeClip: chartRangeClip,
3591
- chartRangeMinX: chartRangeMinX,
3592
- chartRangeMaxX: chartRangeMaxX,
3593
- disableInteraction: disableInteraction,
3594
- disableTooltips: disableTooltips,
3595
- disableHighlight: disableHighlight,
3596
- highlightLighten: highlightLighten,
3597
- highlightColor: highlightColor,
3598
- tooltipContainer: tooltipContainer,
3599
- tooltipClassname: tooltipClassname,
3600
- tooltipChartTitle: state.title,
3601
- tooltipFormat: tooltipFormat,
3602
- tooltipPrefix: tooltipPrefix,
3603
- tooltipSuffix: tooltipSuffix,
3604
- tooltipSkipNull: tooltipSkipNull,
3605
- tooltipValueLookups: tooltipValueLookups,
3606
- tooltipFormatFieldlist: tooltipFormatFieldlist,
3607
- tooltipFormatFieldlistKey: tooltipFormatFieldlistKey,
3608
- numberFormatter: numberFormatter,
3609
- numberDigitGroupSep: numberDigitGroupSep,
3610
- numberDecimalMark: numberDecimalMark,
3611
- numberDigitGroupCount: numberDigitGroupCount,
3612
- animatedZooms: animatedZooms,
3613
- width: state.chartWidth(),
3614
- height: state.chartHeight()
3615
- };
3616
-
3617
- $(state.element_chart).sparkline(data.result, state.sparkline_options);
3618
- return true;
3619
- };
3620
-
3621
- // ----------------------------------------------------------------------------------------------------------------
3622
- // dygraph
3623
-
3624
- NETDATA.dygraph = {
3625
- smooth: false
3626
- };
3627
-
3628
- NETDATA.dygraphToolboxPanAndZoom = function(state, after, before) {
3629
- if(after < state.netdata_first)
3630
- after = state.netdata_first;
3631
-
3632
- if(before > state.netdata_last)
3633
- before = state.netdata_last;
3634
-
3635
- state.setMode('zoom');
3636
- state.globalSelectionSyncStop();
3637
- state.globalSelectionSyncDelay();
3638
- state.dygraph_user_action = true;
3639
- state.dygraph_force_zoom = true;
3640
- state.updateChartPanOrZoom(after, before);
3641
- NETDATA.globalPanAndZoom.setMaster(state, after, before);
3642
- };
3643
-
3644
- NETDATA.dygraphSetSelection = function(state, t) {
3645
- if(typeof state.dygraph_instance !== 'undefined') {
3646
- var r = state.calculateRowForTime(t);
3647
- if(r !== -1)
3648
- state.dygraph_instance.setSelection(r);
3649
- else {
3650
- state.dygraph_instance.clearSelection();
3651
- state.legendShowUndefined();
3652
- }
3653
- }
3654
-
3655
- return true;
3656
- };
3657
-
3658
- NETDATA.dygraphClearSelection = function(state, t) {
3659
- if(typeof state.dygraph_instance !== 'undefined') {
3660
- state.dygraph_instance.clearSelection();
3661
- }
3662
- return true;
3663
- };
3664
-
3665
- NETDATA.dygraphSmoothInitialize = function(callback) {
3666
- $.ajax({
3667
- url: NETDATA.dygraph_smooth_js,
3668
- cache: true,
3669
- dataType: "script",
3670
- xhrFields: { withCredentials: true } // required for the cookie
3671
- })
3672
- .done(function() {
3673
- NETDATA.dygraph.smooth = true;
3674
- smoothPlotter.smoothing = 0.3;
3675
- })
3676
- .fail(function() {
3677
- NETDATA.dygraph.smooth = false;
3678
- })
3679
- .always(function() {
3680
- if(typeof callback === "function")
3681
- callback();
3682
- });
3683
- };
3684
-
3685
- NETDATA.dygraphInitialize = function(callback) {
3686
- if(typeof netdataNoDygraphs === 'undefined' || !netdataNoDygraphs) {
3687
- $.ajax({
3688
- url: NETDATA.dygraph_js,
3689
- cache: true,
3690
- dataType: "script",
3691
- xhrFields: { withCredentials: true } // required for the cookie
3692
- })
3693
- .done(function() {
3694
- NETDATA.registerChartLibrary('dygraph', NETDATA.dygraph_js);
3695
- })
3696
- .fail(function() {
3697
- NETDATA.chartLibraries.dygraph.enabled = false;
3698
- NETDATA.error(100, NETDATA.dygraph_js);
3699
- })
3700
- .always(function() {
3701
- if(NETDATA.chartLibraries.dygraph.enabled === true && NETDATA.options.current.smooth_plot === true)
3702
- NETDATA.dygraphSmoothInitialize(callback);
3703
- else if(typeof callback === "function")
3704
- callback();
3705
- });
3706
- }
3707
- else {
3708
- NETDATA.chartLibraries.dygraph.enabled = false;
3709
- if(typeof callback === "function")
3710
- callback();
3711
- }
3712
- };
3713
-
3714
- NETDATA.dygraphChartUpdate = function(state, data) {
3715
- var dygraph = state.dygraph_instance;
3716
-
3717
- if(typeof dygraph === 'undefined')
3718
- return NETDATA.dygraphChartCreate(state, data);
3719
-
3720
- // when the chart is not visible, and hidden
3721
- // if there is a window resize, dygraph detects
3722
- // its element size as 0x0.
3723
- // this will make it re-appear properly
3724
-
3725
- if(state.tm.last_unhidden > state.dygraph_last_rendered)
3726
- dygraph.resize();
3727
-
3728
- var options = {
3729
- file: data.result.data,
3730
- colors: state.chartColors(),
3731
- labels: data.result.labels,
3732
- labelsDivWidth: state.chartWidth() - 70,
3733
- visibility: state.dimensions_visibility.selected2BooleanArray(state.data.dimension_names)
3734
- };
3735
-
3736
- if(state.dygraph_force_zoom === true) {
3737
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3738
- state.log('dygraphChartUpdate() forced zoom update');
3739
-
3740
- options.dateWindow = (state.requested_padding !== null)?[ state.view_after, state.view_before ]:null;
3741
- options.valueRange = state.dygraph_options.valueRange;
3742
- options.isZoomedIgnoreProgrammaticZoom = true;
3743
- state.dygraph_force_zoom = false;
3744
- }
3745
- else if(state.current.name !== 'auto') {
3746
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3747
- state.log('dygraphChartUpdate() loose update');
3748
-
3749
- options.valueRange = state.dygraph_options.valueRange;
3750
- }
3751
- else {
3752
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3753
- state.log('dygraphChartUpdate() strict update');
3754
-
3755
- options.dateWindow = (state.requested_padding !== null)?[ state.view_after, state.view_before ]:null;
3756
- options.valueRange = state.dygraph_options.valueRange;
3757
- options.isZoomedIgnoreProgrammaticZoom = true;
3758
- }
3759
-
3760
- if(state.dygraph_smooth_eligible === true) {
3761
- if((NETDATA.options.current.smooth_plot === true && state.dygraph_options.plotter !== smoothPlotter)
3762
- || (NETDATA.options.current.smooth_plot === false && state.dygraph_options.plotter === smoothPlotter)) {
3763
- NETDATA.dygraphChartCreate(state, data);
3764
- return;
3765
- }
3766
- }
3767
-
3768
- dygraph.updateOptions(options);
3769
-
3770
- state.dygraph_last_rendered = new Date().getTime();
3771
- return true;
3772
- };
3773
-
3774
- NETDATA.dygraphChartCreate = function(state, data) {
3775
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3776
- state.log('dygraphChartCreate()');
3777
-
3778
- var self = $(state.element);
3779
-
3780
- var chart_type = state.chart.chart_type;
3781
- if(chart_type === 'stacked' && data.dimensions === 1) chart_type = 'area';
3782
- chart_type = self.data('dygraph-type') || chart_type;
3783
-
3784
- var smooth = (chart_type === 'line' && !NETDATA.chartLibraries.dygraph.isSparkline(state))?true:false;
3785
- smooth = self.data('dygraph-smooth') || smooth;
3786
-
3787
- if(NETDATA.dygraph.smooth === false)
3788
- smooth = false;
3789
-
3790
- var strokeWidth = (chart_type === 'stacked')?0.1:((smooth)?1.5:0.7)
3791
- var highlightCircleSize = (NETDATA.chartLibraries.dygraph.isSparkline(state))?3:4;
3792
-
3793
- state.dygraph_options = {
3794
- colors: self.data('dygraph-colors') || state.chartColors(),
3795
-
3796
- // leave a few pixels empty on the right of the chart
3797
- rightGap: self.data('dygraph-rightgap') || 5,
3798
- showRangeSelector: self.data('dygraph-showrangeselector') || false,
3799
- showRoller: self.data('dygraph-showroller') || false,
3800
-
3801
- title: self.data('dygraph-title') || state.title,
3802
- titleHeight: self.data('dygraph-titleheight') || 19,
3803
-
3804
- legend: self.data('dygraph-legend') || 'always', // 'onmouseover',
3805
- labels: data.result.labels,
3806
- labelsDiv: self.data('dygraph-labelsdiv') || state.element_legend_childs.hidden,
3807
- labelsDivStyles: self.data('dygraph-labelsdivstyles') || { 'fontSize':'1px' },
3808
- labelsDivWidth: self.data('dygraph-labelsdivwidth') || state.chartWidth() - 70,
3809
- labelsSeparateLines: self.data('dygraph-labelsseparatelines') || true,
3810
- labelsShowZeroValues: self.data('dygraph-labelsshowzerovalues') || true,
3811
- labelsKMB: false,
3812
- labelsKMG2: false,
3813
- showLabelsOnHighlight: self.data('dygraph-showlabelsonhighlight') || true,
3814
- hideOverlayOnMouseOut: self.data('dygraph-hideoverlayonmouseout') || true,
3815
-
3816
- includeZero: self.data('dygraph-includezero') || false,
3817
- xRangePad: self.data('dygraph-xrangepad') || 0,
3818
- yRangePad: self.data('dygraph-yrangepad') || 1,
3819
-
3820
- valueRange: self.data('dygraph-valuerange') || null,
3821
-
3822
- ylabel: state.units,
3823
- yLabelWidth: self.data('dygraph-ylabelwidth') || 12,
3824
-
3825
- // the function to plot the chart
3826
- plotter: null,
3827
-
3828
- // The width of the lines connecting data points. This can be used to increase the contrast or some graphs.
3829
- strokeWidth: self.data('dygraph-strokewidth') || strokeWidth,
3830
- strokePattern: self.data('dygraph-strokepattern') || undefined,
3831
-
3832
- // The size of the dot to draw on each point in pixels (see drawPoints). A dot is always drawn when a point is "isolated",
3833
- // i.e. there is a missing point on either side of it. This also controls the size of those dots.
3834
- drawPoints: self.data('dygraph-drawpoints') || false,
3835
-
3836
- // Draw points at the edges of gaps in the data. This improves visibility of small data segments or other data irregularities.
3837
- drawGapEdgePoints: self.data('dygraph-drawgapedgepoints') || true,
3838
-
3839
- connectSeparatedPoints: self.data('dygraph-connectseparatedpoints') || false,
3840
- pointSize: self.data('dygraph-pointsize') || 1,
3841
-
3842
- // enabling this makes the chart with little square lines
3843
- stepPlot: self.data('dygraph-stepplot') || false,
3844
-
3845
- // Draw a border around graph lines to make crossing lines more easily distinguishable. Useful for graphs with many lines.
3846
- strokeBorderColor: self.data('dygraph-strokebordercolor') || NETDATA.themes.current.background,
3847
- strokeBorderWidth: self.data('dygraph-strokeborderwidth') || (chart_type === 'stacked')?0.0:0.0,
3848
-
3849
- fillGraph: self.data('dygraph-fillgraph') || (chart_type === 'area' || chart_type === 'stacked')?true:false,
3850
- fillAlpha: self.data('dygraph-fillalpha') || (chart_type === 'stacked')?NETDATA.options.current.color_fill_opacity_stacked:NETDATA.options.current.color_fill_opacity_area,
3851
- stackedGraph: self.data('dygraph-stackedgraph') || (chart_type === 'stacked')?true:false,
3852
- stackedGraphNaNFill: self.data('dygraph-stackedgraphnanfill') || 'none',
3853
-
3854
- drawAxis: self.data('dygraph-drawaxis') || true,
3855
- axisLabelFontSize: self.data('dygraph-axislabelfontsize') || 10,
3856
- axisLineColor: self.data('dygraph-axislinecolor') || NETDATA.themes.current.axis,
3857
- axisLineWidth: self.data('dygraph-axislinewidth') || 0.3,
3858
-
3859
- drawGrid: self.data('dygraph-drawgrid') || true,
3860
- drawXGrid: self.data('dygraph-drawxgrid') || undefined,
3861
- drawYGrid: self.data('dygraph-drawygrid') || undefined,
3862
- gridLinePattern: self.data('dygraph-gridlinepattern') || null,
3863
- gridLineWidth: self.data('dygraph-gridlinewidth') || 0.3,
3864
- gridLineColor: self.data('dygraph-gridlinecolor') || NETDATA.themes.current.grid,
3865
-
3866
- maxNumberWidth: self.data('dygraph-maxnumberwidth') || 8,
3867
- sigFigs: self.data('dygraph-sigfigs') || null,
3868
- digitsAfterDecimal: self.data('dygraph-digitsafterdecimal') || 2,
3869
- valueFormatter: self.data('dygraph-valueformatter') || function(x){ return x.toFixed(2); },
3870
-
3871
- highlightCircleSize: self.data('dygraph-highlightcirclesize') || highlightCircleSize,
3872
- highlightSeriesOpts: self.data('dygraph-highlightseriesopts') || null, // TOO SLOW: { strokeWidth: 1.5 },
3873
- highlightSeriesBackgroundAlpha: self.data('dygraph-highlightseriesbackgroundalpha') || null, // TOO SLOW: (chart_type === 'stacked')?0.7:0.5,
3874
-
3875
- pointClickCallback: self.data('dygraph-pointclickcallback') || undefined,
3876
- visibility: state.dimensions_visibility.selected2BooleanArray(state.data.dimension_names),
3877
- axes: {
3878
- x: {
3879
- pixelsPerLabel: 50,
3880
- ticker: Dygraph.dateTicker,
3881
- axisLabelFormatter: function (d, gran) {
3882
- return NETDATA.zeropad(d.getHours()) + ":" + NETDATA.zeropad(d.getMinutes()) + ":" + NETDATA.zeropad(d.getSeconds());
3883
- },
3884
- valueFormatter: function (ms) {
3885
- var d = new Date(ms);
3886
- return d.toLocaleDateString() + ' ' + d.toLocaleTimeString();
3887
- // return NETDATA.zeropad(d.getHours()) + ":" + NETDATA.zeropad(d.getMinutes()) + ":" + NETDATA.zeropad(d.getSeconds());
3888
- }
3889
- },
3890
- y: {
3891
- pixelsPerLabel: 15,
3892
- valueFormatter: function (x) {
3893
- // we format legends with the state object
3894
- // no need to do anything here
3895
- // return (Math.round(x*100) / 100).toLocaleString();
3896
- // return state.legendFormatValue(x);
3897
- return x;
3898
- }
3899
- }
3900
- },
3901
- legendFormatter: function(data) {
3902
- var elements = state.element_legend_childs;
3903
-
3904
- // if the hidden div is not there
3905
- // we are not managing the legend
3906
- if(elements.hidden === null) return;
3907
-
3908
- if (typeof data.x !== 'undefined') {
3909
- state.legendSetDate(data.x);
3910
- var i = data.series.length;
3911
- while(i--) {
3912
- var series = data.series[i];
3913
- if(!series.isVisible) continue;
3914
- state.legendSetLabelValue(series.label, series.y);
3915
- }
3916
- }
3917
-
3918
- return '';
3919
- },
3920
- drawCallback: function(dygraph, is_initial) {
3921
- if(state.current.name !== 'auto' && state.dygraph_user_action === true) {
3922
- state.dygraph_user_action = false;
3923
-
3924
- var x_range = dygraph.xAxisRange();
3925
- var after = Math.round(x_range[0]);
3926
- var before = Math.round(x_range[1]);
3927
-
3928
- if(NETDATA.options.debug.dygraph === true)
3929
- state.log('dygraphDrawCallback(dygraph, ' + is_initial + '): ' + (after / 1000).toString() + ' - ' + (before / 1000).toString());
3930
-
3931
- if(before <= state.netdata_last && after >= state.netdata_first)
3932
- state.updateChartPanOrZoom(after, before);
3933
- }
3934
- },
3935
- zoomCallback: function(minDate, maxDate, yRanges) {
3936
- if(NETDATA.options.debug.dygraph === true)
3937
- state.log('dygraphZoomCallback()');
3938
-
3939
- state.globalSelectionSyncStop();
3940
- state.globalSelectionSyncDelay();
3941
- state.setMode('zoom');
3942
-
3943
- // refresh it to the greatest possible zoom level
3944
- state.dygraph_user_action = true;
3945
- state.dygraph_force_zoom = true;
3946
- state.updateChartPanOrZoom(minDate, maxDate);
3947
- },
3948
- highlightCallback: function(event, x, points, row, seriesName) {
3949
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3950
- state.log('dygraphHighlightCallback()');
3951
-
3952
- state.pauseChart();
3953
-
3954
- // there is a bug in dygraph when the chart is zoomed enough
3955
- // the time it thinks is selected is wrong
3956
- // here we calculate the time t based on the row number selected
3957
- // which is ok
3958
- var t = state.data_after + row * state.data_update_every;
3959
- // console.log('row = ' + row + ', x = ' + x + ', t = ' + t + ' ' + ((t === x)?'SAME':(Math.abs(x-t)<=state.data_update_every)?'SIMILAR':'DIFFERENT') + ', rows in db: ' + state.data_points + ' visible(x) = ' + state.timeIsVisible(x) + ' visible(t) = ' + state.timeIsVisible(t) + ' r(x) = ' + state.calculateRowForTime(x) + ' r(t) = ' + state.calculateRowForTime(t) + ' range: ' + state.data_after + ' - ' + state.data_before + ' real: ' + state.data.after + ' - ' + state.data.before + ' every: ' + state.data_update_every);
3960
-
3961
- state.globalSelectionSync(x);
3962
-
3963
- // fix legend zIndex using the internal structures of dygraph legend module
3964
- // this works, but it is a hack!
3965
- // state.dygraph_instance.plugins_[0].plugin.legend_div_.style.zIndex = 10000;
3966
- },
3967
- unhighlightCallback: function(event) {
3968
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3969
- state.log('dygraphUnhighlightCallback()');
3970
-
3971
- state.unpauseChart();
3972
- state.globalSelectionSyncStop();
3973
- },
3974
- interactionModel : {
3975
- mousedown: function(event, dygraph, context) {
3976
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
3977
- state.log('interactionModel.mousedown()');
3978
-
3979
- state.dygraph_user_action = true;
3980
- state.globalSelectionSyncStop();
3981
-
3982
- if(NETDATA.options.debug.dygraph === true)
3983
- state.log('dygraphMouseDown()');
3984
-
3985
- // Right-click should not initiate a zoom.
3986
- if(event.button && event.button === 2) return;
3987
-
3988
- context.initializeMouseDown(event, dygraph, context);
3989
-
3990
- if(event.button && event.button === 1) {
3991
- if (event.altKey || event.shiftKey) {
3992
- state.setMode('pan');
3993
- state.globalSelectionSyncDelay();
3994
- Dygraph.startPan(event, dygraph, context);
3995
- }
3996
- else {
3997
- state.setMode('zoom');
3998
- state.globalSelectionSyncDelay();
3999
- Dygraph.startZoom(event, dygraph, context);
4000
- }
4001
- }
4002
- else {
4003
- if (event.altKey || event.shiftKey) {
4004
- state.setMode('zoom');
4005
- state.globalSelectionSyncDelay();
4006
- Dygraph.startZoom(event, dygraph, context);
4007
- }
4008
- else {
4009
- state.setMode('pan');
4010
- state.globalSelectionSyncDelay();
4011
- Dygraph.startPan(event, dygraph, context);
4012
- }
4013
- }
4014
- },
4015
- mousemove: function(event, dygraph, context) {
4016
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4017
- state.log('interactionModel.mousemove()');
4018
-
4019
- if(context.isPanning) {
4020
- state.dygraph_user_action = true;
4021
- state.globalSelectionSyncStop();
4022
- state.globalSelectionSyncDelay();
4023
- state.setMode('pan');
4024
- Dygraph.movePan(event, dygraph, context);
4025
- }
4026
- else if(context.isZooming) {
4027
- state.dygraph_user_action = true;
4028
- state.globalSelectionSyncStop();
4029
- state.globalSelectionSyncDelay();
4030
- state.setMode('zoom');
4031
- Dygraph.moveZoom(event, dygraph, context);
4032
- }
4033
- },
4034
- mouseup: function(event, dygraph, context) {
4035
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4036
- state.log('interactionModel.mouseup()');
4037
-
4038
- if (context.isPanning) {
4039
- state.dygraph_user_action = true;
4040
- state.globalSelectionSyncDelay();
4041
- Dygraph.endPan(event, dygraph, context);
4042
- }
4043
- else if (context.isZooming) {
4044
- state.dygraph_user_action = true;
4045
- state.globalSelectionSyncDelay();
4046
- Dygraph.endZoom(event, dygraph, context);
4047
- }
4048
- },
4049
- click: function(event, dygraph, context) {
4050
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4051
- state.log('interactionModel.click()');
4052
-
4053
- event.preventDefault();
4054
- },
4055
- dblclick: function(event, dygraph, context) {
4056
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4057
- state.log('interactionModel.dblclick()');
4058
- NETDATA.resetAllCharts(state);
4059
- },
4060
- mousewheel: function(event, dygraph, context) {
4061
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4062
- state.log('interactionModel.mousewheel()');
4063
-
4064
- // Take the offset of a mouse event on the dygraph canvas and
4065
- // convert it to a pair of percentages from the bottom left.
4066
- // (Not top left, bottom is where the lower value is.)
4067
- function offsetToPercentage(g, offsetX, offsetY) {
4068
- // This is calculating the pixel offset of the leftmost date.
4069
- var xOffset = g.toDomCoords(g.xAxisRange()[0], null)[0];
4070
- var yar0 = g.yAxisRange(0);
4071
-
4072
- // This is calculating the pixel of the higest value. (Top pixel)
4073
- var yOffset = g.toDomCoords(null, yar0[1])[1];
4074
-
4075
- // x y w and h are relative to the corner of the drawing area,
4076
- // so that the upper corner of the drawing area is (0, 0).
4077
- var x = offsetX - xOffset;
4078
- var y = offsetY - yOffset;
4079
-
4080
- // This is computing the rightmost pixel, effectively defining the
4081
- // width.
4082
- var w = g.toDomCoords(g.xAxisRange()[1], null)[0] - xOffset;
4083
-
4084
- // This is computing the lowest pixel, effectively defining the height.
4085
- var h = g.toDomCoords(null, yar0[0])[1] - yOffset;
4086
-
4087
- // Percentage from the left.
4088
- var xPct = w === 0 ? 0 : (x / w);
4089
- // Percentage from the top.
4090
- var yPct = h === 0 ? 0 : (y / h);
4091
-
4092
- // The (1-) part below changes it from "% distance down from the top"
4093
- // to "% distance up from the bottom".
4094
- return [xPct, (1-yPct)];
4095
- }
4096
-
4097
- // Adjusts [x, y] toward each other by zoomInPercentage%
4098
- // Split it so the left/bottom axis gets xBias/yBias of that change and
4099
- // tight/top gets (1-xBias)/(1-yBias) of that change.
4100
- //
4101
- // If a bias is missing it splits it down the middle.
4102
- function zoomRange(g, zoomInPercentage, xBias, yBias) {
4103
- xBias = xBias || 0.5;
4104
- yBias = yBias || 0.5;
4105
-
4106
- function adjustAxis(axis, zoomInPercentage, bias) {
4107
- var delta = axis[1] - axis[0];
4108
- var increment = delta * zoomInPercentage;
4109
- var foo = [increment * bias, increment * (1-bias)];
4110
-
4111
- return [ axis[0] + foo[0], axis[1] - foo[1] ];
4112
- }
4113
-
4114
- var yAxes = g.yAxisRanges();
4115
- var newYAxes = [];
4116
- for (var i = 0; i < yAxes.length; i++) {
4117
- newYAxes[i] = adjustAxis(yAxes[i], zoomInPercentage, yBias);
4118
- }
4119
-
4120
- return adjustAxis(g.xAxisRange(), zoomInPercentage, xBias);
4121
- }
4122
-
4123
- if(event.altKey || event.shiftKey) {
4124
- state.dygraph_user_action = true;
4125
-
4126
- state.globalSelectionSyncStop();
4127
- state.globalSelectionSyncDelay();
4128
-
4129
- // http://dygraphs.com/gallery/interaction-api.js
4130
- var normal = (event.detail) ? event.detail * -1 : event.wheelDelta / 40;
4131
- var percentage = normal / 50;
4132
-
4133
- if (!(event.offsetX && event.offsetY)){
4134
- event.offsetX = event.layerX - event.target.offsetLeft;
4135
- event.offsetY = event.layerY - event.target.offsetTop;
4136
- }
4137
-
4138
- var percentages = offsetToPercentage(dygraph, event.offsetX, event.offsetY);
4139
- var xPct = percentages[0];
4140
- var yPct = percentages[1];
4141
-
4142
- var new_x_range = zoomRange(dygraph, percentage, xPct, yPct);
4143
-
4144
- var after = new_x_range[0];
4145
- var before = new_x_range[1];
4146
-
4147
- var first = state.netdata_first + state.data_update_every;
4148
- var last = state.netdata_last + state.data_update_every;
4149
-
4150
- if(before > last) {
4151
- after -= (before - last);
4152
- before = last;
4153
- }
4154
- if(after < first) {
4155
- after = first;
4156
- }
4157
-
4158
- state.setMode('zoom');
4159
- if(state.updateChartPanOrZoom(after, before) === true)
4160
- dygraph.updateOptions({ dateWindow: [ after, before ] });
4161
-
4162
- event.preventDefault();
4163
- }
4164
- },
4165
- touchstart: function(event, dygraph, context) {
4166
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4167
- state.log('interactionModel.touchstart()');
4168
-
4169
- state.dygraph_user_action = true;
4170
- state.setMode('zoom');
4171
- state.pauseChart();
4172
-
4173
- Dygraph.defaultInteractionModel.touchstart(event, dygraph, context);
4174
-
4175
- // we overwrite the touch directions at the end, to overwrite
4176
- // the internal default of dygraphs
4177
- context.touchDirections = { x: true, y: false };
4178
-
4179
- state.dygraph_last_touch_start = new Date().getTime();
4180
- state.dygraph_last_touch_move = 0;
4181
-
4182
- if(typeof event.touches[0].pageX === 'number')
4183
- state.dygraph_last_touch_page_x = event.touches[0].pageX;
4184
- else
4185
- state.dygraph_last_touch_page_x = 0;
4186
- },
4187
- touchmove: function(event, dygraph, context) {
4188
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4189
- state.log('interactionModel.touchmove()');
4190
-
4191
- state.dygraph_user_action = true;
4192
- Dygraph.defaultInteractionModel.touchmove(event, dygraph, context);
4193
-
4194
- state.dygraph_last_touch_move = new Date().getTime();
4195
- },
4196
- touchend: function(event, dygraph, context) {
4197
- if(NETDATA.options.debug.dygraph === true || state.debug === true)
4198
- state.log('interactionModel.touchend()');
4199
-
4200
- state.dygraph_user_action = true;
4201
- Dygraph.defaultInteractionModel.touchend(event, dygraph, context);
4202
-
4203
- // if it didn't move, it is a selection
4204
- if(state.dygraph_last_touch_move === 0 && state.dygraph_last_touch_page_x !== 0) {
4205
- // internal api of dygraphs
4206
- var pct = (state.dygraph_last_touch_page_x - (dygraph.plotter_.area.x + state.element.getBoundingClientRect().left)) / dygraph.plotter_.area.w;
4207
- var t = Math.round(state.data_after + (state.data_before - state.data_after) * pct);
4208
- if(NETDATA.dygraphSetSelection(state, t) === true)
4209
- state.globalSelectionSync(t);
4210
- }
4211
-
4212
- // if it was double tap within double click time, reset the charts
4213
- var now = new Date().getTime();
4214
- if(typeof state.dygraph_last_touch_end !== 'undefined') {
4215
- if(state.dygraph_last_touch_move === 0) {
4216
- var dt = now - state.dygraph_last_touch_end;
4217
- if(dt <= NETDATA.options.current.double_click_speed)
4218
- NETDATA.resetAllCharts(state);
4219
- }
4220
- }
4221
-
4222
- // remember the timestamp of the last touch end
4223
- state.dygraph_last_touch_end = now;
4224
- }
4225
- }
4226
- };
4227
-
4228
- if(NETDATA.chartLibraries.dygraph.isSparkline(state)) {
4229
- state.dygraph_options.drawGrid = false;
4230
- state.dygraph_options.drawAxis = false;
4231
- state.dygraph_options.title = undefined;
4232
- state.dygraph_options.units = undefined;
4233
- state.dygraph_options.ylabel = undefined;
4234
- state.dygraph_options.yLabelWidth = 0;
4235
- state.dygraph_options.labelsDivWidth = 120;
4236
- state.dygraph_options.labelsDivStyles.width = '120px';
4237
- state.dygraph_options.labelsSeparateLines = true;
4238
- state.dygraph_options.rightGap = 0;
4239
- state.dygraph_options.yRangePad = 1;
4240
- }
4241
-
4242
- if(smooth === true) {
4243
- state.dygraph_smooth_eligible = true;
4244
-
4245
- if(NETDATA.options.current.smooth_plot === true)
4246
- state.dygraph_options.plotter = smoothPlotter;
4247
- }
4248
- else state.dygraph_smooth_eligible = false;
4249
-
4250
- state.dygraph_instance = new Dygraph(state.element_chart,
4251
- data.result.data, state.dygraph_options);
4252
-
4253
- state.dygraph_force_zoom = false;
4254
- state.dygraph_user_action = false;
4255
- state.dygraph_last_rendered = new Date().getTime();
4256
- return true;
4257
- };
4258
-
4259
- // ----------------------------------------------------------------------------------------------------------------
4260
- // morris
4261
-
4262
- NETDATA.morrisInitialize = function(callback) {
4263
- if(typeof netdataNoMorris === 'undefined' || !netdataNoMorris) {
4264
-
4265
- // morris requires raphael
4266
- if(!NETDATA.chartLibraries.raphael.initialized) {
4267
- if(NETDATA.chartLibraries.raphael.enabled) {
4268
- NETDATA.raphaelInitialize(function() {
4269
- NETDATA.morrisInitialize(callback);
4270
- });
4271
- }
4272
- else {
4273
- NETDATA.chartLibraries.morris.enabled = false;
4274
- if(typeof callback === "function")
4275
- callback();
4276
- }
4277
- }
4278
- else {
4279
- NETDATA._loadCSS(NETDATA.morris_css);
4280
-
4281
- $.ajax({
4282
- url: NETDATA.morris_js,
4283
- cache: true,
4284
- dataType: "script",
4285
- xhrFields: { withCredentials: true } // required for the cookie
4286
- })
4287
- .done(function() {
4288
- NETDATA.registerChartLibrary('morris', NETDATA.morris_js);
4289
- })
4290
- .fail(function() {
4291
- NETDATA.chartLibraries.morris.enabled = false;
4292
- NETDATA.error(100, NETDATA.morris_js);
4293
- })
4294
- .always(function() {
4295
- if(typeof callback === "function")
4296
- callback();
4297
- });
4298
- }
4299
- }
4300
- else {
4301
- NETDATA.chartLibraries.morris.enabled = false;
4302
- if(typeof callback === "function")
4303
- callback();
4304
- }
4305
- };
4306
-
4307
- NETDATA.morrisChartUpdate = function(state, data) {
4308
- state.morris_instance.setData(data.result.data);
4309
- return true;
4310
- };
4311
-
4312
- NETDATA.morrisChartCreate = function(state, data) {
4313
-
4314
- state.morris_options = {
4315
- element: state.element_chart.id,
4316
- data: data.result.data,
4317
- xkey: 'time',
4318
- ykeys: data.dimension_names,
4319
- labels: data.dimension_names,
4320
- lineWidth: 2,
4321
- pointSize: 3,
4322
- smooth: true,
4323
- hideHover: 'auto',
4324
- parseTime: true,
4325
- continuousLine: false,
4326
- behaveLikeLine: false
4327
- };
4328
-
4329
- if(state.chart.chart_type === 'line')
4330
- state.morris_instance = new Morris.Line(state.morris_options);
4331
-
4332
- else if(state.chart.chart_type === 'area') {
4333
- state.morris_options.behaveLikeLine = true;
4334
- state.morris_instance = new Morris.Area(state.morris_options);
4335
- }
4336
- else // stacked
4337
- state.morris_instance = new Morris.Area(state.morris_options);
4338
-
4339
- return true;
4340
- };
4341
-
4342
- // ----------------------------------------------------------------------------------------------------------------
4343
- // raphael
4344
-
4345
- NETDATA.raphaelInitialize = function(callback) {
4346
- if(typeof netdataStopRaphael === 'undefined' || !netdataStopRaphael) {
4347
- $.ajax({
4348
- url: NETDATA.raphael_js,
4349
- cache: true,
4350
- dataType: "script",
4351
- xhrFields: { withCredentials: true } // required for the cookie
4352
- })
4353
- .done(function() {
4354
- NETDATA.registerChartLibrary('raphael', NETDATA.raphael_js);
4355
- })
4356
- .fail(function() {
4357
- NETDATA.chartLibraries.raphael.enabled = false;
4358
- NETDATA.error(100, NETDATA.raphael_js);
4359
- })
4360
- .always(function() {
4361
- if(typeof callback === "function")
4362
- callback();
4363
- });
4364
- }
4365
- else {
4366
- NETDATA.chartLibraries.raphael.enabled = false;
4367
- if(typeof callback === "function")
4368
- callback();
4369
- }
4370
- };
4371
-
4372
- NETDATA.raphaelChartUpdate = function(state, data) {
4373
- $(state.element_chart).raphael(data.result, {
4374
- width: state.chartWidth(),
4375
- height: state.chartHeight()
4376
- });
4377
-
4378
- return false;
4379
- };
4380
-
4381
- NETDATA.raphaelChartCreate = function(state, data) {
4382
- $(state.element_chart).raphael(data.result, {
4383
- width: state.chartWidth(),
4384
- height: state.chartHeight()
4385
- });
4386
-
4387
- return false;
4388
- };
4389
-
4390
- // ----------------------------------------------------------------------------------------------------------------
4391
- // C3
4392
-
4393
- NETDATA.c3Initialize = function(callback) {
4394
- if(typeof netdataNoC3 === 'undefined' || !netdataNoC3) {
4395
-
4396
- // C3 requires D3
4397
- if(!NETDATA.chartLibraries.d3.initialized) {
4398
- if(NETDATA.chartLibraries.d3.enabled) {
4399
- NETDATA.d3Initialize(function() {
4400
- NETDATA.c3Initialize(callback);
4401
- });
4402
- }
4403
- else {
4404
- NETDATA.chartLibraries.c3.enabled = false;
4405
- if(typeof callback === "function")
4406
- callback();
4407
- }
4408
- }
4409
- else {
4410
- NETDATA._loadCSS(NETDATA.c3_css);
4411
-
4412
- $.ajax({
4413
- url: NETDATA.c3_js,
4414
- cache: true,
4415
- dataType: "script",
4416
- xhrFields: { withCredentials: true } // required for the cookie
4417
- })
4418
- .done(function() {
4419
- NETDATA.registerChartLibrary('c3', NETDATA.c3_js);
4420
- })
4421
- .fail(function() {
4422
- NETDATA.chartLibraries.c3.enabled = false;
4423
- NETDATA.error(100, NETDATA.c3_js);
4424
- })
4425
- .always(function() {
4426
- if(typeof callback === "function")
4427
- callback();
4428
- });
4429
- }
4430
- }
4431
- else {
4432
- NETDATA.chartLibraries.c3.enabled = false;
4433
- if(typeof callback === "function")
4434
- callback();
4435
- }
4436
- };
4437
-
4438
- NETDATA.c3ChartUpdate = function(state, data) {
4439
- state.c3_instance.destroy();
4440
- return NETDATA.c3ChartCreate(state, data);
4441
-
4442
- //state.c3_instance.load({
4443
- // rows: data.result,
4444
- // unload: true
4445
- //});
4446
-
4447
- //return true;
4448
- };
4449
-
4450
- NETDATA.c3ChartCreate = function(state, data) {
4451
-
4452
- state.element_chart.id = 'c3-' + state.uuid;
4453
- // console.log('id = ' + state.element_chart.id);
4454
-
4455
- state.c3_instance = c3.generate({
4456
- bindto: '#' + state.element_chart.id,
4457
- size: {
4458
- width: state.chartWidth(),
4459
- height: state.chartHeight()
4460
- },
4461
- color: {
4462
- pattern: state.chartColors()
4463
- },
4464
- data: {
4465
- x: 'time',
4466
- rows: data.result,
4467
- type: (state.chart.chart_type === 'line')?'spline':'area-spline'
4468
- },
4469
- axis: {
4470
- x: {
4471
- type: 'timeseries',
4472
- tick: {
4473
- format: function(x) {
4474
- return NETDATA.zeropad(x.getHours()) + ":" + NETDATA.zeropad(x.getMinutes()) + ":" + NETDATA.zeropad(x.getSeconds());
4475
- }
4476
- }
4477
- }
4478
- },
4479
- grid: {
4480
- x: {
4481
- show: true
4482
- },
4483
- y: {
4484
- show: true
4485
- }
4486
- },
4487
- point: {
4488
- show: false
4489
- },
4490
- line: {
4491
- connectNull: false
4492
- },
4493
- transition: {
4494
- duration: 0
4495
- },
4496
- interaction: {
4497
- enabled: true
4498
- }
4499
- });
4500
-
4501
- // console.log(state.c3_instance);
4502
-
4503
- return true;
4504
- };
4505
-
4506
- // ----------------------------------------------------------------------------------------------------------------
4507
- // D3
4508
-
4509
- NETDATA.d3Initialize = function(callback) {
4510
- if(typeof netdataStopD3 === 'undefined' || !netdataStopD3) {
4511
- $.ajax({
4512
- url: NETDATA.d3_js,
4513
- cache: true,
4514
- dataType: "script",
4515
- xhrFields: { withCredentials: true } // required for the cookie
4516
- })
4517
- .done(function() {
4518
- NETDATA.registerChartLibrary('d3', NETDATA.d3_js);
4519
- })
4520
- .fail(function() {
4521
- NETDATA.chartLibraries.d3.enabled = false;
4522
- NETDATA.error(100, NETDATA.d3_js);
4523
- })
4524
- .always(function() {
4525
- if(typeof callback === "function")
4526
- callback();
4527
- });
4528
- }
4529
- else {
4530
- NETDATA.chartLibraries.d3.enabled = false;
4531
- if(typeof callback === "function")
4532
- callback();
4533
- }
4534
- };
4535
-
4536
- NETDATA.d3ChartUpdate = function(state, data) {
4537
- return false;
4538
- };
4539
-
4540
- NETDATA.d3ChartCreate = function(state, data) {
4541
- return false;
4542
- };
4543
-
4544
- // ----------------------------------------------------------------------------------------------------------------
4545
- // google charts
4546
-
4547
- NETDATA.googleInitialize = function(callback) {
4548
- if(typeof netdataNoGoogleCharts === 'undefined' || !netdataNoGoogleCharts) {
4549
- $.ajax({
4550
- url: NETDATA.google_js,
4551
- cache: true,
4552
- dataType: "script",
4553
- xhrFields: { withCredentials: true } // required for the cookie
4554
- })
4555
- .done(function() {
4556
- NETDATA.registerChartLibrary('google', NETDATA.google_js);
4557
- google.load('visualization', '1.1', {
4558
- 'packages': ['corechart', 'controls'],
4559
- 'callback': callback
4560
- });
4561
- })
4562
- .fail(function() {
4563
- NETDATA.chartLibraries.google.enabled = false;
4564
- NETDATA.error(100, NETDATA.google_js);
4565
- if(typeof callback === "function")
4566
- callback();
4567
- });
4568
- }
4569
- else {
4570
- NETDATA.chartLibraries.google.enabled = false;
4571
- if(typeof callback === "function")
4572
- callback();
4573
- }
4574
- };
4575
-
4576
- NETDATA.googleChartUpdate = function(state, data) {
4577
- var datatable = new google.visualization.DataTable(data.result);
4578
- state.google_instance.draw(datatable, state.google_options);
4579
- return true;
4580
- };
4581
-
4582
- NETDATA.googleChartCreate = function(state, data) {
4583
- var datatable = new google.visualization.DataTable(data.result);
4584
-
4585
- state.google_options = {
4586
- colors: state.chartColors(),
4587
-
4588
- // do not set width, height - the chart resizes itself
4589
- //width: state.chartWidth(),
4590
- //height: state.chartHeight(),
4591
- lineWidth: 1,
4592
- title: state.title,
4593
- fontSize: 11,
4594
- hAxis: {
4595
- // title: "Time of Day",
4596
- // format:'HH:mm:ss',
4597
- viewWindowMode: 'maximized',
4598
- slantedText: false,
4599
- format:'HH:mm:ss',
4600
- textStyle: {
4601
- fontSize: 9
4602
- },
4603
- gridlines: {
4604
- color: '#EEE'
4605
- }
4606
- },
4607
- vAxis: {
4608
- title: state.units,
4609
- viewWindowMode: 'pretty',
4610
- minValue: -0.1,
4611
- maxValue: 0.1,
4612
- direction: 1,
4613
- textStyle: {
4614
- fontSize: 9
4615
- },
4616
- gridlines: {
4617
- color: '#EEE'
4618
- }
4619
- },
4620
- chartArea: {
4621
- width: '65%',
4622
- height: '80%'
4623
- },
4624
- focusTarget: 'category',
4625
- annotation: {
4626
- '1': {
4627
- style: 'line'
4628
- }
4629
- },
4630
- pointsVisible: 0,
4631
- titlePosition: 'out',
4632
- titleTextStyle: {
4633
- fontSize: 11
4634
- },
4635
- tooltip: {
4636
- isHtml: false,
4637
- ignoreBounds: true,
4638
- textStyle: {
4639
- fontSize: 9
4640
- }
4641
- },
4642
- curveType: 'function',
4643
- areaOpacity: 0.3,
4644
- isStacked: false
4645
- };
4646
-
4647
- switch(state.chart.chart_type) {
4648
- case "area":
4649
- state.google_options.vAxis.viewWindowMode = 'maximized';
4650
- state.google_options.areaOpacity = NETDATA.options.current.color_fill_opacity_area;
4651
- state.google_instance = new google.visualization.AreaChart(state.element_chart);
4652
- break;
4653
-
4654
- case "stacked":
4655
- state.google_options.isStacked = true;
4656
- state.google_options.areaOpacity = NETDATA.options.current.color_fill_opacity_stacked;
4657
- state.google_options.vAxis.viewWindowMode = 'maximized';
4658
- state.google_options.vAxis.minValue = null;
4659
- state.google_options.vAxis.maxValue = null;
4660
- state.google_instance = new google.visualization.AreaChart(state.element_chart);
4661
- break;
4662
-
4663
- default:
4664
- case "line":
4665
- state.google_options.lineWidth = 2;
4666
- state.google_instance = new google.visualization.LineChart(state.element_chart);
4667
- break;
4668
- }
4669
-
4670
- state.google_instance.draw(datatable, state.google_options);
4671
- return true;
4672
- };
4673
-
4674
- // ----------------------------------------------------------------------------------------------------------------
4675
-
4676
- NETDATA.percentFromValueMax = function(value, max) {
4677
- if(value === null) value = 0;
4678
- if(max < value) max = value;
4679
-
4680
- var pcent = 0;
4681
- if(max !== 0) {
4682
- pcent = Math.round(value * 100 / max);
4683
- if(pcent === 0 && value > 0) pcent = 1;
4684
- }
4685
-
4686
- return pcent;
4687
- };
4688
-
4689
- // ----------------------------------------------------------------------------------------------------------------
4690
- // easy-pie-chart
4691
-
4692
- NETDATA.easypiechartInitialize = function(callback) {
4693
- if(typeof netdataNoEasyPieChart === 'undefined' || !netdataNoEasyPieChart) {
4694
- $.ajax({
4695
- url: NETDATA.easypiechart_js,
4696
- cache: true,
4697
- dataType: "script",
4698
- xhrFields: { withCredentials: true } // required for the cookie
4699
- })
4700
- .done(function() {
4701
- NETDATA.registerChartLibrary('easypiechart', NETDATA.easypiechart_js);
4702
- })
4703
- .fail(function() {
4704
- NETDATA.chartLibraries.easypiechart.enabled = false;
4705
- NETDATA.error(100, NETDATA.easypiechart_js);
4706
- })
4707
- .always(function() {
4708
- if(typeof callback === "function")
4709
- callback();
4710
- })
4711
- }
4712
- else {
4713
- NETDATA.chartLibraries.easypiechart.enabled = false;
4714
- if(typeof callback === "function")
4715
- callback();
4716
- }
4717
- };
4718
-
4719
- NETDATA.easypiechartClearSelection = function(state) {
4720
- if(typeof state.easyPieChartEvent !== 'undefined') {
4721
- if(state.easyPieChartEvent.timer !== null)
4722
- clearTimeout(state.easyPieChartEvent.timer);
4723
-
4724
- state.easyPieChartEvent.timer = null;
4725
- }
4726
-
4727
- if(state.isAutoRefreshable() === true && state.data !== null) {
4728
- NETDATA.easypiechartChartUpdate(state, state.data);
4729
- }
4730
- else {
4731
- state.easyPieChartLabel.innerHTML = state.legendFormatValue(null);
4732
- state.easyPieChart_instance.update(0);
4733
- }
4734
- state.easyPieChart_instance.enableAnimation();
4735
-
4736
- return true;
4737
- };
4738
-
4739
- NETDATA.easypiechartSetSelection = function(state, t) {
4740
- if(state.timeIsVisible(t) !== true)
4741
- return NETDATA.easypiechartClearSelection(state);
4742
-
4743
- var slot = state.calculateRowForTime(t);
4744
- if(slot < 0 || slot >= state.data.result.length)
4745
- return NETDATA.easypiechartClearSelection(state);
4746
-
4747
- if(typeof state.easyPieChartEvent === 'undefined') {
4748
- state.easyPieChartEvent = {
4749
- timer: null,
4750
- value: 0,
4751
- pcent: 0
4752
- };
4753
- }
4754
-
4755
- var value = state.data.result[state.data.result.length - 1 - slot];
4756
- var max = (state.easyPieChartMax === null)?state.data.max:state.easyPieChartMax;
4757
- var pcent = NETDATA.percentFromValueMax(value, max);
4758
-
4759
- state.easyPieChartEvent.value = value;
4760
- state.easyPieChartEvent.pcent = pcent;
4761
- state.easyPieChartLabel.innerHTML = state.legendFormatValue(value);
4762
-
4763
- if(state.easyPieChartEvent.timer === null) {
4764
- state.easyPieChart_instance.disableAnimation();
4765
-
4766
- state.easyPieChartEvent.timer = setTimeout(function() {
4767
- state.easyPieChartEvent.timer = null;
4768
- state.easyPieChart_instance.update(state.easyPieChartEvent.pcent);
4769
- }, NETDATA.options.current.charts_selection_animation_delay);
4770
- }
4771
-
4772
- return true;
4773
- };
4774
-
4775
- NETDATA.easypiechartChartUpdate = function(state, data) {
4776
- var value, max, pcent;
4777
-
4778
- if(NETDATA.globalPanAndZoom.isActive() === true || state.isAutoRefreshable() === false) {
4779
- value = null;
4780
- max = 0;
This file is too large to show in full.
web/demo.html
+39
-39
@@ -1,51 +1,51 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>NetData Dashboard</title>
5
- <meta name="application-name" content="netdata">
4
+ <title>NetData Dashboard</title>
5
+ <meta name="application-name" content="netdata">
6
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
- <meta name="author" content="costa@tsaousis.gr">
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
+ <meta name="author" content="costa@tsaousis.gr">
14
15
- <meta property="og:locale" content="en_US" />
16
- <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
17
- <meta property="og:url" content="http://my-netdata.io/"/>
18
- <meta property="og:type" content="website"/>
19
- <meta property="og:site_name" content="netdata"/>
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?v39"></script>
15
+ <meta property="og:locale" content="en_US" />
16
+ <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
17
+ <meta property="og:url" content="http://my-netdata.io/"/>
18
+ <meta property="og:type" content="website"/>
19
+ <meta property="og:site_name" content="netdata"/>
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?v39"></script>
24
</head>
25
<body>
26
27
<div style="width: 100%; text-align: center;">
28
- <div data-netdata="netdata.server_cpu"
29
- data-dimensions="user"
30
- data-chart-library="gauge"
31
- data-width="150px"
32
- data-after="-60"
33
- data-points="60"
34
- data-title="Yes! Realtime!"
35
- data-units="I am alive!"
36
- data-colors="#FF5555"
37
- ></div>
38
- <br/>
39
- <div data-netdata="netdata.server_cpu"
40
- data-dimensions="user"
41
- data-chart-library="dygraph"
42
- data-dygraph-theme="sparkline"
43
- data-width="200px"
44
- data-height="30px"
45
- data-after="-60"
46
- data-points="60"
47
- data-colors="#FF5555"
48
- ></div>
28
+ <div data-netdata="netdata.server_cpu"
29
+ data-dimensions="user"
30
+ data-chart-library="gauge"
31
+ data-width="150px"
32
+ data-after="-60"
33
+ data-points="60"
34
+ data-title="Yes! Realtime!"
35
+ data-units="I am alive!"
36
+ data-colors="#FF5555"
37
+ ></div>
38
+ <br/>
39
+ <div data-netdata="netdata.server_cpu"
40
+ data-dimensions="user"
41
+ data-chart-library="dygraph"
42
+ data-dygraph-theme="sparkline"
43
+ data-width="200px"
44
+ data-height="30px"
45
+ data-after="-60"
46
+ data-points="60"
47
+ data-colors="#FF5555"
48
+ ></div>
49
</div>
50
</body>
51
</html>
web/demo2.html
+125
-125
@@ -1,143 +1,143 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>NetData Dashboard</title>
5
- <meta name="application-name" content="netdata">
4
+ <title>NetData Dashboard</title>
5
+ <meta name="application-name" content="netdata">
6
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
- <meta name="author" content="costa@tsaousis.gr">
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
+ <meta name="author" content="costa@tsaousis.gr">
14
15
- <meta property="og:locale" content="en_US" />
16
- <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
17
- <meta property="og:url" content="http://my-netdata.io/"/>
18
- <meta property="og:type" content="website"/>
19
- <meta property="og:site_name" content="netdata"/>
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." />
15
+ <meta property="og:locale" content="en_US" />
16
+ <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
17
+ <meta property="og:url" content="http://my-netdata.io/"/>
18
+ <meta property="og:type" content="website"/>
19
+ <meta property="og:site_name" content="netdata"/>
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>var netdataTheme = 'slate';</script>
24
- <script type="text/javascript" src="http://my-netdata.io/dashboard.js?v40"></script>
23
+ <script>var netdataTheme = 'slate';</script>
24
+ <script type="text/javascript" src="http://my-netdata.io/dashboard.js?v40"></script>
25
</head>
26
<body>
27
28
<div class="container" style="width: 90%; padding-top: 10px; text-align: center; color: #AAA">
29
- <div style="font-size: 7vw;">why netdata?</div>
30
- <br/>
31
- <div style="font-size: 2vw; color: white;">These charts visualize the same data...</div>
29
+ <div style="font-size: 7vw;">why netdata?</div>
30
+ <br/>
31
+ <div style="font-size: 2vw; color: white;">These charts visualize the same data...</div>
32
33
34
- <!-- Nav tabs -->
35
- <ul class="nav nav-tabs" role="tablist">
36
- <li role="presentation" class="active"><a href="#gauge" aria-controls="gauge" role="tab" data-toggle="tab">Gauge.js</a></li>
37
- <li role="presentation"><a href="#easypiechart" aria-controls="easypiechart" role="tab" data-toggle="tab">Easy Pie Chart</a></li>
38
- </ul>
34
+ <!-- Nav tabs -->
35
+ <ul class="nav nav-tabs" role="tablist">
36
+ <li role="presentation" class="active"><a href="#gauge" aria-controls="gauge" role="tab" data-toggle="tab">Gauge.js</a></li>
37
+ <li role="presentation"><a href="#easypiechart" aria-controls="easypiechart" role="tab" data-toggle="tab">Easy Pie Chart</a></li>
38
+ </ul>
39
40
- <!-- Tab panes -->
41
- <div class="tab-content">
42
- <div role="tabpanel" class="tab-pane active" id="gauge">
40
+ <!-- Tab panes -->
41
+ <div class="tab-content">
42
+ <div role="tabpanel" class="tab-pane active" id="gauge">
43
44
- <div style="display: inline-block; width: 35.8%">
45
- <div style="font-size: 1.2vw; color: #666; padding-top: 10px;"><i class="fa fa-comment"></i> I can trace an issue like this</div>
46
- <br/>
47
- <div data-netdata="example.random2"
48
- data-dimensions="random"
49
- data-chart-library="gauge"
50
- data-gauge-max-value="32767"
51
- data-width="100%"
52
- data-after="-600"
53
- data-points="600"
54
- data-title="1/second (netdata default)"
55
- data-units="important metric"
56
- data-colors="#5A5"
57
- ></div>
58
- </div>
59
- <div style="display: inline-block; width: 50%">
60
- <div style="font-size: 1.2vw; color: #666;"><i class="fa fa-comment"></i> Can you trace an issue like these?<br/> <br/></div>
61
- <div data-netdata="example.random2"
62
- data-dimensions="random"
63
- data-chart-library="gauge"
64
- data-gauge-max-value="32767"
65
- data-width="45%"
66
- data-after="-600"
67
- data-points="60"
68
- data-title="Updates Every 10 Sec"
69
- data-units="important metric"
70
- data-colors="#C55"
71
- ></div>
72
- <div data-netdata="example.random2"
73
- data-dimensions="random"
74
- data-chart-library="gauge"
75
- data-gauge-max-value="32767"
76
- data-width="45%"
77
- data-after="-600"
78
- data-points="2"
79
- data-title="Updates Every 5 Mins"
80
- data-units="important metric"
81
- data-colors="#C55"
82
- ></div>
83
- </div>
84
- </div>
85
- <div role="tabpanel" class="tab-pane" id="easypiechart">
44
+ <div style="display: inline-block; width: 35.8%">
45
+ <div style="font-size: 1.2vw; color: #666; padding-top: 10px;"><i class="fa fa-comment"></i> I can trace an issue like this</div>
46
+ <br/>
47
+ <div data-netdata="example.random2"
48
+ data-dimensions="random"
49
+ data-chart-library="gauge"
50
+ data-gauge-max-value="32767"
51
+ data-width="100%"
52
+ data-after="-600"
53
+ data-points="600"
54
+ data-title="1/second (netdata default)"
55
+ data-units="important metric"
56
+ data-colors="#5A5"
57
+ ></div>
58
+ </div>
59
+ <div style="display: inline-block; width: 50%">
60
+ <div style="font-size: 1.2vw; color: #666;"><i class="fa fa-comment"></i> Can you trace an issue like these?<br/> <br/></div>
61
+ <div data-netdata="example.random2"
62
+ data-dimensions="random"
63
+ data-chart-library="gauge"
64
+ data-gauge-max-value="32767"
65
+ data-width="45%"
66
+ data-after="-600"
67
+ data-points="60"
68
+ data-title="Updates Every 10 Sec"
69
+ data-units="important metric"
70
+ data-colors="#C55"
71
+ ></div>
72
+ <div data-netdata="example.random2"
73
+ data-dimensions="random"
74
+ data-chart-library="gauge"
75
+ data-gauge-max-value="32767"
76
+ data-width="45%"
77
+ data-after="-600"
78
+ data-points="2"
79
+ data-title="Updates Every 5 Mins"
80
+ data-units="important metric"
81
+ data-colors="#C55"
82
+ ></div>
83
+ </div>
84
+ </div>
85
+ <div role="tabpanel" class="tab-pane" id="easypiechart">
86
87
- <div style="display: inline-block; width: 25%">
88
- <div style="font-size: 1.2vw; color: #666; padding-top: 10px;"><i class="fa fa-comment"></i> I can trace an issue like this</div>
89
- <br/>
90
- <div data-netdata="example.random2"
91
- data-dimensions="random"
92
- data-chart-library="easypiechart"
93
- data-easypiechart-max-value="32767"
94
- data-width="100%"
95
- data-after="-600"
96
- data-points="600"
97
- data-title="1/second (netdata default)"
98
- data-units="important metric"
99
- data-colors="#5A5"
100
- ></div>
101
- </div>
102
- <div style="display: inline-block; width: 40%">
103
- <div style="font-size: 1.2vw; color: #666;"><i class="fa fa-comment"></i> Can you trace an issue like these?<br/> <br/></div>
104
- <div data-netdata="example.random2"
105
- data-dimensions="random"
106
- data-chart-library="easypiechart"
107
- data-easypiechart-max-value="32767"
108
- data-width="45%"
109
- data-after="-600"
110
- data-points="60"
111
- data-title="Updates Every 10 Sec"
112
- data-units="important metric"
113
- data-colors="#C55"
114
- ></div>
115
- <div data-netdata="example.random2"
116
- data-dimensions="random"
117
- data-chart-library="easypiechart"
118
- data-easypiechart-max-value="32767"
119
- data-width="45%"
120
- data-after="-600"
121
- data-points="2"
122
- data-title="Updates Every 5 Mins"
123
- data-units="important metric"
124
- data-colors="#C55"
125
- ></div>
126
- </div>
127
- </div>
128
- </div>
129
- <div style="font-size: 1.5vw;">Hover on the chart below, to see the selected value on the charts above!</div>
130
- <div data-netdata="example.random2"
131
- data-dimensions="random"
132
- data-dygraph-theme="sparkline"
133
- data-width="100%"
134
- data-height="20vh"
135
- data-after="-600"
136
- data-points="600"
137
- data-title="1/second (netdata default)"
138
- data-units="something"
139
- data-colors="#888"
140
- ></div>
87
+ <div style="display: inline-block; width: 25%">
88
+ <div style="font-size: 1.2vw; color: #666; padding-top: 10px;"><i class="fa fa-comment"></i> I can trace an issue like this</div>
89
+ <br/>
90
+ <div data-netdata="example.random2"
91
+ data-dimensions="random"
92
+ data-chart-library="easypiechart"
93
+ data-easypiechart-max-value="32767"
94
+ data-width="100%"
95
+ data-after="-600"
96
+ data-points="600"
97
+ data-title="1/second (netdata default)"
98
+ data-units="important metric"
99
+ data-colors="#5A5"
100
+ ></div>
101
+ </div>
102
+ <div style="display: inline-block; width: 40%">
103
+ <div style="font-size: 1.2vw; color: #666;"><i class="fa fa-comment"></i> Can you trace an issue like these?<br/> <br/></div>
104
+ <div data-netdata="example.random2"
105
+ data-dimensions="random"
106
+ data-chart-library="easypiechart"
107
+ data-easypiechart-max-value="32767"
108
+ data-width="45%"
109
+ data-after="-600"
110
+ data-points="60"
111
+ data-title="Updates Every 10 Sec"
112
+ data-units="important metric"
113
+ data-colors="#C55"
114
+ ></div>
115
+ <div data-netdata="example.random2"
116
+ data-dimensions="random"
117
+ data-chart-library="easypiechart"
118
+ data-easypiechart-max-value="32767"
119
+ data-width="45%"
120
+ data-after="-600"
121
+ data-points="2"
122
+ data-title="Updates Every 5 Mins"
123
+ data-units="important metric"
124
+ data-colors="#C55"
125
+ ></div>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ <div style="font-size: 1.5vw;">Hover on the chart below, to see the selected value on the charts above!</div>
130
+ <div data-netdata="example.random2"
131
+ data-dimensions="random"
132
+ data-dygraph-theme="sparkline"
133
+ data-width="100%"
134
+ data-height="20vh"
135
+ data-after="-600"
136
+ data-points="600"
137
+ data-title="1/second (netdata default)"
138
+ data-units="something"
139
+ data-colors="#888"
140
+ ></div>
141
</div>
142
</body>
143
</html>
web/demosites.html
+975
-975
@@ -1,1045 +1,1045 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>NetData - Real-time performance monitoring, done right!</title>
5
- <meta name="application-name" content="netdata">
4
+ <title>NetData - Real-time performance monitoring, done right!</title>
5
+ <meta name="application-name" content="netdata">
6
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
14
- <meta property="og:locale" content="en_US" />
15
- <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16
- <meta property="og:url" content="http://my-netdata.io/"/>
17
- <meta property="og:type" content="website"/>
18
- <meta property="og:site_name" content="netdata"/>
19
- <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20
- <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
14
+ <meta property="og:locale" content="en_US" />
15
+ <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16
+ <meta property="og:url" content="http://my-netdata.io/"/>
17
+ <meta property="og:type" content="website"/>
18
+ <meta property="og:site_name" content="netdata"/>
19
+ <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20
+ <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
21
22
- <script>
23
- // --- OPTIONS FOR THE DASHBOARD --
22
+ <script>
23
+ // --- OPTIONS FOR THE DASHBOARD --
24
25
- // this section has to appear before loading dashboard.js
25
+ // this section has to appear before loading dashboard.js
26
27
- // Select a theme.
28
- // uncomment on of the two themes:
27
+ // Select a theme.
28
+ // uncomment on of the two themes:
29
30
- // var netdataTheme = 'default'; // this is white
31
- var netdataTheme = 'slate'; // this is dark
30
+ // var netdataTheme = 'default'; // this is white
31
+ var netdataTheme = 'slate'; // this is dark
32
33
34
- // Set the default netdata server.
35
- // on charts without a 'data-host', this one will be used.
36
- // the default is the server that dashboard.js is downloaded from.
34
+ // Set the default netdata server.
35
+ // on charts without a 'data-host', this one will be used.
36
+ // the default is the server that dashboard.js is downloaded from.
37
38
- // var netdataServer = 'http://my.server:19999/';
39
- </script>
38
+ // var netdataServer = 'http://my.server:19999/';
39
+ </script>
40
41
- <!--
42
- --- LOAD dashboard.js ---
41
+ <!--
42
+ --- LOAD dashboard.js ---
43
44
- to host this HTML file on your web server,
45
- you have to load dashboard.js from the netdata server.
44
+ to host this HTML file on your web server,
45
+ you have to load dashboard.js from the netdata server.
46
47
- So, pick one the two below
48
- If you pick the first, set the server name/IP.
47
+ So, pick one the two below
48
+ If you pick the first, set the server name/IP.
49
50
- The second assumes you host this file on /usr/share/netdata/web
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?v41"></script>
50
+ The second assumes you host this file on /usr/share/netdata/web
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?v41"></script>
55
56
- <script>
57
- // --- OPTIONS FOR THE CHARTS --
56
+ <script>
57
+ // --- OPTIONS FOR THE CHARTS --
58
59
- // destroy charts not shown (lowers memory on the browsers)
60
- // set this to 'true' to destroy, 'false' to hide the charts
61
- NETDATA.options.current.destroy_on_hide = true;
62
-
63
- // set this to false, to always show all dimensions
64
- NETDATA.options.current.eliminate_zero_dimensions = true;
65
-
66
- // set this to false, to lower the pressure on the browser
67
- NETDATA.options.current.concurrent_refreshes = false;
59
+ // destroy charts not shown (lowers memory on the browsers)
60
+ // set this to 'true' to destroy, 'false' to hide the charts
61
+ NETDATA.options.current.destroy_on_hide = true;
62
+
63
+ // set this to false, to always show all dimensions
64
+ NETDATA.options.current.eliminate_zero_dimensions = true;
65
+
66
+ // set this to false, to lower the pressure on the browser
67
+ NETDATA.options.current.concurrent_refreshes = false;
68
69
- // if you need to support slow mobile phones, set this to false
70
- NETDATA.options.current.parallel_refresher = true;
69
+ // if you need to support slow mobile phones, set this to false
70
+ NETDATA.options.current.parallel_refresher = true;
71
72
- // set this to false, to always update the charts, even if focus is lost
73
- NETDATA.options.current.stop_updates_when_focus_is_lost = true;
74
- </script>
72
+ // set this to false, to always update the charts, even if focus is lost
73
+ NETDATA.options.current.stop_updates_when_focus_is_lost = true;
74
+ </script>
75
76
- <style>
76
+ <style>
77
78
body {
79
- font-size: 1vw;
79
+ font-size: 1vw;
80
}
81
82
.mysparkline {
83
- position: relative;
84
- display: inline-block;
85
- min-height: 50px;
86
- width: 100%;
87
- height: 8vmax;
88
- text-align: left;
83
+ position: relative;
84
+ display: inline-block;
85
+ min-height: 50px;
86
+ width: 100%;
87
+ height: 8vmax;
88
+ text-align: left;
89
}
90
91
.mysparkline-overchart-label {
92
- position: absolute;
93
- display: block;
94
- top: 0;
95
- left: 10px;
96
- bottom: 0;
97
- right: 0;
98
- font-size: 1vmax;
99
- z-index: 1;
92
+ position: absolute;
93
+ display: block;
94
+ top: 0;
95
+ left: 10px;
96
+ bottom: 0;
97
+ right: 0;
98
+ font-size: 1vmax;
99
+ z-index: 1;
100
}
101
102
.mysparkline-overchart-value {
103
- position: absolute;
104
- display: block;
105
- top: 1.1vmax;
106
- left: 10px;
107
- bottom: 0;
108
- right: 0;
109
- font-size: 5vmax;
110
- z-index: 2;
111
- text-shadow: #333 0px 0px 2px;
103
+ position: absolute;
104
+ display: block;
105
+ top: 1.1vmax;
106
+ left: 10px;
107
+ bottom: 0;
108
+ right: 0;
109
+ font-size: 5vmax;
110
+ z-index: 2;
111
+ text-shadow: #333 0px 0px 2px;
112
}
113
114
.myfullchart {
115
- position: relative;
116
- display: inline-block;
117
- width: 100%;
118
- height: 14vmax;
119
- min-height: 150px;
120
- text-align: left;
115
+ position: relative;
116
+ display: inline-block;
117
+ width: 100%;
118
+ height: 14vmax;
119
+ min-height: 150px;
120
+ text-align: left;
121
}
122
123
.mygauge-combo {
124
- display: inline-block;
124
+ display: inline-block;
125
}
126
127
.mygauge {
128
- position: relative;
129
- display: block;
130
- width: 18vw;
131
- height: 11vw;
128
+ position: relative;
129
+ display: block;
130
+ width: 18vw;
131
+ height: 11vw;
132
}
133
134
.mygauge-button {
135
- display: block;
135
+ display: block;
136
}
137
138
.mytitle {
139
- padding-top: 6vw;
140
- padding-bottom: 1vw;
141
- text-align: center;
142
- font-size: 2.4vw;
139
+ padding-top: 6vw;
140
+ padding-bottom: 1vw;
141
+ text-align: center;
142
+ font-size: 2.4vw;
143
}
144
145
.mysubtitle {
146
- padding-top: 2vw;
147
- padding-bottom: 1vw;
148
- text-align: center;
149
- font-size: 1.8vw;
146
+ padding-top: 2vw;
147
+ padding-bottom: 1vw;
148
+ text-align: center;
149
+ font-size: 1.8vw;
150
}
151
152
.mycontent {
153
- text-align: center;
154
- font-size: 1.5vw;
153
+ text-align: center;
154
+ font-size: 1.5vw;
155
}
156
157
@media only screen and (min-width : 992px) {
158
- .container {
159
- width: 90%;
160
- }
158
+ .container {
159
+ width: 90%;
160
+ }
161
}
162
@media only screen and (max-width : 992px) {
163
- .container {
164
- width: 100%;
165
- }
163
+ .container {
164
+ width: 100%;
165
+ }
166
}
167
- </style>
167
+ </style>
168
169
</head>
170
<body style="text-align: center;">
171
172
<div class="container">
173
174
- <div style="text-align: center; font-size: 13vw; height: 14vw;">
175
- <b>netdata</b>
176
- </div>
177
- <div style="text-align: center; font-size: 2vw; height: 2.5vw;">
178
- real-time performance monitoring
179
- </div>
180
- <div style="width:80%; text-align: right; font-size: 2.7vw;">
181
- <strong>scaled out</strong>!
182
- </div>
183
- <div class="mytitle">
184
- pick a <b>netdata</b> demo server
185
- </div>
186
- <div class="mycontent">
187
- these demo servers show what you will get by installing <b>netdata</b>
188
- </div>
189
-
190
- <div style="width: 100%; text-align: center; padding-top: 2vw;">
191
- <div style="width: 100%; text-align: center;">
192
-
193
- <div class="mygauge-combo">
194
- <div class="mygauge">
195
- <div data-netdata="netdata.requests"
196
- data-host="//london.my-netdata.io"
197
- data-title="EU - London"
198
- data-chart-library="gauge"
199
- data-width="100%"
200
- data-after="-300"
201
- data-points="300"
202
- data-colors="#558855"
203
- ></div>
204
- </div>
205
- <div class="mygauge-button">
206
- <br/> <br/>
207
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//london.my-netdata.io/default.html'" style="font-size: 1.0vw;">Enter London!</button>
208
- <div style="font-size: 0.8vw;">
209
- Donated by DigitalOcean.com
210
- </div>
211
- </div>
212
- </div>
213
- <div class="mygauge-combo">
214
- <div class="mygauge">
215
- <div data-netdata="netdata.requests"
216
- data-host="//atlanta.my-netdata.io"
217
- data-title="US - Atlanta"
218
- data-chart-library="gauge"
219
- data-width="100%"
220
- data-after="-300"
221
- data-points="300"
222
- data-colors="#AA5555"
223
- ></div>
224
- </div>
225
- <div class="mygauge-button">
226
- <br/> <br/>
227
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//atlanta.my-netdata.io/default.html'" style="font-size: 1.0vw;">Enter Atlanta!</button>
228
- <div style="font-size: 0.8vw;">
229
- Donated by CDN77.com
230
- </div>
231
- </div>
232
- </div>
233
- <div class="mygauge-combo">
234
- <div class="mygauge">
235
- <div data-netdata="netdata.requests"
236
- data-host="//sanfrancisco.netdata.rocks"
237
- data-title="US - California"
238
- data-chart-library="gauge"
239
- data-width="100%"
240
- data-after="-300"
241
- data-points="300"
242
- data-colors="#5555AA"
243
- ></div>
244
- </div>
245
- <div class="mygauge-button">
246
- <br/> <br/>
247
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//sanfrancisco.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter California!</button>
248
- <div style="font-size: 0.8vw;">
249
- Donated by DigitalOcean.com
250
- </div>
251
- </div>
252
- </div>
253
- <div class="mygauge-combo">
254
- <div class="mygauge">
255
- <div data-netdata="netdata.requests"
256
- data-host="//toronto.netdata.rocks"
257
- data-title="Canada"
258
- data-chart-library="gauge"
259
- data-width="100%"
260
- data-after="-300"
261
- data-points="300"
262
- data-colors="#885588"
263
- ></div>
264
- </div>
265
- <div class="mygauge-button">
266
- <br/> <br/>
267
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//toronto.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter Canada!</button>
268
- <div style="font-size: 0.8vw;">
269
- Donated by DigitalOcean.com
270
- </div>
271
- </div>
272
- </div>
273
- <br/> <br/>
274
- <div class="mygauge-combo">
275
- <div class="mygauge">
276
- <div data-netdata="netdata.requests"
277
- data-host="//frankfurt.netdata.rocks"
278
- data-title="EU - Germany"
279
- data-chart-library="easypiechart"
280
- data-width="75%"
281
- data-after="-300"
282
- data-points="300"
283
- data-colors="#AAAA55"
284
- ></div>
285
- </div>
286
- <div class="mygauge-button">
287
- <br/> <br/>
288
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//frankfurt.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter Germany!</button>
289
- <div style="font-size: 0.8vw;">
290
- Donated by DigitalOcean.com
291
- </div>
292
- </div>
293
- </div>
294
- <div class="mygauge-combo">
295
- <div class="mygauge">
296
- <div data-netdata="netdata.requests"
297
- data-host="//newyork.netdata.rocks"
298
- data-title="US - New York"
299
- data-chart-library="easypiechart"
300
- data-width="75%"
301
- data-after="-300"
302
- data-points="300"
303
- data-colors="#BB5533"
304
- ></div>
305
- </div>
306
- <div class="mygauge-button">
307
- <br/> <br/>
308
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//newyork.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter New York!</button>
309
- <div style="font-size: 0.8vw;">
310
- Donated by DigitalOcean.com
311
- </div>
312
- </div>
313
- </div>
314
- <div class="mygauge-combo">
315
- <div class="mygauge">
316
- <div data-netdata="netdata.requests"
317
- data-host="//singapore.netdata.rocks"
318
- data-title="Signapore"
319
- data-chart-library="easypiechart"
320
- data-width="75%"
321
- data-after="-300"
322
- data-points="300"
323
- data-colors="#5588BB"
324
- ></div>
325
- </div>
326
- <div class="mygauge-button">
327
- <br/> <br/>
328
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//singapore.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter Singapore!</button>
329
- <div style="font-size: 0.8vw;">
330
- Donated by DigitalOcean.com
331
- </div>
332
- </div>
333
- </div>
334
- <div class="mygauge-combo">
335
- <div class="mygauge">
336
- <div data-netdata="netdata.requests"
337
- data-host="//bangalore.netdata.rocks"
338
- data-title="India"
339
- data-chart-library="easypiechart"
340
- data-width="75%"
341
- data-after="-300"
342
- data-points="300"
343
- data-colors="#BB55BB"
344
- ></div>
345
- </div>
346
- <div class="mygauge-button">
347
- <br/> <br/>
348
- <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//bangalore.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter India!</button>
349
- <div style="font-size: 0.8vw;">
350
- Donated by DigitalOcean.com
351
- </div>
352
- </div>
353
- </div>
354
- </div>
355
- </div>
356
-
357
- <div class="mytitle">
358
- this page is a custom <b>netdata</b> dashboard
359
- </div>
360
- <div class="mycontent">
361
- charts are coming from 8 servers, in parallel
362
- <br/>
363
- the servers are not aware of this multi-server dashboard,
364
- <br/>
365
- each server is not aware of the other servers,
366
- <br/>
367
- but on this dashboard <b>they are one</b>!
368
- </div>
369
- <div style="padding-top: 1vw; width: 100%; text-align: center; font-size: 1.5vw;">
370
- <i class="fa fa-comment" aria-hidden="true"></i>
371
- hover on a chart below, or drag it to show the past - <b>the others will follow</b>!
372
- <br/>
373
- double click on a chart to reset them all
374
- </div>
375
-
376
- <div class="mytitle">
377
- our <code>nginx</code> performance
378
- </div>
379
- <div class="mycontent">
380
- (we proxy netdata through nginx, on the demo sites)
381
- </div>
382
-
383
- <!-- Nav tabs -->
384
- <ul class="nav nav-tabs" role="tablist" style="padding-top: 1vw;">
385
- <li role="presentation" class="active"><a href="#nginx_requests" aria-controls="nginx_requests" role="tab" data-toggle="tab">Requests</a></li>
386
- <li role="presentation"><a href="#nginx_connections" aria-controls="nginx_connections" role="tab" data-toggle="tab">Connections</a></li>
387
- </ul>
388
-
389
- <!-- Tab panes -->
390
- <div class="tab-content">
391
- <div role="tabpanel" class="tab-pane active" id="nginx_requests">
392
- <div class="mysparkline">
393
- <div class="mysparkline-overchart-label">
394
- <b>EU - London</b> web requests/s
395
- </div>
396
- <div class="mysparkline-overchart-value" id="nginx.requests.netdata" >
397
- </div>
398
- <div data-netdata="nginx.requests"
399
- data-dimensions="requests"
400
- data-host="//london.my-netdata.io"
401
- data-chart-library="dygraph"
402
- data-dygraph-theme="sparkline"
403
- data-dygraph-type="area"
404
- data-width="100%"
405
- data-height="100%"
406
- data-after="-300"
407
- data-colors="#558855"
408
- data-show-value-of-requests-at="nginx.requests.netdata"
409
- ></div>
410
- </div>
411
-
412
- <div class="mysparkline">
413
- <div class="mysparkline-overchart-label">
414
- <b>US - Atlanta</b> web requests/s
415
- </div>
416
- <div class="mysparkline-overchart-value" id="nginx.requests.netdata2" >
417
- </div>
418
- <div data-netdata="nginx.requests"
419
- data-dimensions="requests"
420
- data-host="//atlanta.my-netdata.io"
421
- data-chart-library="dygraph"
422
- data-dygraph-theme="sparkline"
423
- data-dygraph-type="area"
424
- data-width="100%"
425
- data-height="100%"
426
- data-after="-300"
427
- data-colors="#AA5555"
428
- data-show-value-of-requests-at="nginx.requests.netdata2"
429
- ></div>
430
- </div>
431
-
432
- <div class="mysparkline">
433
- <div class="mysparkline-overchart-label">
434
- <b>US - California</b> web requests/s
435
- </div>
436
- <div class="mysparkline-overchart-value" id="nginx.requests.netdata3" >
437
- </div>
438
- <div data-netdata="nginx.requests"
439
- data-dimensions="requests"
440
- data-host="//sanfrancisco.netdata.rocks"
441
- data-chart-library="dygraph"
442
- data-dygraph-theme="sparkline"
443
- data-dygraph-type="area"
444
- data-width="100%"
445
- data-height="100%"
446
- data-after="-300"
447
- data-colors="#5555AA"
448
- data-show-value-of-requests-at="nginx.requests.netdata3"
449
- ></div>
450
- </div>
451
-
452
- <div class="mysparkline">
453
- <div class="mysparkline-overchart-label">
454
- <b>Canada</b> web requests/s
455
- </div>
456
- <div class="mysparkline-overchart-value" id="nginx.requests.netdata4" >
457
- </div>
458
- <div data-netdata="nginx.requests"
459
- data-dimensions="requests"
460
- data-host="//toronto.netdata.rocks"
461
- data-chart-library="dygraph"
462
- data-dygraph-theme="sparkline"
463
- data-dygraph-type="area"
464
- data-width="100%"
465
- data-height="100%"
466
- data-after="-300"
467
- data-colors="#885588"
468
- data-show-value-of-requests-at="nginx.requests.netdata4"
469
- ></div>
470
- </div>
471
- </div>
472
-
473
- <div role="tabpanel" class="tab-pane" id="nginx_connections">
474
- <div class="mysparkline">
475
- <div class="mysparkline-overchart-label">
476
- <b>EU - London</b> active connections
477
- </div>
478
- <div class="mysparkline-overchart-value" id="nginx.connections.netdata1" >
479
- </div>
480
- <div data-netdata="nginx.connections"
481
- data-dimensions="active"
482
- data-host="//london.my-netdata.io"
483
- data-chart-library="dygraph"
484
- data-dygraph-theme="sparkline"
485
- data-dygraph-type="area"
486
- data-width="100%"
487
- data-height="100%"
488
- data-after="-300"
489
- data-colors="#558855"
490
- data-show-value-of-active-at="nginx.connections.netdata1"
491
- ></div>
492
- </div>
493
-
494
- <div class="mysparkline">
495
- <div class="mysparkline-overchart-label">
496
- <b>US - Atlanta</b> active connections
497
- </div>
498
- <div class="mysparkline-overchart-value" id="nginx.connections.netdata2" >
499
- </div>
500
- <div data-netdata="nginx.connections"
501
- data-dimensions="active"
502
- data-host="//atlanta.my-netdata.io"
503
- data-chart-library="dygraph"
504
- data-dygraph-theme="sparkline"
505
- data-dygraph-type="area"
506
- data-width="100%"
507
- data-height="100%"
508
- data-after="-300"
509
- data-colors="#AA5555"
510
- data-show-value-of-active-at="nginx.connections.netdata2"
511
- ></div>
512
- </div>
513
-
514
- <div class="mysparkline">
515
- <div class="mysparkline-overchart-label">
516
- <b>US - California</b> active connections
517
- </div>
518
- <div class="mysparkline-overchart-value" id="nginx.connections.netdata3" >
519
- </div>
520
- <div data-netdata="nginx.connections"
521
- data-dimensions="active"
522
- data-host="//sanfrancisco.netdata.rocks"
523
- data-chart-library="dygraph"
524
- data-dygraph-theme="sparkline"
525
- data-dygraph-type="area"
526
- data-width="100%"
527
- data-height="100%"
528
- data-after="-300"
529
- data-colors="#5555AA"
530
- data-show-value-of-active-at="nginx.connections.netdata3"
531
- ></div>
532
- </div>
533
-
534
- <div class="mysparkline">
535
- <div class="mysparkline-overchart-label">
536
- <b>Canada</b> active connections
537
- </div>
538
- <div class="mysparkline-overchart-value" id="nginx.connections.netdata4" >
539
- </div>
540
- <div data-netdata="nginx.connections"
541
- data-dimensions="active"
542
- data-host="//toronto.netdata.rocks"
543
- data-chart-library="dygraph"
544
- data-dygraph-theme="sparkline"
545
- data-dygraph-type="area"
546
- data-width="100%"
547
- data-height="100%"
548
- data-after="-300"
549
- data-colors="#885588"
550
- data-show-value-of-active-at="nginx.connections.netdata4"
551
- ></div>
552
- </div>
553
- </div>
554
- </div>
555
-
556
- <div style="width: 100%; text-align: right; font-size: 1vw;">
557
- <i class="fa fa-comment" aria-hidden="true"></i> these charts are draggable and touchable, double click them to reset them
558
- </div>
559
-
560
-
561
- <div class="mytitle">
562
- bandwidth consumption on the demo sites
563
- </div>
564
- <div class="mycontent">
565
- Linux QoS is configured by <a href="https://github.com/firehol/netdata/wiki/You-should-install-QoS-on-all-your-servers">FireQOS</a>
566
- </div>
567
-
568
- <!-- Nav tabs -->
569
- <ul class="nav nav-tabs" role="tablist" style="padding-top: 1vw;">
570
- <li role="presentation" class="active"><a href="#outbout" aria-controls="outbout" role="tab" data-toggle="tab">Outbound</a></li>
571
- <li role="presentation"><a href="#inbound" aria-controls="inbound" role="tab" data-toggle="tab">Inbound</a></li>
572
- </ul>
573
-
574
- <!-- Tab panes -->
575
- <div class="tab-content">
576
- <div role="tabpanel" class="tab-pane active" id="outbout">
577
- <div class="myfullchart">
578
- <div data-netdata="tc.world_out"
579
- data-host="//london.my-netdata.io"
580
- data-chart-library="dygraph"
581
- data-title="EU - London, traffic we send per service"
582
- data-width="100%"
583
- data-height="100%"
584
- data-after="-300"
585
- ></div>
586
- </div>
587
-
588
- <div class="myfullchart">
589
- <div data-netdata="tc.world_out"
590
- data-host="//atlanta.my-netdata.io"
591
- data-chart-library="dygraph"
592
- data-title="US - Atlanta, traffic we send per service"
593
- data-width="100%"
594
- data-height="100%"
595
- data-after="-300"
596
- ></div>
597
-
598
- </div>
599
-
600
- <div class="myfullchart">
601
- <div data-netdata="tc.world_out"
602
- data-host="//sanfrancisco.netdata.rocks"
603
- data-chart-library="dygraph"
604
- data-title="US - California, traffic we send per service"
605
- data-width="100%"
606
- data-height="100%"
607
- data-after="-300"
608
- ></div>
609
- </div>
610
-
611
- <div class="myfullchart">
612
- <div data-netdata="tc.world_out"
613
- data-host="//toronto.netdata.rocks"
614
- data-chart-library="dygraph"
615
- data-title="Canada, traffic we send per service"
616
- data-width="100%"
617
- data-height="100%"
618
- data-after="-300"
619
- ></div>
620
- </div>
621
- </div>
622
-
623
- <div role="tabpanel" class="tab-pane" id="inbound">
624
- <div class="myfullchart">
625
- <div data-netdata="tc.world_in"
626
- data-host="//london.my-netdata.io"
627
- data-chart-library="dygraph"
628
- data-title="EU - London, traffic we receive per service"
629
- data-width="100%"
630
- data-height="100%"
631
- data-after="-300"
632
- ></div>
633
-
634
- </div>
635
-
636
- <div class="myfullchart">
637
- <div data-netdata="tc.world_in"
638
- data-host="//atlanta.my-netdata.io"
639
- data-chart-library="dygraph"
640
- data-title="US - Atlanta, traffic we receive per service"
641
- data-width="100%"
642
- data-height="100%"
643
- data-after="-300"
644
- ></div>
645
-
646
- </div>
647
-
648
- <div class="myfullchart">
649
- <div data-netdata="tc.world_in"
650
- data-host="//sanfrancisco.netdata.rocks"
651
- data-chart-library="dygraph"
652
- data-title="US - California, traffic we receive per service"
653
- data-width="100%"
654
- data-height="100%"
655
- data-after="-300"
656
- ></div>
657
- </div>
658
-
659
- <div class="myfullchart">
660
- <div data-netdata="tc.world_in"
661
- data-host="//toronto.netdata.rocks"
662
- data-chart-library="dygraph"
663
- data-title="Canada, traffic we receive per service"
664
- data-width="100%"
665
- data-height="100%"
666
- data-after="-300"
667
- ></div>
668
- </div>
669
- </div>
670
- </div>
671
- <div style="width: 100%; text-align: right; font-size: 1vw;">
672
- <i class="fa fa-comment" aria-hidden="true"></i> <i>these legends are interactive and the charts are resizable here ^^^</i>
673
- </div>
674
-
675
- <div class="mytitle">
676
- DDoS protection performance on the demo sites
677
- </div>
678
- <div class="mycontent">
679
- iptables SYNPROXY configured by <a href="https://github.com/firehol/netdata/wiki/Monitoring-SYNPROXY">FireHOL</a>
680
- </div>
681
-
682
- <div style="padding-top: 4vw; width: 100%; text-align: center; font-size: 1.5vw;">
683
-
684
- <div class="mysparkline">
685
- <div class="mysparkline-overchart-label">
686
- <b>EU - London</b>, TCP SYN packets/s received
687
- </div>
688
- <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata1" >
689
- </div>
690
- <div data-netdata="netfilter.synproxy_syn_received"
691
- data-dimensions="received"
692
- data-host="//london.my-netdata.io"
693
- data-chart-library="dygraph"
694
- data-dygraph-theme="sparkline"
695
- data-dygraph-type="area"
696
- data-width="100%"
697
- data-height="100%"
698
- data-after="-300"
699
- data-colors="#558855"
700
- data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata1"
701
- ></div>
702
- </div>
703
-
704
- <div class="mysparkline">
705
- <div class="mysparkline-overchart-label">
706
- <b>US - Atlanta</b>, TCP SYN packets/s received
707
- </div>
708
- <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata2" >
709
- </div>
710
- <div data-netdata="netfilter.synproxy_syn_received"
711
- data-dimensions="received"
712
- data-host="//atlanta.my-netdata.io"
713
- data-chart-library="dygraph"
714
- data-dygraph-theme="sparkline"
715
- data-dygraph-type="area"
716
- data-width="100%"
717
- data-height="100%"
718
- data-after="-300"
719
- data-colors="#885555"
720
- data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata2"
721
- ></div>
722
- </div>
723
-
724
- <div class="mysparkline">
725
- <div class="mysparkline-overchart-label">
726
- <b>US - California</b>, TCP SYN packets/s received
727
- </div>
728
- <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata3" >
729
- </div>
730
- <div data-netdata="netfilter.synproxy_syn_received"
731
- data-dimensions="received"
732
- data-host="//sanfrancisco.netdata.rocks"
733
- data-chart-library="dygraph"
734
- data-dygraph-theme="sparkline"
735
- data-dygraph-type="area"
736
- data-width="100%"
737
- data-height="100%"
738
- data-after="-300"
739
- data-colors="#555588"
740
- data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata3"
741
- ></div>
742
- </div>
743
-
744
- <div class="mysparkline">
745
- <div class="mysparkline-overchart-label">
746
- <b>Canada</b>, TCP SYN packets/s received
747
- </div>
748
- <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata4" >
749
- </div>
750
- <div data-netdata="netfilter.synproxy_syn_received"
751
- data-dimensions="received"
752
- data-host="//toronto.netdata.rocks"
753
- data-chart-library="dygraph"
754
- data-dygraph-theme="sparkline"
755
- data-dygraph-type="area"
756
- data-width="100%"
757
- data-height="100%"
758
- data-after="-300"
759
- data-colors="#885588"
760
- data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata4"
761
- ></div>
762
- </div>
763
- </div>
764
- <div style="width: 100%; text-align: right; font-size: 1vw;">
765
- <i class="fa fa-comment" aria-hidden="true"></i> <i>did you notice the decimal numbers?
766
- <br/>netdata interpolates collected values at second boundaries, with nanosecond detail!</i>
767
- </div>
768
-
769
-
770
- <div class="mytitle">
771
- CPU Utilization of the demo sites
772
- </div>
773
-
774
- <div style="padding-top: 1vw;">
775
- <div class="myfullchart">
776
- <div data-netdata="system.cpu"
777
- data-host="//london.my-netdata.io"
778
- data-chart-library="dygraph"
779
- data-title="EU - London, CPU Usage"
780
- data-width="100%"
781
- data-height="100%"
782
- data-after="-300"
783
- data-dygraph-valuerange="[0, 100]"
784
- ></div>
785
- </div>
786
-
787
- <div class="myfullchart">
788
- <div data-netdata="system.cpu"
789
- data-host="//atlanta.my-netdata.io"
790
- data-chart-library="dygraph"
791
- data-title="US - Atlanta, CPU Usage"
792
- data-width="100%"
793
- data-height="100%"
794
- data-after="-300"
795
- data-dygraph-valuerange="[0, 100]"
796
- ></div>
797
- </div>
798
-
799
- <div class="myfullchart">
800
- <div data-netdata="system.cpu"
801
- data-host="//sanfrancisco.netdata.rocks"
802
- data-chart-library="dygraph"
803
- data-title="US - California, CPU Usage"
804
- data-width="100%"
805
- data-height="100%"
806
- data-after="-300"
807
- data-dygraph-valuerange="[0, 100]"
808
- ></div>
809
- </div>
810
-
811
- <div class="myfullchart">
812
- <div data-netdata="system.cpu"
813
- data-host="//toronto.netdata.rocks"
814
- data-chart-library="dygraph"
815
- data-title="Canada, CPU Usage"
816
- data-width="100%"
817
- data-height="100%"
818
- data-after="-300"
819
- data-dygraph-valuerange="[0, 100]"
820
- ></div>
821
- </div>
822
- </div>
823
- <div style="width: 100%; text-align: right; font-size: 1vw;">
824
- <i class="fa fa-comment" aria-hidden="true"></i> <i>what is using so much CPU?
825
- <br/>The site <a href="//iplists.firehol.org/">iplists.firehol.org</a> is maintained by FireHOL - the CPU is used for comparing security IP Lists.</i>
826
- </div>
827
-
828
- <div class="mytitle">
829
- Netdata performance
830
- </div>
831
- <div class="mycontent">
832
- netdata monitors <b>users</b>, <b>user groups</b>, <b>applications (process trees)</b>
833
- <br/>
834
- <b>containers</b> (<code>lxc</code>, <code>docker</code>, etc.) and SNMP devices.
835
- </div>
836
-
837
- <!-- Nav tabs -->
838
- <ul class="nav nav-tabs" role="tablist" style="padding-top: 1vw;">
839
- <li role="presentation" class="active"><a href="#netdata_cpu" aria-controls="netdata_cpu" role="tab" data-toggle="tab">CPU</a></li>
840
- <li role="presentation"><a href="#netdata_avgtime" aria-controls="netdata_avgtime" role="tab" data-toggle="tab">Average Response Time</a></li>
841
- </ul>
842
-
843
- <!-- Tab panes -->
844
- <div class="tab-content">
845
- <div role="tabpanel" class="tab-pane active" id="netdata_cpu">
846
- <div class="mysparkline">
847
- <div class="mysparkline-overchart-label">
848
- <b>EU - London</b>, CPU % of a single core
849
- </div>
850
- <div class="mysparkline-overchart-value" id="users.cpu.netdata1" >
851
- </div>
852
- <div data-netdata="apps.cpu"
853
- data-dimensions="netdata"
854
- data-host="//london.my-netdata.io"
855
- data-chart-library="dygraph"
856
- data-dygraph-theme="sparkline"
857
- data-dygraph-type="area"
858
- data-width="100%"
859
- data-height="100%"
860
- data-after="-300"
861
- data-colors="#558855"
862
- data-show-value-of-netdata-at="users.cpu.netdata1"
863
- ></div>
864
- </div>
865
-
866
- <div class="mysparkline">
867
- <div class="mysparkline-overchart-label">
868
- <b>US - Atlanta</b>, CPU % of a single core
869
- </div>
870
- <div class="mysparkline-overchart-value" id="users.cpu.netdata2" >
871
- </div>
872
- <div data-netdata="apps.cpu"
873
- data-dimensions="netdata"
874
- data-host="//atlanta.my-netdata.io"
875
- data-chart-library="dygraph"
876
- data-dygraph-theme="sparkline"
877
- data-dygraph-type="area"
878
- data-width="100%"
879
- data-height="100%"
880
- data-after="-300"
881
- data-colors="#885555"
882
- data-show-value-of-netdata-at="users.cpu.netdata2"
883
- ></div>
884
- </div>
885
-
886
- <div class="mysparkline">
887
- <div class="mysparkline-overchart-label">
888
- <b>US - California</b>, CPU % of a single core
889
- </div>
890
- <div class="mysparkline-overchart-value" id="users.cpu.netdata3" >
891
- </div>
892
- <div data-netdata="apps.cpu"
893
- data-dimensions="netdata"
894
- data-host="//sanfrancisco.netdata.rocks"
895
- data-chart-library="dygraph"
896
- data-dygraph-theme="sparkline"
897
- data-dygraph-type="area"
898
- data-width="100%"
899
- data-height="100%"
900
- data-after="-300"
901
- data-colors="#555588"
902
- data-show-value-of-netdata-at="users.cpu.netdata3"
903
- ></div>
904
- </div>
905
-
906
- <div class="mysparkline">
907
- <div class="mysparkline-overchart-label">
908
- <b>Toronto</b>, CPU % of a single core
909
- </div>
910
- <div class="mysparkline-overchart-value" id="users.cpu.netdata4" >
911
- </div>
912
- <div data-netdata="apps.cpu"
913
- data-dimensions="netdata"
914
- data-host="//toronto.netdata.rocks"
915
- data-chart-library="dygraph"
916
- data-dygraph-theme="sparkline"
917
- data-dygraph-type="area"
918
- data-width="100%"
919
- data-height="100%"
920
- data-after="-300"
921
- data-colors="#885588"
922
- data-show-value-of-netdata-at="users.cpu.netdata4"
923
- ></div>
924
- </div>
925
-
926
- <div style="width: 100%; text-align: right; font-size: 1vw;">
927
- <i class="fa fa-comment" aria-hidden="true"></i> <i>this utilization is about the whole netdata process tree and the percentage is of <b>a single core</b>!
928
- <br/>including <b>BASH</b> plugins (it monitors <code>mysql</code> on the demo sites), <b>node.js</b> plugins (it monitors <code>bind9</code> on the demo sites), etc.
929
- <br/>and including the chart refreshes for the dashboards of all viewers.</i>
930
- </div>
931
- </div>
932
-
933
- <div role="tabpanel" class="tab-pane" id="netdata_avgtime">
934
- <div class="mysparkline">
935
- <div class="mysparkline-overchart-label">
936
- <b>EU - London</b>, API average response time in milliseconds
937
- </div>
938
- <div class="mysparkline-overchart-value" id="netdata.response_time1" >
939
- </div>
940
- <div data-netdata="netdata.response_time"
941
- data-host="//london.my-netdata.io"
942
- data-chart-library="dygraph"
943
- data-dygraph-theme="sparkline"
944
- data-dygraph-type="area"
945
- data-width="100%"
946
- data-height="100%"
947
- data-after="-300"
948
- data-colors="#558855 #356835"
949
- data-show-value-of-average-at="netdata.response_time1"
950
- ></div>
951
- </div>
952
-
953
- <div class="mysparkline">
954
- <div class="mysparkline-overchart-label">
955
- <b>US - Atlanta</b>, API average response time in milliseconds
956
- </div>
957
- <div class="mysparkline-overchart-value" id="netdata.response_time2" >
958
- </div>
959
- <div data-netdata="netdata.response_time"
960
- data-host="//atlanta.my-netdata.io"
961
- data-chart-library="dygraph"
962
- data-dygraph-theme="sparkline"
963
- data-dygraph-type="area"
964
- data-width="100%"
965
- data-height="100%"
966
- data-after="-300"
967
- data-colors="#885555 #683535"
968
- data-show-value-of-average-at="netdata.response_time2"
969
- ></div>
970
- </div>
971
-
972
- <div class="mysparkline">
973
- <div class="mysparkline-overchart-label">
974
- <b>US - California</b>, API average response time in milliseconds
975
- </div>
976
- <div class="mysparkline-overchart-value" id="netdata.response_time3" >
977
- </div>
978
- <div data-netdata="netdata.response_time"
979
- data-host="//sanfrancisco.netdata.rocks"
980
- data-chart-library="dygraph"
981
- data-dygraph-theme="sparkline"
982
- data-dygraph-type="area"
983
- data-width="100%"
984
- data-height="100%"
985
- data-after="-300"
986
- data-colors="#555588 #353568"
987
- data-show-value-of-average-at="netdata.response_time3"
988
- ></div>
989
- </div>
990
-
991
- <div class="mysparkline">
992
- <div class="mysparkline-overchart-label">
993
- <b>Canada</b>, API average response time in milliseconds
994
- </div>
995
- <div class="mysparkline-overchart-value" id="netdata.response_time4" >
996
- </div>
997
- <div data-netdata="netdata.response_time"
998
- data-host="//toronto.netdata.rocks"
999
- data-chart-library="dygraph"
1000
- data-dygraph-theme="sparkline"
1001
- data-dygraph-type="area"
1002
- data-width="100%"
1003
- data-height="100%"
1004
- data-after="-300"
1005
- data-colors="#885588 #683568"
1006
- data-show-value-of-average-at="netdata.response_time4"
1007
- ></div>
1008
- </div>
1009
-
1010
- <div style="width: 100%; text-align: right; font-size: 1vw;">
1011
- <i class="fa fa-comment" aria-hidden="true"></i> <i>netdata is really <b>fast</b> (the values are milliseconds!)
1012
- <br/>
1013
- These values include everything, from the reception of the first byte to the dispatch of the last, including gzip compression.
1014
- <br/>
1015
- Values above 2-3ms are usually chart refreshes of charts with several dimensions, charts with very long durations (zoomed out), or file transfers.
1016
- </i>
1017
- </div>
1018
- </div>
1019
- </div>
1020
-
1021
- <div style="padding-top: 6vw; width: 100%; text-align: center; font-size: 2vw;">
1022
- want to know more?
1023
- <br/>
1024
- jump to <a href="https://github.com/firehol/netdata/">the netdata page at github</a>
1025
- <br/>
1026
- it needs just 3 mins to be installed on your servers!
1027
- <br/>
1028
-
1029
- </div>
174
+ <div style="text-align: center; font-size: 13vw; height: 14vw;">
175
+ <b>netdata</b>
176
+ </div>
177
+ <div style="text-align: center; font-size: 2vw; height: 2.5vw;">
178
+ real-time performance monitoring
179
+ </div>
180
+ <div style="width:80%; text-align: right; font-size: 2.7vw;">
181
+ <strong>scaled out</strong>!
182
+ </div>
183
+ <div class="mytitle">
184
+ pick a <b>netdata</b> demo server
185
+ </div>
186
+ <div class="mycontent">
187
+ these demo servers show what you will get by installing <b>netdata</b>
188
+ </div>
189
+
190
+ <div style="width: 100%; text-align: center; padding-top: 2vw;">
191
+ <div style="width: 100%; text-align: center;">
192
+
193
+ <div class="mygauge-combo">
194
+ <div class="mygauge">
195
+ <div data-netdata="netdata.requests"
196
+ data-host="//london.my-netdata.io"
197
+ data-title="EU - London"
198
+ data-chart-library="gauge"
199
+ data-width="100%"
200
+ data-after="-300"
201
+ data-points="300"
202
+ data-colors="#558855"
203
+ ></div>
204
+ </div>
205
+ <div class="mygauge-button">
206
+ <br/> <br/>
207
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//london.my-netdata.io/default.html'" style="font-size: 1.0vw;">Enter London!</button>
208
+ <div style="font-size: 0.8vw;">
209
+ Donated by DigitalOcean.com
210
+ </div>
211
+ </div>
212
+ </div>
213
+ <div class="mygauge-combo">
214
+ <div class="mygauge">
215
+ <div data-netdata="netdata.requests"
216
+ data-host="//atlanta.my-netdata.io"
217
+ data-title="US - Atlanta"
218
+ data-chart-library="gauge"
219
+ data-width="100%"
220
+ data-after="-300"
221
+ data-points="300"
222
+ data-colors="#AA5555"
223
+ ></div>
224
+ </div>
225
+ <div class="mygauge-button">
226
+ <br/> <br/>
227
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//atlanta.my-netdata.io/default.html'" style="font-size: 1.0vw;">Enter Atlanta!</button>
228
+ <div style="font-size: 0.8vw;">
229
+ Donated by CDN77.com
230
+ </div>
231
+ </div>
232
+ </div>
233
+ <div class="mygauge-combo">
234
+ <div class="mygauge">
235
+ <div data-netdata="netdata.requests"
236
+ data-host="//sanfrancisco.netdata.rocks"
237
+ data-title="US - California"
238
+ data-chart-library="gauge"
239
+ data-width="100%"
240
+ data-after="-300"
241
+ data-points="300"
242
+ data-colors="#5555AA"
243
+ ></div>
244
+ </div>
245
+ <div class="mygauge-button">
246
+ <br/> <br/>
247
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//sanfrancisco.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter California!</button>
248
+ <div style="font-size: 0.8vw;">
249
+ Donated by DigitalOcean.com
250
+ </div>
251
+ </div>
252
+ </div>
253
+ <div class="mygauge-combo">
254
+ <div class="mygauge">
255
+ <div data-netdata="netdata.requests"
256
+ data-host="//toronto.netdata.rocks"
257
+ data-title="Canada"
258
+ data-chart-library="gauge"
259
+ data-width="100%"
260
+ data-after="-300"
261
+ data-points="300"
262
+ data-colors="#885588"
263
+ ></div>
264
+ </div>
265
+ <div class="mygauge-button">
266
+ <br/> <br/>
267
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//toronto.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter Canada!</button>
268
+ <div style="font-size: 0.8vw;">
269
+ Donated by DigitalOcean.com
270
+ </div>
271
+ </div>
272
+ </div>
273
+ <br/> <br/>
274
+ <div class="mygauge-combo">
275
+ <div class="mygauge">
276
+ <div data-netdata="netdata.requests"
277
+ data-host="//frankfurt.netdata.rocks"
278
+ data-title="EU - Germany"
279
+ data-chart-library="easypiechart"
280
+ data-width="75%"
281
+ data-after="-300"
282
+ data-points="300"
283
+ data-colors="#AAAA55"
284
+ ></div>
285
+ </div>
286
+ <div class="mygauge-button">
287
+ <br/> <br/>
288
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//frankfurt.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter Germany!</button>
289
+ <div style="font-size: 0.8vw;">
290
+ Donated by DigitalOcean.com
291
+ </div>
292
+ </div>
293
+ </div>
294
+ <div class="mygauge-combo">
295
+ <div class="mygauge">
296
+ <div data-netdata="netdata.requests"
297
+ data-host="//newyork.netdata.rocks"
298
+ data-title="US - New York"
299
+ data-chart-library="easypiechart"
300
+ data-width="75%"
301
+ data-after="-300"
302
+ data-points="300"
303
+ data-colors="#BB5533"
304
+ ></div>
305
+ </div>
306
+ <div class="mygauge-button">
307
+ <br/> <br/>
308
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//newyork.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter New York!</button>
309
+ <div style="font-size: 0.8vw;">
310
+ Donated by DigitalOcean.com
311
+ </div>
312
+ </div>
313
+ </div>
314
+ <div class="mygauge-combo">
315
+ <div class="mygauge">
316
+ <div data-netdata="netdata.requests"
317
+ data-host="//singapore.netdata.rocks"
318
+ data-title="Signapore"
319
+ data-chart-library="easypiechart"
320
+ data-width="75%"
321
+ data-after="-300"
322
+ data-points="300"
323
+ data-colors="#5588BB"
324
+ ></div>
325
+ </div>
326
+ <div class="mygauge-button">
327
+ <br/> <br/>
328
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//singapore.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter Singapore!</button>
329
+ <div style="font-size: 0.8vw;">
330
+ Donated by DigitalOcean.com
331
+ </div>
332
+ </div>
333
+ </div>
334
+ <div class="mygauge-combo">
335
+ <div class="mygauge">
336
+ <div data-netdata="netdata.requests"
337
+ data-host="//bangalore.netdata.rocks"
338
+ data-title="India"
339
+ data-chart-library="easypiechart"
340
+ data-width="75%"
341
+ data-after="-300"
342
+ data-points="300"
343
+ data-colors="#BB55BB"
344
+ ></div>
345
+ </div>
346
+ <div class="mygauge-button">
347
+ <br/> <br/>
348
+ <button type="button" class="btn btn-default" data-toggle="button" aria-pressed="false" autocomplete="off" onclick="window.location='//bangalore.netdata.rocks/default.html'" style="font-size: 1.0vw;">Enter India!</button>
349
+ <div style="font-size: 0.8vw;">
350
+ Donated by DigitalOcean.com
351
+ </div>
352
+ </div>
353
+ </div>
354
+ </div>
355
+ </div>
356
+
357
+ <div class="mytitle">
358
+ this page is a custom <b>netdata</b> dashboard
359
+ </div>
360
+ <div class="mycontent">
361
+ charts are coming from 8 servers, in parallel
362
+ <br/>
363
+ the servers are not aware of this multi-server dashboard,
364
+ <br/>
365
+ each server is not aware of the other servers,
366
+ <br/>
367
+ but on this dashboard <b>they are one</b>!
368
+ </div>
369
+ <div style="padding-top: 1vw; width: 100%; text-align: center; font-size: 1.5vw;">
370
+ <i class="fa fa-comment" aria-hidden="true"></i>
371
+ hover on a chart below, or drag it to show the past - <b>the others will follow</b>!
372
+ <br/>
373
+ double click on a chart to reset them all
374
+ </div>
375
+
376
+ <div class="mytitle">
377
+ our <code>nginx</code> performance
378
+ </div>
379
+ <div class="mycontent">
380
+ (we proxy netdata through nginx, on the demo sites)
381
+ </div>
382
+
383
+ <!-- Nav tabs -->
384
+ <ul class="nav nav-tabs" role="tablist" style="padding-top: 1vw;">
385
+ <li role="presentation" class="active"><a href="#nginx_requests" aria-controls="nginx_requests" role="tab" data-toggle="tab">Requests</a></li>
386
+ <li role="presentation"><a href="#nginx_connections" aria-controls="nginx_connections" role="tab" data-toggle="tab">Connections</a></li>
387
+ </ul>
388
+
389
+ <!-- Tab panes -->
390
+ <div class="tab-content">
391
+ <div role="tabpanel" class="tab-pane active" id="nginx_requests">
392
+ <div class="mysparkline">
393
+ <div class="mysparkline-overchart-label">
394
+ <b>EU - London</b> web requests/s
395
+ </div>
396
+ <div class="mysparkline-overchart-value" id="nginx.requests.netdata" >
397
+ </div>
398
+ <div data-netdata="nginx.requests"
399
+ data-dimensions="requests"
400
+ data-host="//london.my-netdata.io"
401
+ data-chart-library="dygraph"
402
+ data-dygraph-theme="sparkline"
403
+ data-dygraph-type="area"
404
+ data-width="100%"
405
+ data-height="100%"
406
+ data-after="-300"
407
+ data-colors="#558855"
408
+ data-show-value-of-requests-at="nginx.requests.netdata"
409
+ ></div>
410
+ </div>
411
+
412
+ <div class="mysparkline">
413
+ <div class="mysparkline-overchart-label">
414
+ <b>US - Atlanta</b> web requests/s
415
+ </div>
416
+ <div class="mysparkline-overchart-value" id="nginx.requests.netdata2" >
417
+ </div>
418
+ <div data-netdata="nginx.requests"
419
+ data-dimensions="requests"
420
+ data-host="//atlanta.my-netdata.io"
421
+ data-chart-library="dygraph"
422
+ data-dygraph-theme="sparkline"
423
+ data-dygraph-type="area"
424
+ data-width="100%"
425
+ data-height="100%"
426
+ data-after="-300"
427
+ data-colors="#AA5555"
428
+ data-show-value-of-requests-at="nginx.requests.netdata2"
429
+ ></div>
430
+ </div>
431
+
432
+ <div class="mysparkline">
433
+ <div class="mysparkline-overchart-label">
434
+ <b>US - California</b> web requests/s
435
+ </div>
436
+ <div class="mysparkline-overchart-value" id="nginx.requests.netdata3" >
437
+ </div>
438
+ <div data-netdata="nginx.requests"
439
+ data-dimensions="requests"
440
+ data-host="//sanfrancisco.netdata.rocks"
441
+ data-chart-library="dygraph"
442
+ data-dygraph-theme="sparkline"
443
+ data-dygraph-type="area"
444
+ data-width="100%"
445
+ data-height="100%"
446
+ data-after="-300"
447
+ data-colors="#5555AA"
448
+ data-show-value-of-requests-at="nginx.requests.netdata3"
449
+ ></div>
450
+ </div>
451
+
452
+ <div class="mysparkline">
453
+ <div class="mysparkline-overchart-label">
454
+ <b>Canada</b> web requests/s
455
+ </div>
456
+ <div class="mysparkline-overchart-value" id="nginx.requests.netdata4" >
457
+ </div>
458
+ <div data-netdata="nginx.requests"
459
+ data-dimensions="requests"
460
+ data-host="//toronto.netdata.rocks"
461
+ data-chart-library="dygraph"
462
+ data-dygraph-theme="sparkline"
463
+ data-dygraph-type="area"
464
+ data-width="100%"
465
+ data-height="100%"
466
+ data-after="-300"
467
+ data-colors="#885588"
468
+ data-show-value-of-requests-at="nginx.requests.netdata4"
469
+ ></div>
470
+ </div>
471
+ </div>
472
+
473
+ <div role="tabpanel" class="tab-pane" id="nginx_connections">
474
+ <div class="mysparkline">
475
+ <div class="mysparkline-overchart-label">
476
+ <b>EU - London</b> active connections
477
+ </div>
478
+ <div class="mysparkline-overchart-value" id="nginx.connections.netdata1" >
479
+ </div>
480
+ <div data-netdata="nginx.connections"
481
+ data-dimensions="active"
482
+ data-host="//london.my-netdata.io"
483
+ data-chart-library="dygraph"
484
+ data-dygraph-theme="sparkline"
485
+ data-dygraph-type="area"
486
+ data-width="100%"
487
+ data-height="100%"
488
+ data-after="-300"
489
+ data-colors="#558855"
490
+ data-show-value-of-active-at="nginx.connections.netdata1"
491
+ ></div>
492
+ </div>
493
+
494
+ <div class="mysparkline">
495
+ <div class="mysparkline-overchart-label">
496
+ <b>US - Atlanta</b> active connections
497
+ </div>
498
+ <div class="mysparkline-overchart-value" id="nginx.connections.netdata2" >
499
+ </div>
500
+ <div data-netdata="nginx.connections"
501
+ data-dimensions="active"
502
+ data-host="//atlanta.my-netdata.io"
503
+ data-chart-library="dygraph"
504
+ data-dygraph-theme="sparkline"
505
+ data-dygraph-type="area"
506
+ data-width="100%"
507
+ data-height="100%"
508
+ data-after="-300"
509
+ data-colors="#AA5555"
510
+ data-show-value-of-active-at="nginx.connections.netdata2"
511
+ ></div>
512
+ </div>
513
+
514
+ <div class="mysparkline">
515
+ <div class="mysparkline-overchart-label">
516
+ <b>US - California</b> active connections
517
+ </div>
518
+ <div class="mysparkline-overchart-value" id="nginx.connections.netdata3" >
519
+ </div>
520
+ <div data-netdata="nginx.connections"
521
+ data-dimensions="active"
522
+ data-host="//sanfrancisco.netdata.rocks"
523
+ data-chart-library="dygraph"
524
+ data-dygraph-theme="sparkline"
525
+ data-dygraph-type="area"
526
+ data-width="100%"
527
+ data-height="100%"
528
+ data-after="-300"
529
+ data-colors="#5555AA"
530
+ data-show-value-of-active-at="nginx.connections.netdata3"
531
+ ></div>
532
+ </div>
533
+
534
+ <div class="mysparkline">
535
+ <div class="mysparkline-overchart-label">
536
+ <b>Canada</b> active connections
537
+ </div>
538
+ <div class="mysparkline-overchart-value" id="nginx.connections.netdata4" >
539
+ </div>
540
+ <div data-netdata="nginx.connections"
541
+ data-dimensions="active"
542
+ data-host="//toronto.netdata.rocks"
543
+ data-chart-library="dygraph"
544
+ data-dygraph-theme="sparkline"
545
+ data-dygraph-type="area"
546
+ data-width="100%"
547
+ data-height="100%"
548
+ data-after="-300"
549
+ data-colors="#885588"
550
+ data-show-value-of-active-at="nginx.connections.netdata4"
551
+ ></div>
552
+ </div>
553
+ </div>
554
+ </div>
555
+
556
+ <div style="width: 100%; text-align: right; font-size: 1vw;">
557
+ <i class="fa fa-comment" aria-hidden="true"></i> these charts are draggable and touchable, double click them to reset them
558
+ </div>
559
+
560
+
561
+ <div class="mytitle">
562
+ bandwidth consumption on the demo sites
563
+ </div>
564
+ <div class="mycontent">
565
+ Linux QoS is configured by <a href="https://github.com/firehol/netdata/wiki/You-should-install-QoS-on-all-your-servers">FireQOS</a>
566
+ </div>
567
+
568
+ <!-- Nav tabs -->
569
+ <ul class="nav nav-tabs" role="tablist" style="padding-top: 1vw;">
570
+ <li role="presentation" class="active"><a href="#outbout" aria-controls="outbout" role="tab" data-toggle="tab">Outbound</a></li>
571
+ <li role="presentation"><a href="#inbound" aria-controls="inbound" role="tab" data-toggle="tab">Inbound</a></li>
572
+ </ul>
573
+
574
+ <!-- Tab panes -->
575
+ <div class="tab-content">
576
+ <div role="tabpanel" class="tab-pane active" id="outbout">
577
+ <div class="myfullchart">
578
+ <div data-netdata="tc.world_out"
579
+ data-host="//london.my-netdata.io"
580
+ data-chart-library="dygraph"
581
+ data-title="EU - London, traffic we send per service"
582
+ data-width="100%"
583
+ data-height="100%"
584
+ data-after="-300"
585
+ ></div>
586
+ </div>
587
+
588
+ <div class="myfullchart">
589
+ <div data-netdata="tc.world_out"
590
+ data-host="//atlanta.my-netdata.io"
591
+ data-chart-library="dygraph"
592
+ data-title="US - Atlanta, traffic we send per service"
593
+ data-width="100%"
594
+ data-height="100%"
595
+ data-after="-300"
596
+ ></div>
597
+
598
+ </div>
599
+
600
+ <div class="myfullchart">
601
+ <div data-netdata="tc.world_out"
602
+ data-host="//sanfrancisco.netdata.rocks"
603
+ data-chart-library="dygraph"
604
+ data-title="US - California, traffic we send per service"
605
+ data-width="100%"
606
+ data-height="100%"
607
+ data-after="-300"
608
+ ></div>
609
+ </div>
610
+
611
+ <div class="myfullchart">
612
+ <div data-netdata="tc.world_out"
613
+ data-host="//toronto.netdata.rocks"
614
+ data-chart-library="dygraph"
615
+ data-title="Canada, traffic we send per service"
616
+ data-width="100%"
617
+ data-height="100%"
618
+ data-after="-300"
619
+ ></div>
620
+ </div>
621
+ </div>
622
+
623
+ <div role="tabpanel" class="tab-pane" id="inbound">
624
+ <div class="myfullchart">
625
+ <div data-netdata="tc.world_in"
626
+ data-host="//london.my-netdata.io"
627
+ data-chart-library="dygraph"
628
+ data-title="EU - London, traffic we receive per service"
629
+ data-width="100%"
630
+ data-height="100%"
631
+ data-after="-300"
632
+ ></div>
633
+
634
+ </div>
635
+
636
+ <div class="myfullchart">
637
+ <div data-netdata="tc.world_in"
638
+ data-host="//atlanta.my-netdata.io"
639
+ data-chart-library="dygraph"
640
+ data-title="US - Atlanta, traffic we receive per service"
641
+ data-width="100%"
642
+ data-height="100%"
643
+ data-after="-300"
644
+ ></div>
645
+
646
+ </div>
647
+
648
+ <div class="myfullchart">
649
+ <div data-netdata="tc.world_in"
650
+ data-host="//sanfrancisco.netdata.rocks"
651
+ data-chart-library="dygraph"
652
+ data-title="US - California, traffic we receive per service"
653
+ data-width="100%"
654
+ data-height="100%"
655
+ data-after="-300"
656
+ ></div>
657
+ </div>
658
+
659
+ <div class="myfullchart">
660
+ <div data-netdata="tc.world_in"
661
+ data-host="//toronto.netdata.rocks"
662
+ data-chart-library="dygraph"
663
+ data-title="Canada, traffic we receive per service"
664
+ data-width="100%"
665
+ data-height="100%"
666
+ data-after="-300"
667
+ ></div>
668
+ </div>
669
+ </div>
670
+ </div>
671
+ <div style="width: 100%; text-align: right; font-size: 1vw;">
672
+ <i class="fa fa-comment" aria-hidden="true"></i> <i>these legends are interactive and the charts are resizable here ^^^</i>
673
+ </div>
674
+
675
+ <div class="mytitle">
676
+ DDoS protection performance on the demo sites
677
+ </div>
678
+ <div class="mycontent">
679
+ iptables SYNPROXY configured by <a href="https://github.com/firehol/netdata/wiki/Monitoring-SYNPROXY">FireHOL</a>
680
+ </div>
681
+
682
+ <div style="padding-top: 4vw; width: 100%; text-align: center; font-size: 1.5vw;">
683
+
684
+ <div class="mysparkline">
685
+ <div class="mysparkline-overchart-label">
686
+ <b>EU - London</b>, TCP SYN packets/s received
687
+ </div>
688
+ <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata1" >
689
+ </div>
690
+ <div data-netdata="netfilter.synproxy_syn_received"
691
+ data-dimensions="received"
692
+ data-host="//london.my-netdata.io"
693
+ data-chart-library="dygraph"
694
+ data-dygraph-theme="sparkline"
695
+ data-dygraph-type="area"
696
+ data-width="100%"
697
+ data-height="100%"
698
+ data-after="-300"
699
+ data-colors="#558855"
700
+ data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata1"
701
+ ></div>
702
+ </div>
703
+
704
+ <div class="mysparkline">
705
+ <div class="mysparkline-overchart-label">
706
+ <b>US - Atlanta</b>, TCP SYN packets/s received
707
+ </div>
708
+ <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata2" >
709
+ </div>
710
+ <div data-netdata="netfilter.synproxy_syn_received"
711
+ data-dimensions="received"
712
+ data-host="//atlanta.my-netdata.io"
713
+ data-chart-library="dygraph"
714
+ data-dygraph-theme="sparkline"
715
+ data-dygraph-type="area"
716
+ data-width="100%"
717
+ data-height="100%"
718
+ data-after="-300"
719
+ data-colors="#885555"
720
+ data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata2"
721
+ ></div>
722
+ </div>
723
+
724
+ <div class="mysparkline">
725
+ <div class="mysparkline-overchart-label">
726
+ <b>US - California</b>, TCP SYN packets/s received
727
+ </div>
728
+ <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata3" >
729
+ </div>
730
+ <div data-netdata="netfilter.synproxy_syn_received"
731
+ data-dimensions="received"
732
+ data-host="//sanfrancisco.netdata.rocks"
733
+ data-chart-library="dygraph"
734
+ data-dygraph-theme="sparkline"
735
+ data-dygraph-type="area"
736
+ data-width="100%"
737
+ data-height="100%"
738
+ data-after="-300"
739
+ data-colors="#555588"
740
+ data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata3"
741
+ ></div>
742
+ </div>
743
+
744
+ <div class="mysparkline">
745
+ <div class="mysparkline-overchart-label">
746
+ <b>Canada</b>, TCP SYN packets/s received
747
+ </div>
748
+ <div class="mysparkline-overchart-value" id="netfilter.synproxy_syn_received.netdata4" >
749
+ </div>
750
+ <div data-netdata="netfilter.synproxy_syn_received"
751
+ data-dimensions="received"
752
+ data-host="//toronto.netdata.rocks"
753
+ data-chart-library="dygraph"
754
+ data-dygraph-theme="sparkline"
755
+ data-dygraph-type="area"
756
+ data-width="100%"
757
+ data-height="100%"
758
+ data-after="-300"
759
+ data-colors="#885588"
760
+ data-show-value-of-received-at="netfilter.synproxy_syn_received.netdata4"
761
+ ></div>
762
+ </div>
763
+ </div>
764
+ <div style="width: 100%; text-align: right; font-size: 1vw;">
765
+ <i class="fa fa-comment" aria-hidden="true"></i> <i>did you notice the decimal numbers?
766
+ <br/>netdata interpolates collected values at second boundaries, with nanosecond detail!</i>
767
+ </div>
768
+
769
+
770
+ <div class="mytitle">
771
+ CPU Utilization of the demo sites
772
+ </div>
773
+
774
+ <div style="padding-top: 1vw;">
775
+ <div class="myfullchart">
776
+ <div data-netdata="system.cpu"
777
+ data-host="//london.my-netdata.io"
778
+ data-chart-library="dygraph"
779
+ data-title="EU - London, CPU Usage"
780
+ data-width="100%"
781
+ data-height="100%"
782
+ data-after="-300"
783
+ data-dygraph-valuerange="[0, 100]"
784
+ ></div>
785
+ </div>
786
+
787
+ <div class="myfullchart">
788
+ <div data-netdata="system.cpu"
789
+ data-host="//atlanta.my-netdata.io"
790
+ data-chart-library="dygraph"
791
+ data-title="US - Atlanta, CPU Usage"
792
+ data-width="100%"
793
+ data-height="100%"
794
+ data-after="-300"
795
+ data-dygraph-valuerange="[0, 100]"
796
+ ></div>
797
+ </div>
798
+
799
+ <div class="myfullchart">
800
+ <div data-netdata="system.cpu"
801
+ data-host="//sanfrancisco.netdata.rocks"
802
+ data-chart-library="dygraph"
803
+ data-title="US - California, CPU Usage"
804
+ data-width="100%"
805
+ data-height="100%"
806
+ data-after="-300"
807
+ data-dygraph-valuerange="[0, 100]"
808
+ ></div>
809
+ </div>
810
+
811
+ <div class="myfullchart">
812
+ <div data-netdata="system.cpu"
813
+ data-host="//toronto.netdata.rocks"
814
+ data-chart-library="dygraph"
815
+ data-title="Canada, CPU Usage"
816
+ data-width="100%"
817
+ data-height="100%"
818
+ data-after="-300"
819
+ data-dygraph-valuerange="[0, 100]"
820
+ ></div>
821
+ </div>
822
+ </div>
823
+ <div style="width: 100%; text-align: right; font-size: 1vw;">
824
+ <i class="fa fa-comment" aria-hidden="true"></i> <i>what is using so much CPU?
825
+ <br/>The site <a href="//iplists.firehol.org/">iplists.firehol.org</a> is maintained by FireHOL - the CPU is used for comparing security IP Lists.</i>
826
+ </div>
827
+
828
+ <div class="mytitle">
829
+ Netdata performance
830
+ </div>
831
+ <div class="mycontent">
832
+ netdata monitors <b>users</b>, <b>user groups</b>, <b>applications (process trees)</b>
833
+ <br/>
834
+ <b>containers</b> (<code>lxc</code>, <code>docker</code>, etc.) and SNMP devices.
835
+ </div>
836
+
837
+ <!-- Nav tabs -->
838
+ <ul class="nav nav-tabs" role="tablist" style="padding-top: 1vw;">
839
+ <li role="presentation" class="active"><a href="#netdata_cpu" aria-controls="netdata_cpu" role="tab" data-toggle="tab">CPU</a></li>
840
+ <li role="presentation"><a href="#netdata_avgtime" aria-controls="netdata_avgtime" role="tab" data-toggle="tab">Average Response Time</a></li>
841
+ </ul>
842
+
843
+ <!-- Tab panes -->
844
+ <div class="tab-content">
845
+ <div role="tabpanel" class="tab-pane active" id="netdata_cpu">
846
+ <div class="mysparkline">
847
+ <div class="mysparkline-overchart-label">
848
+ <b>EU - London</b>, CPU % of a single core
849
+ </div>
850
+ <div class="mysparkline-overchart-value" id="users.cpu.netdata1" >
851
+ </div>
852
+ <div data-netdata="apps.cpu"
853
+ data-dimensions="netdata"
854
+ data-host="//london.my-netdata.io"
855
+ data-chart-library="dygraph"
856
+ data-dygraph-theme="sparkline"
857
+ data-dygraph-type="area"
858
+ data-width="100%"
859
+ data-height="100%"
860
+ data-after="-300"
861
+ data-colors="#558855"
862
+ data-show-value-of-netdata-at="users.cpu.netdata1"
863
+ ></div>
864
+ </div>
865
+
866
+ <div class="mysparkline">
867
+ <div class="mysparkline-overchart-label">
868
+ <b>US - Atlanta</b>, CPU % of a single core
869
+ </div>
870
+ <div class="mysparkline-overchart-value" id="users.cpu.netdata2" >
871
+ </div>
872
+ <div data-netdata="apps.cpu"
873
+ data-dimensions="netdata"
874
+ data-host="//atlanta.my-netdata.io"
875
+ data-chart-library="dygraph"
876
+ data-dygraph-theme="sparkline"
877
+ data-dygraph-type="area"
878
+ data-width="100%"
879
+ data-height="100%"
880
+ data-after="-300"
881
+ data-colors="#885555"
882
+ data-show-value-of-netdata-at="users.cpu.netdata2"
883
+ ></div>
884
+ </div>
885
+
886
+ <div class="mysparkline">
887
+ <div class="mysparkline-overchart-label">
888
+ <b>US - California</b>, CPU % of a single core
889
+ </div>
890
+ <div class="mysparkline-overchart-value" id="users.cpu.netdata3" >
891
+ </div>
892
+ <div data-netdata="apps.cpu"
893
+ data-dimensions="netdata"
894
+ data-host="//sanfrancisco.netdata.rocks"
895
+ data-chart-library="dygraph"
896
+ data-dygraph-theme="sparkline"
897
+ data-dygraph-type="area"
898
+ data-width="100%"
899
+ data-height="100%"
900
+ data-after="-300"
901
+ data-colors="#555588"
902
+ data-show-value-of-netdata-at="users.cpu.netdata3"
903
+ ></div>
904
+ </div>
905
+
906
+ <div class="mysparkline">
907
+ <div class="mysparkline-overchart-label">
908
+ <b>Toronto</b>, CPU % of a single core
909
+ </div>
910
+ <div class="mysparkline-overchart-value" id="users.cpu.netdata4" >
911
+ </div>
912
+ <div data-netdata="apps.cpu"
913
+ data-dimensions="netdata"
914
+ data-host="//toronto.netdata.rocks"
915
+ data-chart-library="dygraph"
916
+ data-dygraph-theme="sparkline"
917
+ data-dygraph-type="area"
918
+ data-width="100%"
919
+ data-height="100%"
920
+ data-after="-300"
921
+ data-colors="#885588"
922
+ data-show-value-of-netdata-at="users.cpu.netdata4"
923
+ ></div>
924
+ </div>
925
+
926
+ <div style="width: 100%; text-align: right; font-size: 1vw;">
927
+ <i class="fa fa-comment" aria-hidden="true"></i> <i>this utilization is about the whole netdata process tree and the percentage is of <b>a single core</b>!
928
+ <br/>including <b>BASH</b> plugins (it monitors <code>mysql</code> on the demo sites), <b>node.js</b> plugins (it monitors <code>bind9</code> on the demo sites), etc.
929
+ <br/>and including the chart refreshes for the dashboards of all viewers.</i>
930
+ </div>
931
+ </div>
932
+
933
+ <div role="tabpanel" class="tab-pane" id="netdata_avgtime">
934
+ <div class="mysparkline">
935
+ <div class="mysparkline-overchart-label">
936
+ <b>EU - London</b>, API average response time in milliseconds
937
+ </div>
938
+ <div class="mysparkline-overchart-value" id="netdata.response_time1" >
939
+ </div>
940
+ <div data-netdata="netdata.response_time"
941
+ data-host="//london.my-netdata.io"
942
+ data-chart-library="dygraph"
943
+ data-dygraph-theme="sparkline"
944
+ data-dygraph-type="area"
945
+ data-width="100%"
946
+ data-height="100%"
947
+ data-after="-300"
948
+ data-colors="#558855 #356835"
949
+ data-show-value-of-average-at="netdata.response_time1"
950
+ ></div>
951
+ </div>
952
+
953
+ <div class="mysparkline">
954
+ <div class="mysparkline-overchart-label">
955
+ <b>US - Atlanta</b>, API average response time in milliseconds
956
+ </div>
957
+ <div class="mysparkline-overchart-value" id="netdata.response_time2" >
958
+ </div>
959
+ <div data-netdata="netdata.response_time"
960
+ data-host="//atlanta.my-netdata.io"
961
+ data-chart-library="dygraph"
962
+ data-dygraph-theme="sparkline"
963
+ data-dygraph-type="area"
964
+ data-width="100%"
965
+ data-height="100%"
966
+ data-after="-300"
967
+ data-colors="#885555 #683535"
968
+ data-show-value-of-average-at="netdata.response_time2"
969
+ ></div>
970
+ </div>
971
+
972
+ <div class="mysparkline">
973
+ <div class="mysparkline-overchart-label">
974
+ <b>US - California</b>, API average response time in milliseconds
975
+ </div>
976
+ <div class="mysparkline-overchart-value" id="netdata.response_time3" >
977
+ </div>
978
+ <div data-netdata="netdata.response_time"
979
+ data-host="//sanfrancisco.netdata.rocks"
980
+ data-chart-library="dygraph"
981
+ data-dygraph-theme="sparkline"
982
+ data-dygraph-type="area"
983
+ data-width="100%"
984
+ data-height="100%"
985
+ data-after="-300"
986
+ data-colors="#555588 #353568"
987
+ data-show-value-of-average-at="netdata.response_time3"
988
+ ></div>
989
+ </div>
990
+
991
+ <div class="mysparkline">
992
+ <div class="mysparkline-overchart-label">
993
+ <b>Canada</b>, API average response time in milliseconds
994
+ </div>
995
+ <div class="mysparkline-overchart-value" id="netdata.response_time4" >
996
+ </div>
997
+ <div data-netdata="netdata.response_time"
998
+ data-host="//toronto.netdata.rocks"
999
+ data-chart-library="dygraph"
1000
+ data-dygraph-theme="sparkline"
1001
+ data-dygraph-type="area"
1002
+ data-width="100%"
1003
+ data-height="100%"
1004
+ data-after="-300"
1005
+ data-colors="#885588 #683568"
1006
+ data-show-value-of-average-at="netdata.response_time4"
1007
+ ></div>
1008
+ </div>
1009
+
1010
+ <div style="width: 100%; text-align: right; font-size: 1vw;">
1011
+ <i class="fa fa-comment" aria-hidden="true"></i> <i>netdata is really <b>fast</b> (the values are milliseconds!)
1012
+ <br/>
1013
+ These values include everything, from the reception of the first byte to the dispatch of the last, including gzip compression.
1014
+ <br/>
1015
+ Values above 2-3ms are usually chart refreshes of charts with several dimensions, charts with very long durations (zoomed out), or file transfers.
1016
+ </i>
1017
+ </div>
1018
+ </div>
1019
+ </div>
1020
+
1021
+ <div style="padding-top: 6vw; width: 100%; text-align: center; font-size: 2vw;">
1022
+ want to know more?
1023
+ <br/>
1024
+ jump to <a href="https://github.com/firehol/netdata/">the netdata page at github</a>
1025
+ <br/>
1026
+ it needs just 3 mins to be installed on your servers!
1027
+ <br/>
1028
+
1029
+ </div>
1030
</div>
1031
</body>
1032
<script>
1033
- // google analytics when this is used for the home page of the demo sites
1034
- // you don't need this if you customize this dashboard for your needs
1035
- setTimeout(function() {
1036
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
1037
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
1038
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
1039
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
1040
-
1041
- ga('create', 'UA-64295674-3', 'auto');
1042
- ga('send', 'pageview');
1043
- }, 2000);
1033
+ // google analytics when this is used for the home page of the demo sites
1034
+ // you don't need this if you customize this dashboard for your needs
1035
+ setTimeout(function() {
1036
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
1037
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
1038
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
1039
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
1040
+
1041
+ ga('create', 'UA-64295674-3', 'auto');
1042
+ ga('send', 'pageview');
1043
+ }, 2000);
1044
</script>
1045
</html>
web/index.html
+2597
-2590
@@ -1,1356 +1,1356 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>netdata dashboard</title>
5
- <meta name="application-name" content="netdata">
6
-
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
- <meta name="author" content="costa@tsaousis.gr">
14
-
15
- <link rel="shortcut icon" href="images/seo-performance-multi-size.ico">
16
-
17
- <link rel="apple-touch-icon" href="images/seo-performance-72.png">
18
- <link rel="apple-touch-icon" sizes="72x72" href="images/seo-performance-72.png">
19
- <link rel="apple-touch-icon" sizes="114x114" href="images/seo-performance-114.png">
20
-
21
- <link rel="icon" type="image/png" sizes="512x512" href="images/seo-performance-512.png">
22
- <link rel="icon" type="image/png" sizes="256x256" href="images/seo-performance-256.png">
23
- <link rel="icon" type="image/png" sizes="128x128" href="images/seo-performance-128.png">
24
- <link rel="icon" type="image/png" sizes="64x64" href="images/seo-performance-64.png">
25
- <link rel="icon" type="image/png" sizes="48x48" href="images/seo-performance-48.png">
26
- <link rel="icon" type="image/png" sizes="32x32" href="images/seo-performance-32.png">
27
- <link rel="icon" type="image/png" sizes="24x24" href="images/seo-performance-24.png">
28
- <link rel="icon" type="image/png" sizes="16x16" href="images/seo-performance-16.png">
29
-
30
- <meta property="og:locale" content="en_US" />
31
- <meta property="og:image" content="http://my-netdata.io/images/post.png"/>
32
- <meta property="og:url" content="http://my-netdata.io/"/>
33
- <meta property="og:type" content="website"/>
34
- <meta property="og:site_name" content="netdata"/>
35
- <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
36
- <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
37
-
38
- <style>
39
-
40
- /* prevent body from hiding under the navbar */
41
- body {
42
- padding-top: 50px;
43
- }
44
-
45
- .loadOverlay {
46
- position: absolute;
47
- top: 0px;
48
- left: 0px;
49
- width: 100%;
50
- height:100%;
51
- z-index: 2000;
52
- font-size: 10vh;
53
- font-family: sans-serif;
54
- padding: 40vh 0 40vh 0;
55
- font-weight: bold;
56
- text-align: center;
57
- }
58
-
59
- .modal-wide .modal-dialog {
60
- width: 80%;
61
- }
62
-
63
- /* fix # anchors scrolling under the navbar
64
- https://github.com/twbs/bootstrap/issues/1768#issuecomment-46519033
65
- */
66
- h1 {
67
- position: relative;
68
- z-index: -1;
69
- }
70
- h2 {
71
- position: relative;
72
- z-index: -2;
73
- }
74
- h1:before, h2:before {
75
- display: block;
76
- content: " ";
77
- margin-top: -70px;
78
- height: 70px;
79
- visibility: hidden;
80
- }
81
-
82
- .p {
83
- display: block;
84
- margin-top: 15px;
85
- }
86
-
87
- .option-row,
88
- .option-control {
89
- vertical-align: top;
90
- padding: 10px;
91
- padding-top: 30px;
92
- padding-left: 30px;
93
- }
94
-
95
- .option-info {
96
- padding: 10px;
97
- }
98
-
99
- .chart-message {
100
- display: block;
101
- margin-top: 10px;
102
- }
103
-
104
- .container {
105
- width: 90% !important;
106
- }
107
-
108
- #masthead h1 {
109
- /*font-size: 30px;*/
110
- line-height: 1;
111
- padding-top: 30px;
112
- }
113
-
114
- #masthead .well {
115
- margin-top:4%;
116
- }
117
-
118
- /* fix the navbar shifting when a modal is open */
119
- /* https://github.com/twbs/bootstrap/issues/14040#issuecomment-159891033 */
120
- body.modal-open{
121
- width: 100% !important;
122
- padding-right: 0 !important;
123
-/* overflow-y: scroll !important; */
124
-/* position: fixed !important;*/
125
- overflow: visible;
126
- }
127
-
128
- /*
129
- * Side navigation
130
- *
131
- * Scrollspy and affixed enhanced navigation to highlight sections and secondary
132
- * sections of docs content.
133
- */
134
-
135
- .affix {
136
- position: static;
137
- top: 70px !important;
138
- /*width: 220px;*/
139
- }
140
-
141
- .affix-top {
142
- /*width: 220px;*/
143
- }
144
-
145
- .dashboard-sidebar {
146
- max-height: calc(100% - 70px) !important;
147
- overflow-y: auto;
148
- /*width: 220px !important;*/
149
- }
150
-
151
- /* By default it's not affixed in mobile views, so undo that */
152
- .dashboard-sidebar.affix {
153
- position: static;
154
- }
155
-
156
- @media (min-width: 768px) {
157
- .dashboard-sidebar {
158
- padding-left: 20px;
159
- }
160
- }
161
-
162
- /* First level of nav */
163
- .dashboard-sidenav {
164
- margin-top: 20px;
165
- margin-bottom: 20px;
166
- }
167
-
168
- /* All levels of nav */
169
- .dashboard-sidebar .nav > li > a {
170
- display: block;
171
- padding: 4px 20px;
172
- font-size: 13px;
173
- font-weight: 500;
174
- color: #767676;
175
- }
176
- .dashboard-sidebar .nav > li > a:hover,
177
- .dashboard-sidebar .nav > li > a:focus {
178
- padding-left: 19px;
179
- color: #563d7c;
180
- text-decoration: none;
181
- background-color: transparent;
182
- border-left: 1px solid #563d7c;
183
- }
184
- .dashboard-sidebar .nav > .active > a,
185
- .dashboard-sidebar .nav > .active:hover > a,
186
- .dashboard-sidebar .nav > .active:focus > a {
187
- padding-left: 18px;
188
- font-weight: bold;
189
- color: #563d7c;
190
- background-color: transparent;
191
- border-left: 2px solid #563d7c;
192
- }
193
-
194
- /* Nav: second level (shown on .active) */
195
- .dashboard-sidebar .nav .nav {
196
- display: none; /* Hide by default, but at >768px, show it */
197
- padding-bottom: 10px;
198
- }
199
- .dashboard-sidebar .nav .nav > li > a {
200
- padding-top: 1px;
201
- padding-bottom: 1px;
202
- padding-left: 30px;
203
- font-size: 12px;
204
- font-weight: normal;
205
- }
206
- .dashboard-sidebar .nav .nav > li > a:hover,
207
- .dashboard-sidebar .nav .nav > li > a:focus {
208
- padding-left: 29px;
209
- }
210
- .dashboard-sidebar .nav .nav > .active > a,
211
- .dashboard-sidebar .nav .nav > .active:hover > a,
212
- .dashboard-sidebar .nav .nav > .active:focus > a {
213
- padding-left: 28px;
214
- font-weight: 500;
215
- }
216
-
217
- .dropdown-menu {
218
- min-width: 200px;
219
- }
220
- .dropdown-menu.columns-2 {
221
- margin: 0;
222
- padding: 0;
223
- width: 400px;
224
- }
225
- .dropdown-menu li a {
226
- padding: 5px 15px;
227
- font-weight: 300;
228
- }
229
- .dropdown-menu.multi-column {
230
- overflow-x: hidden;
231
- }
232
- .multi-column-dropdown {
233
- list-style: none;
234
- padding: 0;
235
- }
236
- .multi-column-dropdown li a {
237
- display: block;
238
- clear: both;
239
- line-height: 1.428571429;
240
- white-space: normal;
241
- }
242
- .multi-column-dropdown li a:hover {
243
- text-decoration: none;
244
- color: #f5f5f5;
245
- background-color: #262626;
246
- }
247
- .scrollable-menu {
248
- height: auto;
249
- max-height: 80vh;
250
- overflow-x: hidden;
251
- }
252
-
253
- /* Back to top (hidden on mobile) */
254
- .back-to-top,
255
- .dashboard-theme-toggle {
256
- display: none;
257
- padding: 4px 10px;
258
- margin-top: 10px;
259
- margin-left: 10px;
260
- font-size: 12px;
261
- font-weight: 500;
262
- color: #999;
263
- }
264
- .back-to-top:hover,
265
- .dashboard-theme-toggle:hover {
266
- color: #563d7c;
267
- text-decoration: none;
268
- }
269
- .dashboard-theme-toggle {
270
- margin-top: 0;
271
- }
272
-
273
- @media (min-width: 768px) {
274
- .back-to-top,
275
- .dashboard-theme-toggle {
276
- display: block;
277
- }
278
-
279
- /* Widen the fixed sidebar */
280
- .dashboard-sidebar.affix,
281
- .dashboard-sidebar.affix-top,
282
- .dashboard-sidebar.affix-bottom {
283
- width: 200px !important;
284
- }
285
-
286
- .dashboard-sidebar.affix {
287
- position: fixed; /* Undo the static from mobile first approach */
288
- top: 20px;
289
- }
290
-
291
- .dashboard-sidebar.affix-bottom {
292
- position: absolute; /* Undo the static from mobile first approach */
293
- }
294
-
295
- .dashboard-sidebar.affix-bottom .dashboard-sidenav,
296
- .dashboard-sidebar.affix .dashboard-sidenav {
297
- margin-top: 0;
298
- margin-bottom: 0;
299
- }
300
- }
301
-
302
- /* Show and affix the side nav when space allows it */
303
- @media (min-width: 992px) {
304
- .dashboard-sidebar .nav > .active > ul {
305
- display: block;
306
- }
307
-
308
- /* Widen the fixed sidebar */
309
- .dashboard-sidebar.affix,
310
- .dashboard-sidebar.affix-top,
311
- .dashboard-sidebar.affix-bottom {
312
- width: 200px !important;
313
- }
314
- .dashboard-sidebar.affix {
315
- position: fixed; /* Undo the static from mobile first approach */
316
- top: 20px;
317
- }
318
- .dashboard-sidebar.affix-bottom {
319
- position: absolute; /* Undo the static from mobile first approach */
320
- }
321
- .dashboard-sidebar.affix-bottom .dashboard-sidenav,
322
- .dashboard-sidebar.affix .dashboard-sidenav {
323
- margin-top: 0;
324
- margin-bottom: 0;
325
- }
326
- }
327
-
328
- @media (min-width: 1200px) {
329
- /* Widen the fixed sidebar again */
330
- .dashboard-sidebar.affix-bottom,
331
- .dashboard-sidebar.affix-top,
332
- .dashboard-sidebar.affix {
333
- width: 263px;
334
- }
335
- }
336
- </style>
337
-
338
- <!-- check which theme to use -->
339
- <script type="text/javascript">
340
- // --------------------------------------------------------------------
341
- // urlOptions
342
-
343
- var urlOptions = {
344
- hash: '#',
345
- theme: null,
346
- help: null,
347
- pan_and_zoom: false,
348
- after: 0,
349
- before: 0,
350
- nowelcome: 0,
351
- hasProperty: function(property) {
352
- // console.log('checking property ' + property + ' of type ' + typeof(this[property]));
353
- return typeof this[property] !== 'undefined';
354
- }
355
- };
356
-
357
- function netdataPanAndZoomCallback(status, after, before) {
358
- urlOptions.pan_and_zoom = status;
359
- urlOptions.after = after;
360
- urlOptions.before = before;
361
- netdataHashUpdate();
362
- }
363
-
364
- function netdataHashUpdate() {
365
- history.replaceState(null, document.title, netdataHash());
366
- }
367
-
368
- function netdataHash() {
369
- var hash = urlOptions.hash;
370
-
371
- if(urlOptions.pan_and_zoom === true) {
372
- hash += ';after=' + urlOptions.after.toString() +
373
- ';before=' + urlOptions.before.toString();
374
- }
375
-
376
- if(urlOptions.theme !== null)
377
- hash += ';theme=' + urlOptions.theme.toString();
378
-
379
- if(urlOptions.help !== null)
380
- hash += ';help=' + urlOptions.help.toString();
381
-
382
- return hash;
383
- }
384
-
385
- function netdataHashParse() {
386
- var variables = document.location.hash.split(';');
387
- var len = variables.length;
388
- while(len--) {
389
- if(len !== 0) {
390
- var p = variables[len].split('=');
391
- if(urlOptions.hasProperty(p[0]) && typeof p[1] !== 'undefined')
392
- urlOptions[p[0]] = p[1];
393
- }
394
- else {
395
- if(variables[len].length > 0)
396
- urlOptions.hash = variables[len];
397
- }
398
- }
399
-
400
- if(urlOptions.before > 0 && urlOptions.after > 0)
401
- urlOptions.pan_and_zoom = true;
402
-
403
- // console.log(urlOptions);
404
- }
405
-
406
- netdataHashParse();
407
-
408
- // --------------------------------------------------------------------
409
- // check options that should be processed before loading netdata.js
410
-
411
- function loadLocalStorage(name) {
412
- var ret = null;
413
-
414
- try {
415
- if(typeof Storage !== "undefined" && typeof localStorage === 'object')
416
- ret = localStorage.getItem(name);
417
- }
418
- catch(error) {
419
- ;
420
- }
421
-
422
- if(typeof ret === 'undefined' || ret === null)
423
- return null;
424
-
425
- // console.log('loaded: ' + name.toString() + ' = ' + ret.toString());
426
-
427
- return ret;
428
- }
429
-
430
- function saveLocalStorage(name, value) {
431
- // console.log('saving: ' + name.toString() + ' = ' + value.toString());
432
- try {
433
- if(typeof Storage !== "undefined" && typeof localStorage === 'object') {
434
- localStorage.setItem(name, value.toString());
435
- return true;
436
- }
437
- }
438
- catch(error) {
439
- ;
440
- }
441
-
442
- return false;
443
- }
444
-
445
- function getTheme(def) {
446
- var ret = loadLocalStorage('netdataTheme');
447
- if(typeof ret === 'undefined' || ret === null || ret === 'undefined')
448
- return def;
449
- else
450
- return ret;
451
- }
452
-
453
- function setTheme(theme) {
454
- if(theme === netdataTheme) return false;
455
- return saveLocalStorage('netdataTheme', theme);
456
- }
457
-
458
- var netdataTheme = getTheme('slate');
459
- var netdataShowHelp = true;
460
-
461
- if(urlOptions.theme !== null) {
462
- setTheme(urlOptions.theme);
463
- netdataTheme = urlOptions.theme;
464
- }
465
- else
466
- urlOptions.theme = netdataTheme;
467
-
468
- if(urlOptions.help !== null) {
469
- saveLocalStorage('options.show_help', urlOptions.help);
470
- netdataShowHelp = urlOptions.help;
471
- }
472
- else {
473
- urlOptions.help = loadLocalStorage('options.show_help');
474
- }
475
-
476
- // --------------------------------------------------------------------
477
- // registry call back to render my-netdata menu
478
-
479
- var netdataRegistryCallback = function(machines_array) {
480
- var el = '';
481
- var a1 = '';
482
- var found = 0;
483
-
484
- if(machines_array) {
485
- function name_comparator_desc(a, b) {
486
- if (a.name > b.name) return -1;
487
- if (a.name < b.name) return 1;
488
- return 0;
489
- }
490
-
491
- var machines = machines_array.sort(name_comparator_desc);
492
- var len = machines.length;
493
- while(len--) {
494
- var u = machines[len];
495
- found++;
496
- el += '<li id="registry_server_' + u.guid + '"><a class="registry_link" href="' + u.url + '" onClick="return gotoServerModalHandler(\'' + u.guid + '\');">' + u.name + '</a></li>';
497
- a1 += '<li id="registry_action_' + u.guid + '"><a href="#" onclick="deleteRegistryModalHandler(\'' + u.guid + '\',\'' + u.name + '\',\'' + u.url + '\'); return false;"><i class="fa fa-trash-o" aria-hidden="true" style="color: #999;"></i></a></li>';
498
- }
499
- }
500
-
501
- if(!found) {
502
- if(machines)
503
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">your netdata server list is empty...</a></li>';
504
- else
505
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">failed to contact the registry...</a></li>';
506
-
507
- a1 += '<li><a href="#" onClick="return false;"> </a></li>';
508
-
509
- el += '<li role="separator" class="divider"></li>' +
510
- '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
511
- '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
512
- '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
513
- a1 += '<li role="separator" class="divider"></li>' +
514
- '<li><a href="#"> </a></li>' +
515
- '<li><a href="#"> </a></li>'+
516
- '<li><a href="#"> </a></li>';
517
- }
518
-
519
- el += '<li role="separator" class="divider"></li>';
520
- a1 += '<li role="separator" class="divider"></li>';
521
-
522
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
523
- a1 += '<li><a href="#" style="color: #999;" onclick="switchRegistryModalHandler(); return false;"><i class="fa fa-cog" aria-hidden="true" style="color: #999;"></i></a></li>'
524
-
525
- document.getElementById('mynetdata_servers').innerHTML = el;
526
- document.getElementById('mynetdata_servers2').innerHTML = el;
527
- document.getElementById('mynetdata_actions1').innerHTML = a1;
528
-
529
- gotoServerInit();
530
- };
531
-
532
- </script>
533
-
534
- <!-- load the dashboard manager - it will do the rest -->
535
- <script type="text/javascript" src="dashboard.js?v41"></script>
4
+ <title>netdata dashboard</title>
5
+ <meta name="application-name" content="netdata">
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
+ <meta name="author" content="costa@tsaousis.gr">
14
+
15
+ <link rel="shortcut icon" href="images/seo-performance-multi-size.ico">
16
+
17
+ <link rel="apple-touch-icon" href="images/seo-performance-72.png">
18
+ <link rel="apple-touch-icon" sizes="72x72" href="images/seo-performance-72.png">
19
+ <link rel="apple-touch-icon" sizes="114x114" href="images/seo-performance-114.png">
20
+
21
+ <link rel="icon" type="image/png" sizes="512x512" href="images/seo-performance-512.png">
22
+ <link rel="icon" type="image/png" sizes="256x256" href="images/seo-performance-256.png">
23
+ <link rel="icon" type="image/png" sizes="128x128" href="images/seo-performance-128.png">
24
+ <link rel="icon" type="image/png" sizes="64x64" href="images/seo-performance-64.png">
25
+ <link rel="icon" type="image/png" sizes="48x48" href="images/seo-performance-48.png">
26
+ <link rel="icon" type="image/png" sizes="32x32" href="images/seo-performance-32.png">
27
+ <link rel="icon" type="image/png" sizes="24x24" href="images/seo-performance-24.png">
28
+ <link rel="icon" type="image/png" sizes="16x16" href="images/seo-performance-16.png">
29
+
30
+ <meta property="og:locale" content="en_US" />
31
+ <meta property="og:image" content="http://my-netdata.io/images/post.png"/>
32
+ <meta property="og:url" content="http://my-netdata.io/"/>
33
+ <meta property="og:type" content="website"/>
34
+ <meta property="og:site_name" content="netdata"/>
35
+ <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
36
+ <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
37
+
38
+ <style>
39
+
40
+ /* prevent body from hiding under the navbar */
41
+ body {
42
+ padding-top: 50px;
43
+ }
44
+
45
+ .loadOverlay {
46
+ position: absolute;
47
+ top: 0px;
48
+ left: 0px;
49
+ width: 100%;
50
+ height:100%;
51
+ z-index: 2000;
52
+ font-size: 10vh;
53
+ font-family: sans-serif;
54
+ padding: 40vh 0 40vh 0;
55
+ font-weight: bold;
56
+ text-align: center;
57
+ }
58
+
59
+ .modal-wide .modal-dialog {
60
+ width: 80%;
61
+ }
62
+
63
+ /* fix # anchors scrolling under the navbar
64
+ https://github.com/twbs/bootstrap/issues/1768#issuecomment-46519033
65
+ */
66
+ h1 {
67
+ position: relative;
68
+ z-index: -1;
69
+ }
70
+ h2 {
71
+ position: relative;
72
+ z-index: -2;
73
+ }
74
+ h1:before, h2:before {
75
+ display: block;
76
+ content: " ";
77
+ margin-top: -70px;
78
+ height: 70px;
79
+ visibility: hidden;
80
+ }
81
+
82
+ .p {
83
+ display: block;
84
+ margin-top: 15px;
85
+ }
86
+
87
+ .option-row,
88
+ .option-control {
89
+ vertical-align: top;
90
+ padding: 10px;
91
+ padding-top: 30px;
92
+ padding-left: 30px;
93
+ }
94
+
95
+ .option-info {
96
+ padding: 10px;
97
+ }
98
+
99
+ .chart-message {
100
+ display: block;
101
+ margin-top: 10px;
102
+ }
103
+
104
+ .container {
105
+ width: 90% !important;
106
+ }
107
+
108
+ #masthead h1 {
109
+ /*font-size: 30px;*/
110
+ line-height: 1;
111
+ padding-top: 30px;
112
+ }
113
+
114
+ #masthead .well {
115
+ margin-top:4%;
116
+ }
117
+
118
+ /* fix the navbar shifting when a modal is open */
119
+ /* https://github.com/twbs/bootstrap/issues/14040#issuecomment-159891033 */
120
+ body.modal-open{
121
+ width: 100% !important;
122
+ padding-right: 0 !important;
123
+/* overflow-y: scroll !important; */
124
+/* position: fixed !important;*/
125
+ overflow: visible;
126
+ }
127
+
128
+ /*
129
+ * Side navigation
130
+ *
131
+ * Scrollspy and affixed enhanced navigation to highlight sections and secondary
132
+ * sections of docs content.
133
+ */
134
+
135
+ .affix {
136
+ position: static;
137
+ top: 70px !important;
138
+ /*width: 220px;*/
139
+ }
140
+
141
+ .affix-top {
142
+ /*width: 220px;*/
143
+ }
144
+
145
+ .dashboard-sidebar {
146
+ max-height: calc(100% - 70px) !important;
147
+ overflow-y: auto;
148
+ /*width: 220px !important;*/
149
+ }
150
+
151
+ /* By default it's not affixed in mobile views, so undo that */
152
+ .dashboard-sidebar.affix {
153
+ position: static;
154
+ }
155
+
156
+ @media (min-width: 768px) {
157
+ .dashboard-sidebar {
158
+ padding-left: 20px;
159
+ }
160
+ }
161
+
162
+ /* First level of nav */
163
+ .dashboard-sidenav {
164
+ margin-top: 20px;
165
+ margin-bottom: 20px;
166
+ }
167
+
168
+ /* All levels of nav */
169
+ .dashboard-sidebar .nav > li > a {
170
+ display: block;
171
+ padding: 4px 20px;
172
+ font-size: 13px;
173
+ font-weight: 500;
174
+ color: #767676;
175
+ }
176
+ .dashboard-sidebar .nav > li > a:hover,
177
+ .dashboard-sidebar .nav > li > a:focus {
178
+ padding-left: 19px;
179
+ color: #563d7c;
180
+ text-decoration: none;
181
+ background-color: transparent;
182
+ border-left: 1px solid #563d7c;
183
+ }
184
+ .dashboard-sidebar .nav > .active > a,
185
+ .dashboard-sidebar .nav > .active:hover > a,
186
+ .dashboard-sidebar .nav > .active:focus > a {
187
+ padding-left: 18px;
188
+ font-weight: bold;
189
+ color: #563d7c;
190
+ background-color: transparent;
191
+ border-left: 2px solid #563d7c;
192
+ }
193
+
194
+ /* Nav: second level (shown on .active) */
195
+ .dashboard-sidebar .nav .nav {
196
+ display: none; /* Hide by default, but at >768px, show it */
197
+ padding-bottom: 10px;
198
+ }
199
+ .dashboard-sidebar .nav .nav > li > a {
200
+ padding-top: 1px;
201
+ padding-bottom: 1px;
202
+ padding-left: 30px;
203
+ font-size: 12px;
204
+ font-weight: normal;
205
+ }
206
+ .dashboard-sidebar .nav .nav > li > a:hover,
207
+ .dashboard-sidebar .nav .nav > li > a:focus {
208
+ padding-left: 29px;
209
+ }
210
+ .dashboard-sidebar .nav .nav > .active > a,
211
+ .dashboard-sidebar .nav .nav > .active:hover > a,
212
+ .dashboard-sidebar .nav .nav > .active:focus > a {
213
+ padding-left: 28px;
214
+ font-weight: 500;
215
+ }
216
+
217
+ .dropdown-menu {
218
+ min-width: 200px;
219
+ }
220
+ .dropdown-menu.columns-2 {
221
+ margin: 0;
222
+ padding: 0;
223
+ width: 400px;
224
+ }
225
+ .dropdown-menu li a {
226
+ padding: 5px 15px;
227
+ font-weight: 300;
228
+ }
229
+ .dropdown-menu.multi-column {
230
+ overflow-x: hidden;
231
+ }
232
+ .multi-column-dropdown {
233
+ list-style: none;
234
+ padding: 0;
235
+ }
236
+ .multi-column-dropdown li a {
237
+ display: block;
238
+ clear: both;
239
+ line-height: 1.428571429;
240
+ white-space: normal;
241
+ }
242
+ .multi-column-dropdown li a:hover {
243
+ text-decoration: none;
244
+ color: #f5f5f5;
245
+ background-color: #262626;
246
+ }
247
+ .scrollable-menu {
248
+ height: auto;
249
+ max-height: 80vh;
250
+ overflow-x: hidden;
251
+ }
252
+
253
+ /* Back to top (hidden on mobile) */
254
+ .back-to-top,
255
+ .dashboard-theme-toggle {
256
+ display: none;
257
+ padding: 4px 10px;
258
+ margin-top: 10px;
259
+ margin-left: 10px;
260
+ font-size: 12px;
261
+ font-weight: 500;
262
+ color: #999;
263
+ }
264
+ .back-to-top:hover,
265
+ .dashboard-theme-toggle:hover {
266
+ color: #563d7c;
267
+ text-decoration: none;
268
+ }
269
+ .dashboard-theme-toggle {
270
+ margin-top: 0;
271
+ }
272
+
273
+ @media (min-width: 768px) {
274
+ .back-to-top,
275
+ .dashboard-theme-toggle {
276
+ display: block;
277
+ }
278
+
279
+ /* Widen the fixed sidebar */
280
+ .dashboard-sidebar.affix,
281
+ .dashboard-sidebar.affix-top,
282
+ .dashboard-sidebar.affix-bottom {
283
+ width: 200px !important;
284
+ }
285
+
286
+ .dashboard-sidebar.affix {
287
+ position: fixed; /* Undo the static from mobile first approach */
288
+ top: 20px;
289
+ }
290
+
291
+ .dashboard-sidebar.affix-bottom {
292
+ position: absolute; /* Undo the static from mobile first approach */
293
+ }
294
+
295
+ .dashboard-sidebar.affix-bottom .dashboard-sidenav,
296
+ .dashboard-sidebar.affix .dashboard-sidenav {
297
+ margin-top: 0;
298
+ margin-bottom: 0;
299
+ }
300
+ }
301
+
302
+ /* Show and affix the side nav when space allows it */
303
+ @media (min-width: 992px) {
304
+ .dashboard-sidebar .nav > .active > ul {
305
+ display: block;
306
+ }
307
+
308
+ /* Widen the fixed sidebar */
309
+ .dashboard-sidebar.affix,
310
+ .dashboard-sidebar.affix-top,
311
+ .dashboard-sidebar.affix-bottom {
312
+ width: 200px !important;
313
+ }
314
+ .dashboard-sidebar.affix {
315
+ position: fixed; /* Undo the static from mobile first approach */
316
+ top: 20px;
317
+ }
318
+ .dashboard-sidebar.affix-bottom {
319
+ position: absolute; /* Undo the static from mobile first approach */
320
+ }
321
+ .dashboard-sidebar.affix-bottom .dashboard-sidenav,
322
+ .dashboard-sidebar.affix .dashboard-sidenav {
323
+ margin-top: 0;
324
+ margin-bottom: 0;
325
+ }
326
+ }
327
+
328
+ @media (min-width: 1200px) {
329
+ /* Widen the fixed sidebar again */
330
+ .dashboard-sidebar.affix-bottom,
331
+ .dashboard-sidebar.affix-top,
332
+ .dashboard-sidebar.affix {
333
+ width: 263px;
334
+ }
335
+ }
336
+ </style>
337
+
338
+ <!-- check which theme to use -->
339
+ <script type="text/javascript">
340
+ // --------------------------------------------------------------------
341
+ // urlOptions
342
+
343
+ var urlOptions = {
344
+ hash: '#',
345
+ theme: null,
346
+ help: null,
347
+ pan_and_zoom: false,
348
+ after: 0,
349
+ before: 0,
350
+ nowelcome: 0,
351
+ hasProperty: function(property) {
352
+ // console.log('checking property ' + property + ' of type ' + typeof(this[property]));
353
+ return typeof this[property] !== 'undefined';
354
+ }
355
+ };
356
+
357
+ function netdataPanAndZoomCallback(status, after, before) {
358
+ urlOptions.pan_and_zoom = status;
359
+ urlOptions.after = after;
360
+ urlOptions.before = before;
361
+ netdataHashUpdate();
362
+ }
363
+
364
+ function netdataHashUpdate() {
365
+ history.replaceState(null, '', netdataHash());
366
+ }
367
+
368
+ function netdataHash() {
369
+ var hash = urlOptions.hash;
370
+
371
+ if(urlOptions.pan_and_zoom === true) {
372
+ hash += ';after=' + urlOptions.after.toString() +
373
+ ';before=' + urlOptions.before.toString();
374
+ }
375
+
376
+ if(urlOptions.theme !== null)
377
+ hash += ';theme=' + urlOptions.theme.toString();
378
+
379
+ if(urlOptions.help !== null)
380
+ hash += ';help=' + urlOptions.help.toString();
381
+
382
+ return hash;
383
+ }
384
+
385
+ function netdataHashParse() {
386
+ var variables = document.location.hash.split(';');
387
+ var len = variables.length;
388
+ while(len--) {
389
+ if(len !== 0) {
390
+ var p = variables[len].split('=');
391
+ if(urlOptions.hasProperty(p[0]) && typeof p[1] !== 'undefined')
392
+ urlOptions[p[0]] = p[1];
393
+ }
394
+ else {
395
+ if(variables[len].length > 0)
396
+ urlOptions.hash = variables[len];
397
+ }
398
+ }
399
+
400
+ if(urlOptions.before > 0 && urlOptions.after > 0)
401
+ urlOptions.pan_and_zoom = true;
402
+
403
+ // console.log(urlOptions);
404
+ }
405
+
406
+ netdataHashParse();
407
+
408
+ // --------------------------------------------------------------------
409
+ // check options that should be processed before loading netdata.js
410
+
411
+ function loadLocalStorage(name) {
412
+ var ret = null;
413
+
414
+ try {
415
+ if(typeof Storage !== "undefined" && typeof localStorage === 'object')
416
+ ret = localStorage.getItem(name);
417
+ }
418
+ catch(error) {
419
+ ;
420
+ }
421
+
422
+ if(typeof ret === 'undefined' || ret === null)
423
+ return null;
424
+
425
+ // console.log('loaded: ' + name.toString() + ' = ' + ret.toString());
426
+
427
+ return ret;
428
+ }
429
+
430
+ function saveLocalStorage(name, value) {
431
+ // console.log('saving: ' + name.toString() + ' = ' + value.toString());
432
+ try {
433
+ if(typeof Storage !== "undefined" && typeof localStorage === 'object') {
434
+ localStorage.setItem(name, value.toString());
435
+ return true;
436
+ }
437
+ }
438
+ catch(error) {
439
+ ;
440
+ }
441
+
442
+ return false;
443
+ }
444
+
445
+ function getTheme(def) {
446
+ var ret = loadLocalStorage('netdataTheme');
447
+ if(typeof ret === 'undefined' || ret === null || ret === 'undefined')
448
+ return def;
449
+ else
450
+ return ret;
451
+ }
452
+
453
+ function setTheme(theme) {
454
+ if(theme === netdataTheme) return false;
455
+ return saveLocalStorage('netdataTheme', theme);
456
+ }
457
+
458
+ var netdataTheme = getTheme('slate');
459
+ var netdataShowHelp = true;
460
+
461
+ if(urlOptions.theme !== null) {
462
+ setTheme(urlOptions.theme);
463
+ netdataTheme = urlOptions.theme;
464
+ }
465
+ else
466
+ urlOptions.theme = netdataTheme;
467
+
468
+ if(urlOptions.help !== null) {
469
+ saveLocalStorage('options.show_help', urlOptions.help);
470
+ netdataShowHelp = urlOptions.help;
471
+ }
472
+ else {
473
+ urlOptions.help = loadLocalStorage('options.show_help');
474
+ }
475
+
476
+ // --------------------------------------------------------------------
477
+ // registry call back to render my-netdata menu
478
+
479
+ var netdataRegistryCallback = function(machines_array) {
480
+ var el = '';
481
+ var a1 = '';
482
+ var found = 0;
483
+
484
+ if(machines_array) {
485
+ function name_comparator_desc(a, b) {
486
+ if (a.name > b.name) return -1;
487
+ if (a.name < b.name) return 1;
488
+ return 0;
489
+ }
490
+
491
+ var machines = machines_array.sort(name_comparator_desc);
492
+ var len = machines.length;
493
+ while(len--) {
494
+ var u = machines[len];
495
+ found++;
496
+ el += '<li id="registry_server_' + u.guid + '"><a class="registry_link" href="' + u.url + '" onClick="return gotoServerModalHandler(\'' + u.guid + '\');">' + u.name + '</a></li>';
497
+ a1 += '<li id="registry_action_' + u.guid + '"><a href="#" onclick="deleteRegistryModalHandler(\'' + u.guid + '\',\'' + u.name + '\',\'' + u.url + '\'); return false;"><i class="fa fa-trash-o" aria-hidden="true" style="color: #999;"></i></a></li>';
498
+ }
499
+ }
500
+
501
+ if(!found) {
502
+ if(machines)
503
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">your netdata server list is empty...</a></li>';
504
+ else
505
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">failed to contact the registry...</a></li>';
506
+
507
+ a1 += '<li><a href="#" onClick="return false;"> </a></li>';
508
+
509
+ el += '<li role="separator" class="divider"></li>' +
510
+ '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
511
+ '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
512
+ '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
513
+ a1 += '<li role="separator" class="divider"></li>' +
514
+ '<li><a href="#"> </a></li>' +
515
+ '<li><a href="#"> </a></li>'+
516
+ '<li><a href="#"> </a></li>';
517
+ }
518
+
519
+ el += '<li role="separator" class="divider"></li>';
520
+ a1 += '<li role="separator" class="divider"></li>';
521
+
522
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
523
+ a1 += '<li><a href="#" style="color: #999;" onclick="switchRegistryModalHandler(); return false;"><i class="fa fa-cog" aria-hidden="true" style="color: #999;"></i></a></li>'
524
+
525
+ document.getElementById('mynetdata_servers').innerHTML = el;
526
+ document.getElementById('mynetdata_servers2').innerHTML = el;
527
+ document.getElementById('mynetdata_actions1').innerHTML = a1;
528
+
529
+ gotoServerInit();
530
+ };
531
+
532
+ </script>
533
+
534
+ <!-- load the dashboard manager - it will do the rest -->
535
+ <script type="text/javascript" src="dashboard.js?v41"></script>
536
</head>
537
<body data-spy="scroll" data-target="#sidebar">
538
- <div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
539
- netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>
540
- </div>
541
- <script type="text/javascript">
542
- // change the loadOverlay colors ASAP to match the theme
543
- document.getElementById('loadOverlay').style = (urlOptions.theme === 'slate')?"background-color:#272b30; color: #373b40;":"background-color:#fff; color: #ddd;";
544
- </script>
545
- <nav class="navbar navbar-default navbar-fixed-top" role="banner">
546
- <div class="container">
547
- <nav id="mynetdata_nav" class="collapse navbar-collapse navbar-left hidden-sm hidden-xs" role="navigation" style="padding-right: 20px;">
548
- <ul class="nav navbar-nav">
549
- <li class="dropdown">
550
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
551
- <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu">
552
- <div class="row">
553
- <div class="col-sm-6" style="width: 85%; padding-right: 0;">
554
- <ul id="mynetdata_servers" class="multi-column-dropdown">
555
- <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
556
- </ul>
557
- </div>
558
- <div class="col-sm-3 hidden-xs" style="width: 15%; padding-left: 0;">
559
- <ul id="mynetdata_actions1" class="multi-column-dropdown">
560
- <li style="color: #999;"> </li>
561
- </ul>
562
- </div>
563
- </div>
564
- </ul>
565
- </li>
566
- </ul>
567
- </nav>
568
- <div class="navbar-header">
569
- <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
570
- <span class="sr-only">Toggle navigation</span>
571
- <span class="icon-bar"></span>
572
- <span class="icon-bar"></span>
573
- <span class="icon-bar"></span>
574
- </button>
575
- <a href="/" class="navbar-brand" id="hostname">netdata</a>
576
- </div>
577
- <nav class="collapse navbar-collapse navbar-right" role="navigation">
578
- <ul class="nav navbar-nav">
579
- <li class="hidden-sm"><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-cog"></i> settings</a></li>
580
- <li class="hidden-sm"><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank"><i class="fa fa-github"></i> community</a></li>
581
- <li class="hidden-sm" id="updateButton"><a href="#" class="btn" data-toggle="modal" data-target="#updateModal"><i class="fa fa-cloud-download"></i> update</a></li>
582
- <li class="hidden-sm"><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
583
- <li class="dropdown hidden-md hidden-lg hidden-xs">
584
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">Menu <strong class="caret"></strong></a>
585
- <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
586
- <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-cog"></i> settings</a></li>
587
- <li><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank"><i class="fa fa-github"></i> community</a></li>
588
- <li><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
589
- </ul>
590
- </li>
591
- <li class="dropdown hidden-sm hidden-md hidden-lg">
592
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
593
- <ul id="mynetdata_servers2" class="dropdown-menu scrollable-menu inpagemenu" role="menu">
594
- <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
595
- </ul>
596
- </li>
597
- </ul>
598
- </nav>
599
- </nav>
600
- </div>
601
- </nav>
602
-
603
- <div id="masthead" style="display: none;">
604
- <div class="container">
605
- <div class="row">
606
- <div class="col-md-7">
607
- <h1>Netdata
608
- <p class="lead">Real-time performance monitoring, in the greatest possible detail</p>
609
- </h1>
610
- </div>
611
- <div class="col-md-5">
612
- <div class="well well-lg">
613
- <div class="row">
614
- <div class="col-md-6">
615
- <b>Drag</b> charts to pan.
616
- <b>Shift + wheel</b> on them, to zoom in and out.
617
- <b>Double-click</b> on them, to reset.
618
- <b>Hover</b> on them too!
619
- </div>
620
- <div class="col-md-6">
621
- <div data-netdata="system.intr" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dygraph-type="line" data-dygraph-strokewidth="3" data-dygraph-smooth="true" data-dygraph-highlightcirclesize="6" data-after="-90" data-height="60px" data-colors="#C66"></div>
622
- </div>
623
- </div>
624
- </div>
625
- </div>
626
- </div>
627
- </div>
628
- </div>
629
-
630
- <div class="container">
631
- <div class="row">
632
- <div class="col-md-10" role="main">
633
- <div id="charts_div"></div>
634
- </div>
635
- <div class="col-md-2" role="complementary">
636
- <nav class="dashboard-sidebar hidden-print hidden-xs hidden-sm" id="sidebar" role="menu"></nav>
637
- </div>
638
- </div>
639
- </div>
640
-
641
- <div id="footer" class="container" style="display: none;">
642
- <div class="row">
643
- <div class="col-md-10" role="main">
644
- <div class="p">
645
- <big><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></big><br/>
646
- <i class="fa fa-copyright"></i> Copyright 2016, Costa Tsaousis.<br/>
647
- Released under <a href="http://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GPL v3 or later</a>.<br/>
648
- </div>
649
- <div class="p">
650
- <small>
651
- <a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a> re-distributes these software tools:
652
-
653
- <i class="fa fa-circle"></i> The excellent <a href="http://dygraphs.com/" target="_blank">Dygraphs.com</a> web chart library,
654
- <i class="fa fa-copyright"></i> Copyright 2009, Dan Vanderkam, <a href="http://dygraphs.com/legal.html" target="_blank">MIT License</a>
655
-
656
- <i class="fa fa-circle"></i> <a href="http://omnipotent.net/jquery.sparkline/" target="_blank">jQuery Sparklines</a> web chart library,
657
- <i class="fa fa-copyright"></i> Copyright 2009-2012, Splunk Inc., <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">New BSD License</a>
658
-
659
- <i class="fa fa-circle"></i> <a href="http://benpickles.github.io/peity/" target="_blank">Peity</a> web chart library,
660
- <i class="fa fa-copyright"></i> Copyright 2009-2015, Ben Pickles, <a href="https://github.com/benpickles/peity/blob/master/MIT-LICENCE" target="_blank">MIT License</a>
661
-
662
- <i class="fa fa-circle"></i> <a href="https://rendro.github.io/easy-pie-chart/" target="_blank">Easy Pie Chart</a> web chart library,
663
- <i class="fa fa-copyright"></i> Copyright 2013, Robert Fleischmann, <a href="https://github.com/rendro/easy-pie-chart/blob/master/LICENSE" target="_blank">MIT License</a>
664
-
665
- <i class="fa fa-circle"></i> <a href="http://bernii.github.io/gauge.js/" target="_blank">Gauge.js</a> web chart library,
666
- <i class="fa fa-copyright"></i> Copyright, Bernard Kobos, <a href="http://bernii.github.io/gauge.js/" target="_blank">MIT License</a>
667
-
668
- <i class="fa fa-circle"></i> <a href="https://jquery.org/" target="_blank">jQuery</a>,
669
- <i class="fa fa-copyright"></i> Copyright 2015, jQuery Foundation, <a href="https://jquery.org/license/" target="_blank">MIT License</a>
670
-
671
- <i class="fa fa-circle"></i> <a href="http://getbootstrap.com/getting-started/" target="_blank">Bootstrap</a>,
672
- <i class="fa fa-copyright"></i> Copyright 2015, Twitter, <a href="http://getbootstrap.com/getting-started/#license-faqs" target="_blank">MIT License</a>
673
-
674
- <i class="fa fa-circle"></i> <a href="http://www.bootstraptoggle.com/" target="_blank">Bootstrap Toggle</a>,
675
- <i class="fa fa-copyright"></i> Copyright (c) 2011-2014 Min Hur, The New York Times Company, <a href="https://github.com/minhur/bootstrap-toggle/blob/master/LICENSE" target="_blank">MIT License</a>
676
-
677
- <i class="fa fa-circle"></i> <a href="https://jamesflorentino.github.io/nanoScrollerJS/" target="_blank">NanoScroller</a>,
678
- <i class="fa fa-copyright"></i> Copyright 2012, James Florentino, <a href="https://github.com/jamesflorentino/nanoScrollerJS/blob/master/LICENSE" target="_blank">MIT License</a>
679
-
680
- <i class="fa fa-circle"></i> <a href="https://github.com/marcj/css-element-queries" target="_blank">CSS Element Queries</a>,
681
- <i class="fa fa-copyright"></i> Copyright Marc J. Schmidt, <a href="https://github.com/marcj/css-element-queries/blob/master/LICENSE" target="_blank">MIT License</a>
682
-
683
- <i class="fa fa-circle"></i> <a href="https://fortawesome.github.io/Font-Awesome/" target="_blank">FontAwesome</a>,
684
- <i class="fa fa-copyright"></i> Created by Dave Gandy, Font: <a href="http://scripts.sil.org/OFL" target="_blank">SIL OFL 1.1 License</a>, CSS: <a href="http://opensource.org/licenses/mit-license.html" target="_blank">MIT License</a>
685
-
686
- <i class="fa fa-circle"></i> <a href="http://www.iconsdb.com/soylent-red-icons/seo-performance-icon.html" target="_blank">IconsDB.com Icons</a>, Icons provided as CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
687
-
688
- <i class="fa fa-circle"></i> <a href="http://morrisjs.github.io/morris.js/" target="_blank">morris.js</a>,
689
- <i class="fa fa-copyright"></i> Copyright 2013, Olly Smith, <a href="http://morrisjs.github.io/morris.js/" target="_blank">Simplified BSD License</a>
690
-
691
- <i class="fa fa-circle"></i> <a href="http://raphaeljs.com/" target="_blank">Raphaël</a>,
692
- <i class="fa fa-copyright"></i> Copyright 2008, Dmitry Baranovskiy, <a href="http://raphaeljs.com/license.html" target="_blank">MIT License</a>
693
-
694
- <i class="fa fa-circle"></i> <a href="http://C3js.org/" target="_blank">C3</a>,
695
- <i class="fa fa-copyright"></i> Copyright 2013, Masayuki Tanaka, <a href="https://github.com/masayuki0812/c3/blob/master/LICENSE" target="_blank">MIT License</a>
696
-
697
- <i class="fa fa-circle"></i> <a href="http://D3js.org/" target="_blank">D3</a>,
698
- <i class="fa fa-copyright"></i> Copyright 2015, Mike Bostock, <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD License</a>
699
-
700
- </small>
701
- </div>
702
- </div>
703
- </div>
704
- </div>
705
-
706
- <div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel">
707
- <div class="modal-dialog modal-lg" role="document">
708
- <div class="modal-content">
709
- <div class="modal-header">
710
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
711
- <h4 class="modal-title" id="welcomeModalLabel">Welcome!</h4>
712
- </div>
713
- <div class="modal-body">
714
- <div class="p">
715
- <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> is the fastest way to visualize metrics. It is a resource efficient, highly optimized system for collecting and visualizing any type of real-time time series data, from CPU usage, disk activity, SQL queries, API calls, web site visitors, etc.
716
- </div>
717
- <div class="p">
718
- <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> tries to visualize the truth of <b>now</b>, in its <b>greatest detail</b>, so that you can get insights of what is happening now and what just happened, on your systems and applications.
719
- </div>
720
- <div class="p">
721
- To make a chart in <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b>, you just need a <b>number</b>. Just a number you can read somehow. <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> will turn this number to a real time, interactive, web chart. For collecting these numbers, it supports <a href="https://github.com/firehol/netdata/wiki/External-Plugins" target="_blank">external plugins</a>, even <a href="https://github.com/firehol/netdata/wiki/General-Info---charts.d" target="_blank">shell</a> or <a href="https://github.com/firehol/netdata/wiki/General-Info---charts.d" target="_blank">node.js</a> plugins. Any computer program, in any language, that can print a few lines of text on its standard output, can be a netdata data collector.
722
- </div>
723
- <div class="p">
724
- <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> can embed charts everywhere, like this one <div data-netdata="system.cpu" data-dimensions="system" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-show-value-of-system-at="system.cpu.system.modal.1"></div> (my CPU system usage which is <span id="system.cpu.system.modal.1" style="display: inline-block; width: 40px; text-align: right;"></span>%),
725
- or this one <div data-netdata="ipv4.tcppackets" data-dimensions="received" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-show-value-of-received-at="ipv4.tcppackets.received.modal.1"></div> (my IPv4 received TCP packets, which are <span id="ipv4.tcppackets.received.modal.1" style="display: inline-block; width: 60px; text-align: right;"></span>/second).
726
- </div>
727
- <div class="p">
728
- You can have <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> charts on your site too. Just give it a <code>div</code> and a real time chart, zoomable and draggable will appear (try it even on these tiny ones - <b>drag</b> them to pan horizontally, <b>shift + drag</b> to zoom in, on <b>chrome shift + mouse wheel</b> to zoom in/out, <b>double click</b> on them to reset them - don't be afraid of <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> performance - <a href="https://github.com/firehol/netdata/wiki/Performance" target="_blank">a raspberry pi 2 can sustain 300 charts updates per second</a>!).
729
- </div>
730
- <div class="p">
731
- For more information please refer to the <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata wiki</a></b>.
732
- </div>
733
- </div>
734
- <div class="modal-footer">
735
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
736
- </div>
737
- </div>
738
- </div>
739
- </div>
740
-
741
- <div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel">
742
- <div class="modal-dialog modal-lg" role="document">
743
- <div class="modal-content">
744
- <div class="modal-header">
745
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
746
- <h4 class="modal-title" id="helpModalLabel">Dashboard Help</h4>
747
- </div>
748
- <div class="modal-body">
749
-
750
- <h4>Dygraphs (line, area and stacked area charts)</h4>
751
-
752
- <!-- Nav tabs -->
753
- <ul class="nav nav-tabs" role="tablist">
754
- <li role="presentation" class="active"><a href="#help_mouse" aria-controls="help_mouse" role="tab" data-toggle="tab">Mouse Interface</a></li>
755
- <li role="presentation"><a href="#help_touch" aria-controls="help_touch" role="tab" data-toggle="tab">Touch Interface</a></li>
756
- </ul>
757
-
758
- <!-- Tab panes -->
759
- <div class="tab-content">
760
- <div role="tabpanel" class="tab-pane active" id="help_mouse">
761
- <div class="p">
762
- <h4>Mouse Over / Hover</h4>
763
- Mouse over on a chart to show, at its legend, the values for the timestamp under the mouse (the chart will also highlight the point at the chart).
764
- <br/>
765
- All the other visible charts will also show and highlight their values for the same timestamp.
766
- </div>
767
- <hr/>
768
- <div class="p">
769
- <h4>Drag Chart Contents</h4>
770
- Drag the contents of a chart to pan it horizontally.
771
- <br/>
772
- All the charts will follow soon after you let the chart alone (this little delay is by design: it speeds up your browser and lets you focus on what you are exploring).
773
- <br/>
774
- Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double click</b> a panned chart.
775
- </div>
776
- <hr/>
777
- <div class="p">
778
- <h4>Double Click</h4>
779
- Double Click a chart to reset all the charts to their default auto-refreshing state.
780
- </div>
781
- <hr/>
782
- <div class="p">
783
- <h4>SHIFT + Drag</h4>
784
- While pressing the shift key, click on the contents of a chart and move the mouse to select an area, to zoom in. The other charts will follow too. Zooming is performed in two phases:
785
- <ul>
786
- <li>The already loaded chart contents are zoomed (low resolution)</li>
787
- <li>New data are transferred from the netdata server, to refresh the chart with possibly more detail.</li>
788
- </ul>
789
- Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
790
- </div>
791
- <hr/>
792
- <div class="p">
793
- <h4>SHIFT + Mouse Wheel <small>(does not work on firefox and IE/Edge)</small></h4>
794
- While pressing the shift key and the mouse pointer is over the contents of a chart, scroll the mouse wheel to zoom in or out. This kind of zooming is aligned to center below the mouse pointer. The other charts will follow too.
795
- <br/>
796
- Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
797
- </div>
798
- <hr/>
799
- <div class="p">
800
- <h4>Legend Operations</h4>
801
- Click on the label or value of a dimension, will select / un-select this dimension.
802
- <br/>
803
- You can press any of the SHIFT or CONTROL keys and then click on legend labels or values, to select / un-select multiple dimensions.
804
- </div>
805
- </div>
806
- <div role="tabpanel" class="tab-pane" id="help_touch">
807
- <div class="p">
808
- <h4>Single Tap</h4>
809
- Single Tap on the contents of a chart to show, at its legend, the values for the timestamp tapped (the chart will also highlight the point at the chart).
810
- <br/>
811
- All the other visible charts will also show and highlight their values for the same timestamp.
812
- </div>
813
- <hr/>
814
- <div class="p">
815
- <h4>Drag Chart Contents</h4>
816
- Touch and Drag the contents of a chart to pan it horizontally.
817
- <br/>
818
- All the charts will follow soon after you let the chart alone (this little delay is by design: it speeds up your browser and lets you focus on what you are exploring).
819
- <br/>
820
- Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double tap</b> a panned chart.
821
- </div>
822
- <hr/>
823
- <div class="p">
824
- <h4>Double Tap</h4>
825
- Double tap a chart to reset all the charts to their default auto-refreshing state.
826
- </div>
827
- <hr/>
828
- <div class="p">
829
- <h4>Zoom <small>(does not work on firefox and IE/Edge)</small></h4>
830
- With two fingers, zoom in or out.
831
- <br/>
832
- Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
833
- </div>
834
- <hr/>
835
- <div class="p">
836
- <h4>Legend Operations</h4>
837
- Tap on the label or value of a dimension, will select / un-select this dimension.
838
- </div>
839
- </div>
840
- </div>
841
- </div>
842
- <div class="modal-footer">
843
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
844
- </div>
845
- </div>
846
- </div>
847
- </div>
848
-
849
- <div class="modal fade" id="optionsModal" tabindex="-1" role="dialog" aria-labelledby="optionsModalLabel">
850
- <div class="modal-dialog modal-lg" role="document">
851
- <div class="modal-content">
852
- <div class="modal-header">
853
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
854
- <h4 class="modal-title" id="optionsModalLabel">netdata dashboard options</h4>
855
- </div>
856
- <div class="modal-body">
857
- <center>
858
- <small style="color: #BBBBBB;">These are browser settings. Each viewer has its own. They do not affect the operation of your netdata server.
859
- <br/>
860
- Settings take effect immediately and are saved permanently to browser local storage (except the refresh on focus / always option).
861
- <br/>
862
- To reset all options (including charts sizes) to their defaults, click <a href="#" onclick="resetDashboardOptions(); return false;">here</a>.</small>
863
- </center>
864
- <div style="padding: 10px;"></div>
865
-
866
- <!-- Nav tabs -->
867
- <ul class="nav nav-tabs" role="tablist">
868
- <li role="presentation" class="active"><a href="#settings_performance" aria-controls="settings_performance" role="tab" data-toggle="tab">Performance</a></li>
869
- <li role="presentation"><a href="#settings_sync" aria-controls="settings_sync" role="tab" data-toggle="tab">Synchronization</a></li>
870
- <li role="presentation"><a href="#settings_visual" aria-controls="settings_visual" role="tab" data-toggle="tab">Visual</a></li>
871
- </ul>
872
-
873
- <!-- Tab panes -->
874
- <div class="tab-content">
875
- <div role="tabpanel" class="tab-pane active" id="settings_performance">
876
- <form id="optionsForm1" method="get" class="form-horizontal">
877
- <div class="form-group">
878
- <table>
879
- <tr class="option-row">
880
- <td class="option-control"><input id="stop_updates_when_focus_is_lost" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="On Focus" data-off="Always" data-width="110px"></td>
881
- <td class="option-info"><strong>When to refresh the charts?</strong><br/>
882
- <small>When set to <b>On Focus</b>, the charts will stop being updated if the page / tab does not have the focus of the user. When set to <b>Always</b>, the charts will always be refreshed. Set it to <b>On Focus</b> it to lower the CPU requirements of the browser (and extend the battery of laptops and tablets) when this page does not have your focus. Set to <b>Always</b> to work on another window (i.e. change the settings of something) and have the charts auto-refresh in this window.</small>
883
- </td>
884
- </tr>
885
- <tr class="option-row">
886
- <td class="option-control">
887
- <input id="eliminate_zero_dimensions" type="checkbox" checked data-toggle="toggle" data-on="Non Zero" data-off="All" data-width="110px">
888
- </td>
889
- <td class="option-info"><strong>Which dimensions to show?</strong><br/>
890
- <small>When set to <b>Non Zero</b>, dimensions that have all their values (within the current view) set to zero will not be transferred from the netdata server (except if all dimensions of the chart are zero, in which case this setting does nothing - all dimensions are transferred and shown). When set to <b>All</b>, all dimensions will always be shown. Set it to <b>Non Zero</b> to lower the data transferred between netdata and your browser, lower the CPU requirements of your browser (fewer lines to draw) and increase the focus on the legends (fewer entries at the legends).</small>
891
- </td>
892
- </tr>
893
- <tr class="option-row">
894
- <td class="option-control"><input id="destroy_on_hide" type="checkbox" data-toggle="toggle" data-on="Destroy" data-off="Hide" data-width="110px"></td>
895
- <td class="option-info"><strong>How to handle hidden charts?</strong><br/>
896
- <small>When set to <b>Destroy</b>, charts that are not in the current viewport of the browser (are above, or below the visible area of the page), will be destroyed and re-created if and when they become visible again. When set to <b>Hide</b>, the not-visible charts will be just hidden, to simplify the DOM and speed up your browser. Set it to <b>Destroy</b>, to lower the memory requirements of your browser. Set it to <b>Hide</b> for smoother page scrolling.</small>
897
- </td>
898
- </tr>
899
- </table>
900
- </div>
901
- </form>
902
- </div>
903
- <div role="tabpanel" class="tab-pane" id="settings_sync">
904
- <form id="optionsForm2" method="get" class="form-horizontal">
905
- <div class="form-group">
906
- <table>
907
- <tr class="option-row">
908
- <td class="option-control"><input id="parallel_refresher" type="checkbox" checked data-toggle="toggle" data-on="Parallel" data-off="Sequential" data-width="110px"></td>
909
- <td class="option-info"><strong>Which chart refresh policy to use?</strong><br/>
910
- <small>When set to <b>parallel</b>, visible charts are refreshed in parallel (all queries are sent to netdata server in parallel) and are rendered asynchronously. When set to <b>sequential</b> charts are refreshed one after another. Set it to parallel if your browser can cope with it (most modern browsers do), set it to sequential if you work on an older/slower computer.</small>
911
- </td>
912
- </tr>
913
- <tr class="option-row" id="concurrent_refreshes_row">
914
- <td class="option-control"></td>
915
- <td class="option-info">
916
- <table>
917
- <tr class="option-row">
918
- <td class="option-control">
919
- <input id="concurrent_refreshes" type="checkbox" checked data-toggle="toggle" data-on="Resync" data-off="Best Effort" data-width="110px">
920
- </td>
921
- <td class="option-info">
922
- <strong>Shall we re-sync chart refreshes?</strong><br/>
923
- <small>When set to <b>Resync</b>, the dashboard will attempt to re-synchronize all the charts so that they are refreshed concurrently. When set to <b>Best Effort</b>, each chart may be refreshed with a little time difference to the others. Normally, the dashboard starts refreshing them in parallel, but depending on the speed of your computer and the network latencies, charts start having a slight time difference. Setting this to <b>Resync</b> will attempt to re-synchronize the charts on every update. Setting it to <b>Best Effort</b> may lower the pressure on your browser and the network.</small>
924
- </td>
925
- </tr>
926
- </table>
927
- </td>
928
- </tr>
929
- <tr class="option-row">
930
- <td class="option-control"><input id="sync_selection" type="checkbox" checked data-toggle="toggle" data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
931
- <td class="option-info"><strong>Sync hover selection on all charts?</strong><br/>
932
- <small>When enabled, a selection on one chart will automatically select the same time on all other visible charts and the legends of all visible charts will be updated to show the selected values. When disabled, only the chart getting the user's attention will be selected. Enable it to get better insights of the data. Disable it if you are on a very slow computer that cannot actually do it.</small>
933
- </td>
934
- </tr>
935
- <tr class="option-row">
936
- <td class="option-control"><input id="sync_pan_and_zoom" type="checkbox" checked data-toggle="toggle" data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
937
- <td class="option-info"><strong>Sync pan and zoom on all charts?</strong><br/>
938
- <small>When enabled, pan and zoom operations on a chart will be replicated to all charts (even the ones that are not currently visible - of course only when they will become visible). When disabled, pan and zoom operations will not be propagated to other charts.</small>
939
- </td>
940
- </tr>
941
- </table>
942
- </div>
943
- </form>
944
- </div>
945
- <div role="tabpanel" class="tab-pane" id="settings_visual">
946
- <form id="optionsForm3" method="get" class="form-horizontal">
947
- <div class="form-group">
948
- <table>
949
- <tr class="option-row">
950
- <td class="option-control"><input id="netdata_theme_control" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="Dark" data-off="White" data-width="110px"></td>
951
- <td class="option-info"><strong>Which theme to use?</strong><br/>
952
- <small>Netdata comes with two themes: <b>Dark</b> (the default) and <b>White</b>.
953
- <br/>
954
- <b>Switching this will reload the dashboard</b>.
955
- </small>
956
- </td>
957
- </tr>
958
- <tr class="option-row">
959
- <td class="option-control"><input id="show_help" type="checkbox" checked data-toggle="toggle" data-on="Help Me" data-off="No Help" data-width="110px"></td>
960
- <td class="option-info"><strong>Do you need help?</strong><br/>
961
- <small>Netdata can show some help in some areas to help you use the dashboard. If all these balloons bother you, disable them using this switch.
962
- <br/>
963
- <b>Switching this will reload the dashboard</b>.
964
- </small>
965
- </td>
966
- </tr>
967
- <tr class="option-row">
968
- <td class="option-control"><input id="pan_and_zoom_data_padding" type="checkbox" checked data-toggle="toggle" data-on="Pad" data-off="Don't Pad" data-width="110px"></td>
969
- <td class="option-info"><strong>Enable data padding when panning and zooming?</strong><br/>
970
- <small>When set to <b>Pad</b> the charts will be padded with more data, both before and after the visible area, thus giving the impression the whole database is loaded. This padding will happen only after the first pan or zoom operation on the chart (initially all charts have only the visible data). When set to <b>Don't Pad</b> only the visible data will be transfered from the netdata server, even after the first pan and zoom operation.</small>
971
- </td>
972
- </tr>
973
- <tr class="option-row">
974
- <td class="option-control"><input id="smooth_plot" type="checkbox" checked data-toggle="toggle" data-on="Smooth" data-off="Rough" data-width="110px"></td>
975
- <td class="option-info"><strong>Enable Bézier lines on charts?</strong><br/>
976
- <small>When set to <b>Smooth</b> the charts libraries that support it, will plot smooth curves instead of simple straight lines to connect the points.
977
- <br/>
978
- Keep in mind <a href="http://dygraphs.com" target="_blank">dygraphs</a>, the main charting library in netdata dashboards, can only smooth line charts. It cannot smooth area or stacked charts. When set to <b>Rough</b>, this setting can lower the CPU resources consumed by your browser.</small>
979
- </td>
980
- </tr>
981
- </table>
982
- </div>
983
- </form>
984
- </div>
985
- </div>
986
- </div>
987
- <div class="modal-footer">
988
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
989
- </div>
990
- </div>
991
- </div>
992
- </div>
993
-
994
-
995
- <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel">
996
- <div class="modal-dialog" role="document">
997
- <div class="modal-content">
998
- <div class="modal-header">
999
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1000
- <h4 class="modal-title" id="updateModalLabel">Update Check</h4>
1001
- </div>
1002
- <div class="modal-body">
1003
- Your netdata version: <b><code><span id="netdataVersion">Unknown</span></code></b>
1004
- <br/>
1005
- <div style="padding: 10px;"></div>
1006
- <div id="versionCheckLog">Not checked yet. Please press the Check Now button.</div>
1007
- </div>
1008
- <div class="modal-footer">
1009
- <a href="#" onclick="notifyForUpdate(true); return false;" type="button" class="btn btn-default">Check Now</a>
1010
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1011
- </div>
1012
- </div>
1013
- </div>
1014
- </div>
1015
-
1016
- <div class="modal fade" id="deleteRegistryModal" tabindex="-1" role="dialog" aria-labelledby="deleteRegistryModalLabel">
1017
- <div class="modal-dialog" role="document">
1018
- <div class="modal-content">
1019
- <div class="modal-header">
1020
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1021
- <h4 class="modal-title" id="deleteRegistryModalLabel">Delete <span id="deleteRegistryServerName"></span>?</h4>
1022
- </div>
1023
- <div class="modal-body">
1024
- You are about to delete, from your personal list of netdata servers, the following server:
1025
- <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
1026
- <b><span id="deleteRegistryServerName2"></span></b>
1027
- <br/>
1028
- <b><span id="deleteRegistryServerURL"></span></b>
1029
- </p>
1030
- Are you sure you want to do this?
1031
- <br/>
1032
- <div style="padding: 10px;"></div>
1033
- <small>Keep in mind, this server will be added back if and when you visit it again.</small>
1034
- <br/>
1035
- <div id="deleteRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
1036
- </div>
1037
- <div class="modal-footer">
1038
- <button type="button" class="btn btn-success" data-dismiss="modal">keep it</button>
1039
- <a href="#" onclick="notifyForDeleteRegistry(true); return false;" type="button" class="btn btn-danger">delete it</a>
1040
- </div>
1041
- </div>
1042
- </div>
1043
- </div>
1044
-
1045
- <div class="modal fade" id="switchRegistryModal" tabindex="-1" role="dialog" aria-labelledby="switchRegistryModalLabel">
1046
- <div class="modal-dialog" role="document">
1047
- <div class="modal-content">
1048
- <div class="modal-header">
1049
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1050
- <h4 class="modal-title" id="switchRegistryModalLabel">Switch Netdata Registry Identity</h4>
1051
- </div>
1052
- <div class="modal-body">
1053
- You can copy and paste the following ID to all your browsers (e.g. work and home).
1054
- <br/>
1055
- All the browsers with the same ID will identify <b>you</b>, so please don't share this with others.
1056
- <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
1057
- <form action="#">
1058
- <input type="text" class="form-control" id="switchRegistryPersonGUID" placeholder="your personal ID" maxlength="36" autocomplete="off" style="text-align: center; font-size: 1.4em;">
1059
- </form>
1060
- </p>
1061
- Either copy this ID and paste it to another browser, or paste here the ID you have taken from another browser.
1062
- <p style="padding-top: 10px;"><small>
1063
- Keep in mind that:
1064
- <ul>
1065
- <li>when you switch ID, your previous ID will be lost forever - this is irreversible.</li>
1066
- <li>both IDs (your old and the new) must list this netdata at their personal lists.</li>
1067
- <li>both IDs have to be known by the registry: <b><span id="switchRegistryURL"></span></b>.</li>
1068
- <li>to get a new ID, just clear your browser cookies.</li>
1069
- </ul>
1070
- </small></p>
1071
- <div id="switchRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
1072
- </div>
1073
- <div class="modal-footer">
1074
- <button type="button" class="btn btn-success" data-dismiss="modal">cancel</button>
1075
- <a href="#" onclick="notifyForSwitchRegistry(true); return false;" type="button" class="btn btn-danger">impersonate</a>
1076
- </div>
1077
- </div>
1078
- </div>
1079
- </div>
1080
-
1081
- <div class="modal fade" id="gotoServerModal" tabindex="-1" role="dialog" aria-labelledby="gotoServerModalLabel">
1082
- <div class="modal-dialog" role="document">
1083
- <div class="modal-content">
1084
- <div class="modal-header">
1085
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1086
- <h4 class="modal-title" id="gotoServerModalLabel"><span id="gotoServerName"></span></h4>
1087
- </div>
1088
- <div class="modal-body">
1089
- Checking known URLs for this server...
1090
- <div style="padding-top: 20px;">
1091
- <table id="gotoServerList">
1092
- </table>
1093
- </div>
1094
- <p style="padding-top: 10px;"><small>
1095
- Checks may fail if you are viewing an HTTPS page and the server to be checked is HTTP only.
1096
- </small></p>
1097
- <div id="gotoServerResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
1098
- </div>
1099
- <div class="modal-footer">
1100
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1101
- </div>
1102
- </div>
1103
- </div>
1104
- </div>
538
+ <div id="loadOverlay" class="loadOverlay" style="background-color: #888; color: #888;">
539
+ netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>
540
+ </div>
541
+ <script type="text/javascript">
542
+ // change the loadOverlay colors ASAP to match the theme
543
+ document.getElementById('loadOverlay').style = (urlOptions.theme === 'slate')?"background-color:#272b30; color: #373b40;":"background-color:#fff; color: #ddd;";
544
+ </script>
545
+ <nav class="navbar navbar-default navbar-fixed-top" role="banner">
546
+ <div class="container">
547
+ <nav id="mynetdata_nav" class="collapse navbar-collapse navbar-left hidden-sm hidden-xs" role="navigation" style="padding-right: 20px;">
548
+ <ul class="nav navbar-nav">
549
+ <li class="dropdown">
550
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
551
+ <ul class="dropdown-menu scrollable-menu inpagemenu multi-column columns-2" role="menu">
552
+ <div class="row">
553
+ <div class="col-sm-6" style="width: 85%; padding-right: 0;">
554
+ <ul id="mynetdata_servers" class="multi-column-dropdown">
555
+ <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
556
+ </ul>
557
+ </div>
558
+ <div class="col-sm-3 hidden-xs" style="width: 15%; padding-left: 0;">
559
+ <ul id="mynetdata_actions1" class="multi-column-dropdown">
560
+ <li style="color: #999;"> </li>
561
+ </ul>
562
+ </div>
563
+ </div>
564
+ </ul>
565
+ </li>
566
+ </ul>
567
+ </nav>
568
+ <div class="navbar-header">
569
+ <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
570
+ <span class="sr-only">Toggle navigation</span>
571
+ <span class="icon-bar"></span>
572
+ <span class="icon-bar"></span>
573
+ <span class="icon-bar"></span>
574
+ </button>
575
+ <a href="/" class="navbar-brand" id="hostname">netdata</a>
576
+ </div>
577
+ <nav class="collapse navbar-collapse navbar-right" role="navigation">
578
+ <ul class="nav navbar-nav">
579
+ <li class="hidden-sm"><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-cog"></i> settings</a></li>
580
+ <li class="hidden-sm"><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank"><i class="fa fa-github"></i> community</a></li>
581
+ <li class="hidden-sm" id="updateButton"><a href="#" class="btn" data-toggle="modal" data-target="#updateModal"><i class="fa fa-cloud-download"></i> update</a></li>
582
+ <li class="hidden-sm"><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
583
+ <li class="dropdown hidden-md hidden-lg hidden-xs">
584
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">Menu <strong class="caret"></strong></a>
585
+ <ul class="dropdown-menu scrollable-menu inpagemenu" role="menu">
586
+ <li><a href="#" class="btn" data-toggle="modal" data-target="#optionsModal"><i class="fa fa-cog"></i> settings</a></li>
587
+ <li><a href="https://github.com/firehol/netdata/wiki" class="btn" target="_blank"><i class="fa fa-github"></i> community</a></li>
588
+ <li><a href="#" class="btn" data-toggle="modal" data-target="#helpModal"><i class="fa fa-question-circle"></i> help</a></li>
589
+ </ul>
590
+ </li>
591
+ <li class="dropdown hidden-sm hidden-md hidden-lg">
592
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="current_view">my-netdata <strong class="caret"></strong></a>
593
+ <ul id="mynetdata_servers2" class="dropdown-menu scrollable-menu inpagemenu" role="menu">
594
+ <li><a href="#" onclick="return false;" style="color: #999;">loading...</a></li>
595
+ </ul>
596
+ </li>
597
+ </ul>
598
+ </nav>
599
+ </nav>
600
+ </div>
601
+ </nav>
602
+
603
+ <div id="masthead" style="display: none;">
604
+ <div class="container">
605
+ <div class="row">
606
+ <div class="col-md-7">
607
+ <h1>Netdata
608
+ <p class="lead">Real-time performance monitoring, in the greatest possible detail</p>
609
+ </h1>
610
+ </div>
611
+ <div class="col-md-5">
612
+ <div class="well well-lg">
613
+ <div class="row">
614
+ <div class="col-md-6">
615
+ <b>Drag</b> charts to pan.
616
+ <b>Shift + wheel</b> on them, to zoom in and out.
617
+ <b>Double-click</b> on them, to reset.
618
+ <b>Hover</b> on them too!
619
+ </div>
620
+ <div class="col-md-6">
621
+ <div data-netdata="system.intr" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dygraph-type="line" data-dygraph-strokewidth="3" data-dygraph-smooth="true" data-dygraph-highlightcirclesize="6" data-after="-90" data-height="60px" data-colors="#C66"></div>
622
+ </div>
623
+ </div>
624
+ </div>
625
+ </div>
626
+ </div>
627
+ </div>
628
+ </div>
629
+
630
+ <div class="container">
631
+ <div class="row">
632
+ <div class="col-md-10" role="main">
633
+ <div id="charts_div"></div>
634
+ </div>
635
+ <div class="col-md-2" role="complementary">
636
+ <nav class="dashboard-sidebar hidden-print hidden-xs hidden-sm" id="sidebar" role="menu"></nav>
637
+ </div>
638
+ </div>
639
+ </div>
640
+
641
+ <div id="footer" class="container" style="display: none;">
642
+ <div class="row">
643
+ <div class="col-md-10" role="main">
644
+ <div class="p">
645
+ <big><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></big><br/>
646
+ <i class="fa fa-copyright"></i> Copyright 2016, Costa Tsaousis.<br/>
647
+ Released under <a href="http://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GPL v3 or later</a>.<br/>
648
+ </div>
649
+ <div class="p">
650
+ <small>
651
+ <a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a> re-distributes these software tools:
652
+
653
+ <i class="fa fa-circle"></i> The excellent <a href="http://dygraphs.com/" target="_blank">Dygraphs.com</a> web chart library,
654
+ <i class="fa fa-copyright"></i> Copyright 2009, Dan Vanderkam, <a href="http://dygraphs.com/legal.html" target="_blank">MIT License</a>
655
+
656
+ <i class="fa fa-circle"></i> <a href="http://omnipotent.net/jquery.sparkline/" target="_blank">jQuery Sparklines</a> web chart library,
657
+ <i class="fa fa-copyright"></i> Copyright 2009-2012, Splunk Inc., <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">New BSD License</a>
658
+
659
+ <i class="fa fa-circle"></i> <a href="http://benpickles.github.io/peity/" target="_blank">Peity</a> web chart library,
660
+ <i class="fa fa-copyright"></i> Copyright 2009-2015, Ben Pickles, <a href="https://github.com/benpickles/peity/blob/master/MIT-LICENCE" target="_blank">MIT License</a>
661
+
662
+ <i class="fa fa-circle"></i> <a href="https://rendro.github.io/easy-pie-chart/" target="_blank">Easy Pie Chart</a> web chart library,
663
+ <i class="fa fa-copyright"></i> Copyright 2013, Robert Fleischmann, <a href="https://github.com/rendro/easy-pie-chart/blob/master/LICENSE" target="_blank">MIT License</a>
664
+
665
+ <i class="fa fa-circle"></i> <a href="http://bernii.github.io/gauge.js/" target="_blank">Gauge.js</a> web chart library,
666
+ <i class="fa fa-copyright"></i> Copyright, Bernard Kobos, <a href="http://bernii.github.io/gauge.js/" target="_blank">MIT License</a>
667
+
668
+ <i class="fa fa-circle"></i> <a href="https://jquery.org/" target="_blank">jQuery</a>,
669
+ <i class="fa fa-copyright"></i> Copyright 2015, jQuery Foundation, <a href="https://jquery.org/license/" target="_blank">MIT License</a>
670
+
671
+ <i class="fa fa-circle"></i> <a href="http://getbootstrap.com/getting-started/" target="_blank">Bootstrap</a>,
672
+ <i class="fa fa-copyright"></i> Copyright 2015, Twitter, <a href="http://getbootstrap.com/getting-started/#license-faqs" target="_blank">MIT License</a>
673
+
674
+ <i class="fa fa-circle"></i> <a href="http://www.bootstraptoggle.com/" target="_blank">Bootstrap Toggle</a>,
675
+ <i class="fa fa-copyright"></i> Copyright (c) 2011-2014 Min Hur, The New York Times Company, <a href="https://github.com/minhur/bootstrap-toggle/blob/master/LICENSE" target="_blank">MIT License</a>
676
+
677
+ <i class="fa fa-circle"></i> <a href="https://jamesflorentino.github.io/nanoScrollerJS/" target="_blank">NanoScroller</a>,
678
+ <i class="fa fa-copyright"></i> Copyright 2012, James Florentino, <a href="https://github.com/jamesflorentino/nanoScrollerJS/blob/master/LICENSE" target="_blank">MIT License</a>
679
+
680
+ <i class="fa fa-circle"></i> <a href="https://github.com/marcj/css-element-queries" target="_blank">CSS Element Queries</a>,
681
+ <i class="fa fa-copyright"></i> Copyright Marc J. Schmidt, <a href="https://github.com/marcj/css-element-queries/blob/master/LICENSE" target="_blank">MIT License</a>
682
+
683
+ <i class="fa fa-circle"></i> <a href="https://fortawesome.github.io/Font-Awesome/" target="_blank">FontAwesome</a>,
684
+ <i class="fa fa-copyright"></i> Created by Dave Gandy, Font: <a href="http://scripts.sil.org/OFL" target="_blank">SIL OFL 1.1 License</a>, CSS: <a href="http://opensource.org/licenses/mit-license.html" target="_blank">MIT License</a>
685
+
686
+ <i class="fa fa-circle"></i> <a href="http://www.iconsdb.com/soylent-red-icons/seo-performance-icon.html" target="_blank">IconsDB.com Icons</a>, Icons provided as CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
687
+
688
+ <i class="fa fa-circle"></i> <a href="http://morrisjs.github.io/morris.js/" target="_blank">morris.js</a>,
689
+ <i class="fa fa-copyright"></i> Copyright 2013, Olly Smith, <a href="http://morrisjs.github.io/morris.js/" target="_blank">Simplified BSD License</a>
690
+
691
+ <i class="fa fa-circle"></i> <a href="http://raphaeljs.com/" target="_blank">Raphaël</a>,
692
+ <i class="fa fa-copyright"></i> Copyright 2008, Dmitry Baranovskiy, <a href="http://raphaeljs.com/license.html" target="_blank">MIT License</a>
693
+
694
+ <i class="fa fa-circle"></i> <a href="http://C3js.org/" target="_blank">C3</a>,
695
+ <i class="fa fa-copyright"></i> Copyright 2013, Masayuki Tanaka, <a href="https://github.com/masayuki0812/c3/blob/master/LICENSE" target="_blank">MIT License</a>
696
+
697
+ <i class="fa fa-circle"></i> <a href="http://D3js.org/" target="_blank">D3</a>,
698
+ <i class="fa fa-copyright"></i> Copyright 2015, Mike Bostock, <a href="http://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD License</a>
699
+
700
+ </small>
701
+ </div>
702
+ </div>
703
+ </div>
704
+ </div>
705
+
706
+ <div class="modal fade" id="welcomeModal" tabindex="-1" role="dialog" aria-labelledby="welcomeModalLabel">
707
+ <div class="modal-dialog modal-lg" role="document">
708
+ <div class="modal-content">
709
+ <div class="modal-header">
710
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
711
+ <h4 class="modal-title" id="welcomeModalLabel">Welcome!</h4>
712
+ </div>
713
+ <div class="modal-body">
714
+ <div class="p">
715
+ <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> is the fastest way to visualize metrics. It is a resource efficient, highly optimized system for collecting and visualizing any type of real-time time series data, from CPU usage, disk activity, SQL queries, API calls, web site visitors, etc.
716
+ </div>
717
+ <div class="p">
718
+ <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> tries to visualize the truth of <b>now</b>, in its <b>greatest detail</b>, so that you can get insights of what is happening now and what just happened, on your systems and applications.
719
+ </div>
720
+ <div class="p">
721
+ To make a chart in <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b>, you just need a <b>number</b>. Just a number you can read somehow. <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> will turn this number to a real time, interactive, web chart. For collecting these numbers, it supports <a href="https://github.com/firehol/netdata/wiki/External-Plugins" target="_blank">external plugins</a>, even <a href="https://github.com/firehol/netdata/wiki/General-Info---charts.d" target="_blank">shell</a> or <a href="https://github.com/firehol/netdata/wiki/General-Info---charts.d" target="_blank">node.js</a> plugins. Any computer program, in any language, that can print a few lines of text on its standard output, can be a netdata data collector.
722
+ </div>
723
+ <div class="p">
724
+ <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> can embed charts everywhere, like this one <div data-netdata="system.cpu" data-dimensions="system" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-show-value-of-system-at="system.cpu.system.modal.1"></div> (my CPU system usage which is <span id="system.cpu.system.modal.1" style="display: inline-block; width: 40px; text-align: right;"></span>%),
725
+ or this one <div data-netdata="ipv4.tcppackets" data-dimensions="received" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-show-value-of-received-at="ipv4.tcppackets.received.modal.1"></div> (my IPv4 received TCP packets, which are <span id="ipv4.tcppackets.received.modal.1" style="display: inline-block; width: 60px; text-align: right;"></span>/second).
726
+ </div>
727
+ <div class="p">
728
+ You can have <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> charts on your site too. Just give it a <code>div</code> and a real time chart, zoomable and draggable will appear (try it even on these tiny ones - <b>drag</b> them to pan horizontally, <b>shift + drag</b> to zoom in, on <b>chrome shift + mouse wheel</b> to zoom in/out, <b>double click</b> on them to reset them - don't be afraid of <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata</a></b> performance - <a href="https://github.com/firehol/netdata/wiki/Performance" target="_blank">a raspberry pi 2 can sustain 300 charts updates per second</a>!).
729
+ </div>
730
+ <div class="p">
731
+ For more information please refer to the <b><a href="https://github.com/firehol/netdata/wiki" target="_blank">netdata wiki</a></b>.
732
+ </div>
733
+ </div>
734
+ <div class="modal-footer">
735
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
736
+ </div>
737
+ </div>
738
+ </div>
739
+ </div>
740
+
741
+ <div class="modal fade" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel">
742
+ <div class="modal-dialog modal-lg" role="document">
743
+ <div class="modal-content">
744
+ <div class="modal-header">
745
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
746
+ <h4 class="modal-title" id="helpModalLabel">Dashboard Help</h4>
747
+ </div>
748
+ <div class="modal-body">
749
+
750
+ <h4>Dygraphs (line, area and stacked area charts)</h4>
751
+
752
+ <!-- Nav tabs -->
753
+ <ul class="nav nav-tabs" role="tablist">
754
+ <li role="presentation" class="active"><a href="#help_mouse" aria-controls="help_mouse" role="tab" data-toggle="tab">Mouse Interface</a></li>
755
+ <li role="presentation"><a href="#help_touch" aria-controls="help_touch" role="tab" data-toggle="tab">Touch Interface</a></li>
756
+ </ul>
757
+
758
+ <!-- Tab panes -->
759
+ <div class="tab-content">
760
+ <div role="tabpanel" class="tab-pane active" id="help_mouse">
761
+ <div class="p">
762
+ <h4>Mouse Over / Hover</h4>
763
+ Mouse over on a chart to show, at its legend, the values for the timestamp under the mouse (the chart will also highlight the point at the chart).
764
+ <br/>
765
+ All the other visible charts will also show and highlight their values for the same timestamp.
766
+ </div>
767
+ <hr/>
768
+ <div class="p">
769
+ <h4>Drag Chart Contents</h4>
770
+ Drag the contents of a chart to pan it horizontally.
771
+ <br/>
772
+ All the charts will follow soon after you let the chart alone (this little delay is by design: it speeds up your browser and lets you focus on what you are exploring).
773
+ <br/>
774
+ Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double click</b> a panned chart.
775
+ </div>
776
+ <hr/>
777
+ <div class="p">
778
+ <h4>Double Click</h4>
779
+ Double Click a chart to reset all the charts to their default auto-refreshing state.
780
+ </div>
781
+ <hr/>
782
+ <div class="p">
783
+ <h4>SHIFT + Drag</h4>
784
+ While pressing the shift key, click on the contents of a chart and move the mouse to select an area, to zoom in. The other charts will follow too. Zooming is performed in two phases:
785
+ <ul>
786
+ <li>The already loaded chart contents are zoomed (low resolution)</li>
787
+ <li>New data are transferred from the netdata server, to refresh the chart with possibly more detail.</li>
788
+ </ul>
789
+ Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
790
+ </div>
791
+ <hr/>
792
+ <div class="p">
793
+ <h4>SHIFT + Mouse Wheel <small>(does not work on firefox and IE/Edge)</small></h4>
794
+ While pressing the shift key and the mouse pointer is over the contents of a chart, scroll the mouse wheel to zoom in or out. This kind of zooming is aligned to center below the mouse pointer. The other charts will follow too.
795
+ <br/>
796
+ Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
797
+ </div>
798
+ <hr/>
799
+ <div class="p">
800
+ <h4>Legend Operations</h4>
801
+ Click on the label or value of a dimension, will select / un-select this dimension.
802
+ <br/>
803
+ You can press any of the SHIFT or CONTROL keys and then click on legend labels or values, to select / un-select multiple dimensions.
804
+ </div>
805
+ </div>
806
+ <div role="tabpanel" class="tab-pane" id="help_touch">
807
+ <div class="p">
808
+ <h4>Single Tap</h4>
809
+ Single Tap on the contents of a chart to show, at its legend, the values for the timestamp tapped (the chart will also highlight the point at the chart).
810
+ <br/>
811
+ All the other visible charts will also show and highlight their values for the same timestamp.
812
+ </div>
813
+ <hr/>
814
+ <div class="p">
815
+ <h4>Drag Chart Contents</h4>
816
+ Touch and Drag the contents of a chart to pan it horizontally.
817
+ <br/>
818
+ All the charts will follow soon after you let the chart alone (this little delay is by design: it speeds up your browser and lets you focus on what you are exploring).
819
+ <br/>
820
+ Once a chart is panned, auto refreshing stops for all charts. To enable it again, <b>double tap</b> a panned chart.
821
+ </div>
822
+ <hr/>
823
+ <div class="p">
824
+ <h4>Double Tap</h4>
825
+ Double tap a chart to reset all the charts to their default auto-refreshing state.
826
+ </div>
827
+ <hr/>
828
+ <div class="p">
829
+ <h4>Zoom <small>(does not work on firefox and IE/Edge)</small></h4>
830
+ With two fingers, zoom in or out.
831
+ <br/>
832
+ Once a chart is zoomed, auto refreshing stops for all charts. To enable it again, <b>double click</b> a zoomed chart.
833
+ </div>
834
+ <hr/>
835
+ <div class="p">
836
+ <h4>Legend Operations</h4>
837
+ Tap on the label or value of a dimension, will select / un-select this dimension.
838
+ </div>
839
+ </div>
840
+ </div>
841
+ </div>
842
+ <div class="modal-footer">
843
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
844
+ </div>
845
+ </div>
846
+ </div>
847
+ </div>
848
+
849
+ <div class="modal fade" id="optionsModal" tabindex="-1" role="dialog" aria-labelledby="optionsModalLabel">
850
+ <div class="modal-dialog modal-lg" role="document">
851
+ <div class="modal-content">
852
+ <div class="modal-header">
853
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
854
+ <h4 class="modal-title" id="optionsModalLabel">netdata dashboard options</h4>
855
+ </div>
856
+ <div class="modal-body">
857
+ <center>
858
+ <small style="color: #BBBBBB;">These are browser settings. Each viewer has its own. They do not affect the operation of your netdata server.
859
+ <br/>
860
+ Settings take effect immediately and are saved permanently to browser local storage (except the refresh on focus / always option).
861
+ <br/>
862
+ To reset all options (including charts sizes) to their defaults, click <a href="#" onclick="resetDashboardOptions(); return false;">here</a>.</small>
863
+ </center>
864
+ <div style="padding: 10px;"></div>
865
+
866
+ <!-- Nav tabs -->
867
+ <ul class="nav nav-tabs" role="tablist">
868
+ <li role="presentation" class="active"><a href="#settings_performance" aria-controls="settings_performance" role="tab" data-toggle="tab">Performance</a></li>
869
+ <li role="presentation"><a href="#settings_sync" aria-controls="settings_sync" role="tab" data-toggle="tab">Synchronization</a></li>
870
+ <li role="presentation"><a href="#settings_visual" aria-controls="settings_visual" role="tab" data-toggle="tab">Visual</a></li>
871
+ </ul>
872
+
873
+ <!-- Tab panes -->
874
+ <div class="tab-content">
875
+ <div role="tabpanel" class="tab-pane active" id="settings_performance">
876
+ <form id="optionsForm1" method="get" class="form-horizontal">
877
+ <div class="form-group">
878
+ <table>
879
+ <tr class="option-row">
880
+ <td class="option-control"><input id="stop_updates_when_focus_is_lost" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="On Focus" data-off="Always" data-width="110px"></td>
881
+ <td class="option-info"><strong>When to refresh the charts?</strong><br/>
882
+ <small>When set to <b>On Focus</b>, the charts will stop being updated if the page / tab does not have the focus of the user. When set to <b>Always</b>, the charts will always be refreshed. Set it to <b>On Focus</b> it to lower the CPU requirements of the browser (and extend the battery of laptops and tablets) when this page does not have your focus. Set to <b>Always</b> to work on another window (i.e. change the settings of something) and have the charts auto-refresh in this window.</small>
883
+ </td>
884
+ </tr>
885
+ <tr class="option-row">
886
+ <td class="option-control">
887
+ <input id="eliminate_zero_dimensions" type="checkbox" checked data-toggle="toggle" data-on="Non Zero" data-off="All" data-width="110px">
888
+ </td>
889
+ <td class="option-info"><strong>Which dimensions to show?</strong><br/>
890
+ <small>When set to <b>Non Zero</b>, dimensions that have all their values (within the current view) set to zero will not be transferred from the netdata server (except if all dimensions of the chart are zero, in which case this setting does nothing - all dimensions are transferred and shown). When set to <b>All</b>, all dimensions will always be shown. Set it to <b>Non Zero</b> to lower the data transferred between netdata and your browser, lower the CPU requirements of your browser (fewer lines to draw) and increase the focus on the legends (fewer entries at the legends).</small>
891
+ </td>
892
+ </tr>
893
+ <tr class="option-row">
894
+ <td class="option-control"><input id="destroy_on_hide" type="checkbox" data-toggle="toggle" data-on="Destroy" data-off="Hide" data-width="110px"></td>
895
+ <td class="option-info"><strong>How to handle hidden charts?</strong><br/>
896
+ <small>When set to <b>Destroy</b>, charts that are not in the current viewport of the browser (are above, or below the visible area of the page), will be destroyed and re-created if and when they become visible again. When set to <b>Hide</b>, the not-visible charts will be just hidden, to simplify the DOM and speed up your browser. Set it to <b>Destroy</b>, to lower the memory requirements of your browser. Set it to <b>Hide</b> for smoother page scrolling.</small>
897
+ </td>
898
+ </tr>
899
+ </table>
900
+ </div>
901
+ </form>
902
+ </div>
903
+ <div role="tabpanel" class="tab-pane" id="settings_sync">
904
+ <form id="optionsForm2" method="get" class="form-horizontal">
905
+ <div class="form-group">
906
+ <table>
907
+ <tr class="option-row">
908
+ <td class="option-control"><input id="parallel_refresher" type="checkbox" checked data-toggle="toggle" data-on="Parallel" data-off="Sequential" data-width="110px"></td>
909
+ <td class="option-info"><strong>Which chart refresh policy to use?</strong><br/>
910
+ <small>When set to <b>parallel</b>, visible charts are refreshed in parallel (all queries are sent to netdata server in parallel) and are rendered asynchronously. When set to <b>sequential</b> charts are refreshed one after another. Set it to parallel if your browser can cope with it (most modern browsers do), set it to sequential if you work on an older/slower computer.</small>
911
+ </td>
912
+ </tr>
913
+ <tr class="option-row" id="concurrent_refreshes_row">
914
+ <td class="option-control"></td>
915
+ <td class="option-info">
916
+ <table>
917
+ <tr class="option-row">
918
+ <td class="option-control">
919
+ <input id="concurrent_refreshes" type="checkbox" checked data-toggle="toggle" data-on="Resync" data-off="Best Effort" data-width="110px">
920
+ </td>
921
+ <td class="option-info">
922
+ <strong>Shall we re-sync chart refreshes?</strong><br/>
923
+ <small>When set to <b>Resync</b>, the dashboard will attempt to re-synchronize all the charts so that they are refreshed concurrently. When set to <b>Best Effort</b>, each chart may be refreshed with a little time difference to the others. Normally, the dashboard starts refreshing them in parallel, but depending on the speed of your computer and the network latencies, charts start having a slight time difference. Setting this to <b>Resync</b> will attempt to re-synchronize the charts on every update. Setting it to <b>Best Effort</b> may lower the pressure on your browser and the network.</small>
924
+ </td>
925
+ </tr>
926
+ </table>
927
+ </td>
928
+ </tr>
929
+ <tr class="option-row">
930
+ <td class="option-control"><input id="sync_selection" type="checkbox" checked data-toggle="toggle" data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
931
+ <td class="option-info"><strong>Sync hover selection on all charts?</strong><br/>
932
+ <small>When enabled, a selection on one chart will automatically select the same time on all other visible charts and the legends of all visible charts will be updated to show the selected values. When disabled, only the chart getting the user's attention will be selected. Enable it to get better insights of the data. Disable it if you are on a very slow computer that cannot actually do it.</small>
933
+ </td>
934
+ </tr>
935
+ <tr class="option-row">
936
+ <td class="option-control"><input id="sync_pan_and_zoom" type="checkbox" checked data-toggle="toggle" data-on="Sync" data-off="Don't Sync" data-onstyle="success" data-offstyle="danger" data-width="110px"></td>
937
+ <td class="option-info"><strong>Sync pan and zoom on all charts?</strong><br/>
938
+ <small>When enabled, pan and zoom operations on a chart will be replicated to all charts (even the ones that are not currently visible - of course only when they will become visible). When disabled, pan and zoom operations will not be propagated to other charts.</small>
939
+ </td>
940
+ </tr>
941
+ </table>
942
+ </div>
943
+ </form>
944
+ </div>
945
+ <div role="tabpanel" class="tab-pane" id="settings_visual">
946
+ <form id="optionsForm3" method="get" class="form-horizontal">
947
+ <div class="form-group">
948
+ <table>
949
+ <tr class="option-row">
950
+ <td class="option-control"><input id="netdata_theme_control" type="checkbox" checked data-toggle="toggle" data-offstyle="danger" data-onstyle="success" data-on="Dark" data-off="White" data-width="110px"></td>
951
+ <td class="option-info"><strong>Which theme to use?</strong><br/>
952
+ <small>Netdata comes with two themes: <b>Dark</b> (the default) and <b>White</b>.
953
+ <br/>
954
+ <b>Switching this will reload the dashboard</b>.
955
+ </small>
956
+ </td>
957
+ </tr>
958
+ <tr class="option-row">
959
+ <td class="option-control"><input id="show_help" type="checkbox" checked data-toggle="toggle" data-on="Help Me" data-off="No Help" data-width="110px"></td>
960
+ <td class="option-info"><strong>Do you need help?</strong><br/>
961
+ <small>Netdata can show some help in some areas to help you use the dashboard. If all these balloons bother you, disable them using this switch.
962
+ <br/>
963
+ <b>Switching this will reload the dashboard</b>.
964
+ </small>
965
+ </td>
966
+ </tr>
967
+ <tr class="option-row">
968
+ <td class="option-control"><input id="pan_and_zoom_data_padding" type="checkbox" checked data-toggle="toggle" data-on="Pad" data-off="Don't Pad" data-width="110px"></td>
969
+ <td class="option-info"><strong>Enable data padding when panning and zooming?</strong><br/>
970
+ <small>When set to <b>Pad</b> the charts will be padded with more data, both before and after the visible area, thus giving the impression the whole database is loaded. This padding will happen only after the first pan or zoom operation on the chart (initially all charts have only the visible data). When set to <b>Don't Pad</b> only the visible data will be transfered from the netdata server, even after the first pan and zoom operation.</small>
971
+ </td>
972
+ </tr>
973
+ <tr class="option-row">
974
+ <td class="option-control"><input id="smooth_plot" type="checkbox" checked data-toggle="toggle" data-on="Smooth" data-off="Rough" data-width="110px"></td>
975
+ <td class="option-info"><strong>Enable Bézier lines on charts?</strong><br/>
976
+ <small>When set to <b>Smooth</b> the charts libraries that support it, will plot smooth curves instead of simple straight lines to connect the points.
977
+ <br/>
978
+ Keep in mind <a href="http://dygraphs.com" target="_blank">dygraphs</a>, the main charting library in netdata dashboards, can only smooth line charts. It cannot smooth area or stacked charts. When set to <b>Rough</b>, this setting can lower the CPU resources consumed by your browser.</small>
979
+ </td>
980
+ </tr>
981
+ </table>
982
+ </div>
983
+ </form>
984
+ </div>
985
+ </div>
986
+ </div>
987
+ <div class="modal-footer">
988
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
989
+ </div>
990
+ </div>
991
+ </div>
992
+ </div>
993
+
994
+
995
+ <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel">
996
+ <div class="modal-dialog" role="document">
997
+ <div class="modal-content">
998
+ <div class="modal-header">
999
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1000
+ <h4 class="modal-title" id="updateModalLabel">Update Check</h4>
1001
+ </div>
1002
+ <div class="modal-body">
1003
+ Your netdata version: <b><code><span id="netdataVersion">Unknown</span></code></b>
1004
+ <br/>
1005
+ <div style="padding: 10px;"></div>
1006
+ <div id="versionCheckLog">Not checked yet. Please press the Check Now button.</div>
1007
+ </div>
1008
+ <div class="modal-footer">
1009
+ <a href="#" onclick="notifyForUpdate(true); return false;" type="button" class="btn btn-default">Check Now</a>
1010
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1011
+ </div>
1012
+ </div>
1013
+ </div>
1014
+ </div>
1015
+
1016
+ <div class="modal fade" id="deleteRegistryModal" tabindex="-1" role="dialog" aria-labelledby="deleteRegistryModalLabel">
1017
+ <div class="modal-dialog" role="document">
1018
+ <div class="modal-content">
1019
+ <div class="modal-header">
1020
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1021
+ <h4 class="modal-title" id="deleteRegistryModalLabel">Delete <span id="deleteRegistryServerName"></span>?</h4>
1022
+ </div>
1023
+ <div class="modal-body">
1024
+ You are about to delete, from your personal list of netdata servers, the following server:
1025
+ <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
1026
+ <b><span id="deleteRegistryServerName2"></span></b>
1027
+ <br/>
1028
+ <b><span id="deleteRegistryServerURL"></span></b>
1029
+ </p>
1030
+ Are you sure you want to do this?
1031
+ <br/>
1032
+ <div style="padding: 10px;"></div>
1033
+ <small>Keep in mind, this server will be added back if and when you visit it again.</small>
1034
+ <br/>
1035
+ <div id="deleteRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
1036
+ </div>
1037
+ <div class="modal-footer">
1038
+ <button type="button" class="btn btn-success" data-dismiss="modal">keep it</button>
1039
+ <a href="#" onclick="notifyForDeleteRegistry(true); return false;" type="button" class="btn btn-danger">delete it</a>
1040
+ </div>
1041
+ </div>
1042
+ </div>
1043
+ </div>
1044
+
1045
+ <div class="modal fade" id="switchRegistryModal" tabindex="-1" role="dialog" aria-labelledby="switchRegistryModalLabel">
1046
+ <div class="modal-dialog" role="document">
1047
+ <div class="modal-content">
1048
+ <div class="modal-header">
1049
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1050
+ <h4 class="modal-title" id="switchRegistryModalLabel">Switch Netdata Registry Identity</h4>
1051
+ </div>
1052
+ <div class="modal-body">
1053
+ You can copy and paste the following ID to all your browsers (e.g. work and home).
1054
+ <br/>
1055
+ All the browsers with the same ID will identify <b>you</b>, so please don't share this with others.
1056
+ <p style="text-align: center; padding-top: 10px; padding-bottom: 10px; line-height: 2;">
1057
+ <form action="#">
1058
+ <input type="text" class="form-control" id="switchRegistryPersonGUID" placeholder="your personal ID" maxlength="36" autocomplete="off" style="text-align: center; font-size: 1.4em;">
1059
+ </form>
1060
+ </p>
1061
+ Either copy this ID and paste it to another browser, or paste here the ID you have taken from another browser.
1062
+ <p style="padding-top: 10px;"><small>
1063
+ Keep in mind that:
1064
+ <ul>
1065
+ <li>when you switch ID, your previous ID will be lost forever - this is irreversible.</li>
1066
+ <li>both IDs (your old and the new) must list this netdata at their personal lists.</li>
1067
+ <li>both IDs have to be known by the registry: <b><span id="switchRegistryURL"></span></b>.</li>
1068
+ <li>to get a new ID, just clear your browser cookies.</li>
1069
+ </ul>
1070
+ </small></p>
1071
+ <div id="switchRegistryResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
1072
+ </div>
1073
+ <div class="modal-footer">
1074
+ <button type="button" class="btn btn-success" data-dismiss="modal">cancel</button>
1075
+ <a href="#" onclick="notifyForSwitchRegistry(true); return false;" type="button" class="btn btn-danger">impersonate</a>
1076
+ </div>
1077
+ </div>
1078
+ </div>
1079
+ </div>
1080
+
1081
+ <div class="modal fade" id="gotoServerModal" tabindex="-1" role="dialog" aria-labelledby="gotoServerModalLabel">
1082
+ <div class="modal-dialog" role="document">
1083
+ <div class="modal-content">
1084
+ <div class="modal-header">
1085
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1086
+ <h4 class="modal-title" id="gotoServerModalLabel"><span id="gotoServerName"></span></h4>
1087
+ </div>
1088
+ <div class="modal-body">
1089
+ Checking known URLs for this server...
1090
+ <div style="padding-top: 20px;">
1091
+ <table id="gotoServerList">
1092
+ </table>
1093
+ </div>
1094
+ <p style="padding-top: 10px;"><small>
1095
+ Checks may fail if you are viewing an HTTPS page and the server to be checked is HTTP only.
1096
+ </small></p>
1097
+ <div id="gotoServerResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
1098
+ </div>
1099
+ <div class="modal-footer">
1100
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1101
+ </div>
1102
+ </div>
1103
+ </div>
1104
+ </div>
1105
1106
<script type="text/javascript">
1107
var this_is_demo = null;
1108
function isdemo() {
1109
- if(this_is_demo !== null) return this_is_demo;
1110
- this_is_demo = false;
1111
-
1112
- try {
1113
- if(typeof document.location.hostname === 'string') {
1114
- if(document.location.hostname.endsWith('.my-netdata.io') ||
1115
- document.location.hostname.endsWith('.mynetdata.io') ||
1116
- document.location.hostname.endsWith('.netdata.rocks') ||
1117
- document.location.hostname.endsWith('.firehol.org') ||
1118
- document.location.hostname.endsWith('.netdata.online'))
1119
- this_is_demo = true;
1120
- }
1121
- }
1122
- catch(error) {
1123
- ;
1124
- }
1125
-
1126
- return this_is_demo;
1109
+ if(this_is_demo !== null) return this_is_demo;
1110
+ this_is_demo = false;
1111
+
1112
+ try {
1113
+ if(typeof document.location.hostname === 'string') {
1114
+ if(document.location.hostname.endsWith('.my-netdata.io') ||
1115
+ document.location.hostname.endsWith('.mynetdata.io') ||
1116
+ document.location.hostname.endsWith('.netdata.rocks') ||
1117
+ document.location.hostname.endsWith('.firehol.org') ||
1118
+ document.location.hostname.endsWith('.netdata.online'))
1119
+ this_is_demo = true;
1120
+ }
1121
+ }
1122
+ catch(error) {
1123
+ ;
1124
+ }
1125
+
1126
+ return this_is_demo;
1127
}
1128
1129
if(isdemo()) {
1130
- document.getElementById('masthead').style.display = 'block';
1130
+ document.getElementById('masthead').style.display = 'block';
1131
}
1132
1133
function netdataURL(url) {
1134
- if(typeof url === 'undefined')
1135
- url = document.location.toString();
1134
+ if(typeof url === 'undefined')
1135
+ url = document.location.toString();
1136
1137
- if(url.indexOf('#') !== -1)
1138
- url = url.substring(0, url.indexOf('#'));
1137
+ if(url.indexOf('#') !== -1)
1138
+ url = url.substring(0, url.indexOf('#'));
1139
1140
- var hash = netdataHash();
1140
+ var hash = netdataHash();
1141
1142
- // console.log('netdataURL: ' + url + hash);
1142
+ // console.log('netdataURL: ' + url + hash);
1143
1144
- return url + hash;
1144
+ return url + hash;
1145
}
1146
1147
function netdataReload(url) {
1148
- var t = netdataURL(url);
1149
- // console.log('netdataReload: ' + t);
1150
- document.location = t;
1148
+ var t = netdataURL(url);
1149
+ // console.log('netdataReload: ' + t);
1150
+ document.location = t;
1151
1152
- // since we play with hash
1153
- // this is needed to reload the page
1154
- location.reload();
1152
+ // since we play with hash
1153
+ // this is needed to reload the page
1154
+ location.reload();
1155
}
1156
1157
var gotoServerValidateRemaining = 0;
1158
var gotoServerMiddleClick = false;
1159
var gotoServerStop = false;
1160
function gotoServerValidateUrl(id, guid, url) {
1161
- var penaldy = 0;
1162
- if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
1163
- // we penalize https only if the current url is http
1164
- // to allow the user walk through all its servers.
1165
- penaldy = 500;
1166
-
1167
- var finalURL = netdataURL(url);
1168
-
1169
- setTimeout(function() {
1170
- document.getElementById('gotoServerList').innerHTML += '<tr><td style="padding-left: 20px;"><a href="' + finalURL + '" target="_blank">' + url + '</a></td><td style="padding-left: 30px;"><code id="' + guid + '-' + id + '-status">checking...</code></td></tr>';
1171
-
1172
- NETDATA.registry.hello(url, function(data) {
1173
- if (data) {
1174
- // console.log('OK ' + id + ' URL: ' + url);
1175
- document.getElementById(guid + '-' + id + '-status').innerHTML = "OK";
1176
-
1177
- if(!gotoServerStop) {
1178
- gotoServerStop = true;
1179
-
1180
- if(gotoServerMiddleClick) {
1181
- window.open(finalURL, '_blank');
1182
- gotoServerMiddleClick = false;
1183
- document.getElementById('gotoServerResponse').innerHTML = '<b>Opening new window to ' + NETDATA.registry.machines[guid].name + '<br/><a href="' + finalURL + '">' + url + '</a></b><br/>(check your pop-up blocker if it fails)';
1184
- }
1185
- else
1186
- document.location = finalURL;
1187
- }
1188
- }
1189
- else {
1190
- document.getElementById(guid + '-' + id + '-status').innerHTML = "failed!";
1191
- gotoServerValidateRemaining--;
1192
- if(gotoServerValidateRemaining <= 0) {
1193
- gotoServerMiddleClick = false;
1194
- document.getElementById('gotoServerResponse').innerHTML = '<b>Sorry! I cannot find any operational URL for this server</b>';
1195
- }
1196
- }
1197
- });
1198
- }, (id * 50) + penaldy);
1161
+ var penaldy = 0;
1162
+ if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
1163
+ // we penalize https only if the current url is http
1164
+ // to allow the user walk through all its servers.
1165
+ penaldy = 500;
1166
+
1167
+ var finalURL = netdataURL(url);
1168
+
1169
+ setTimeout(function() {
1170
+ document.getElementById('gotoServerList').innerHTML += '<tr><td style="padding-left: 20px;"><a href="' + finalURL + '" target="_blank">' + url + '</a></td><td style="padding-left: 30px;"><code id="' + guid + '-' + id + '-status">checking...</code></td></tr>';
1171
+
1172
+ NETDATA.registry.hello(url, function(data) {
1173
+ if (data) {
1174
+ // console.log('OK ' + id + ' URL: ' + url);
1175
+ document.getElementById(guid + '-' + id + '-status').innerHTML = "OK";
1176
+
1177
+ if(!gotoServerStop) {
1178
+ gotoServerStop = true;
1179
+
1180
+ if(gotoServerMiddleClick) {
1181
+ window.open(finalURL, '_blank');
1182
+ gotoServerMiddleClick = false;
1183
+ document.getElementById('gotoServerResponse').innerHTML = '<b>Opening new window to ' + NETDATA.registry.machines[guid].name + '<br/><a href="' + finalURL + '">' + url + '</a></b><br/>(check your pop-up blocker if it fails)';
1184
+ }
1185
+ else
1186
+ document.location = finalURL;
1187
+ }
1188
+ }
1189
+ else {
1190
+ document.getElementById(guid + '-' + id + '-status').innerHTML = "failed!";
1191
+ gotoServerValidateRemaining--;
1192
+ if(gotoServerValidateRemaining <= 0) {
1193
+ gotoServerMiddleClick = false;
1194
+ document.getElementById('gotoServerResponse').innerHTML = '<b>Sorry! I cannot find any operational URL for this server</b>';
1195
+ }
1196
+ }
1197
+ });
1198
+ }, (id * 50) + penaldy);
1199
}
1200
1201
function gotoServerModalHandler(guid) {
1202
- // console.log('goto server: ' + guid);
1202
+ // console.log('goto server: ' + guid);
1203
1204
- gotoServerStop = false;
1205
- var len = NETDATA.registry.machines[guid].alternate_urls.length;
1204
+ gotoServerStop = false;
1205
+ var len = NETDATA.registry.machines[guid].alternate_urls.length;
1206
1207
- document.getElementById('gotoServerResponse').innerHTML = '';
1208
- document.getElementById('gotoServerList').innerHTML = '';
1209
- document.getElementById('gotoServerName').innerHTML = NETDATA.registry.machines[guid].name;
1210
- $('#gotoServerModal').modal('show');
1207
+ document.getElementById('gotoServerResponse').innerHTML = '';
1208
+ document.getElementById('gotoServerList').innerHTML = '';
1209
+ document.getElementById('gotoServerName').innerHTML = NETDATA.registry.machines[guid].name;
1210
+ $('#gotoServerModal').modal('show');
1211
1212
- gotoServerValidateRemaining = len;
1213
- while(len--)
1214
- gotoServerValidateUrl(len, guid, NETDATA.registry.machines[guid].alternate_urls[len]);
1212
+ gotoServerValidateRemaining = len;
1213
+ while(len--)
1214
+ gotoServerValidateUrl(len, guid, NETDATA.registry.machines[guid].alternate_urls[len]);
1215
1216
- return false;
1216
+ return false;
1217
}
1218
1219
function gotoServerInit() {
1220
- $(".registry_link").on('click', function(e) {
1221
- if(e.which === 2) {
1222
- e.preventDefault();
1223
- gotoServerMiddleClick = true;
1224
- }
1225
- else {
1226
- gotoServerMiddleClick = false;
1227
- }
1228
-
1229
- return true;
1230
- });
1220
+ $(".registry_link").on('click', function(e) {
1221
+ if(e.which === 2) {
1222
+ e.preventDefault();
1223
+ gotoServerMiddleClick = true;
1224
+ }
1225
+ else {
1226
+ gotoServerMiddleClick = false;
1227
+ }
1228
+
1229
+ return true;
1230
+ });
1231
}
1232
1233
function switchRegistryModalHandler() {
1234
- document.getElementById('switchRegistryPersonGUID').value = NETDATA.registry.person_guid;
1235
- document.getElementById('switchRegistryURL').innerHTML = NETDATA.registry.server;
1236
- document.getElementById('switchRegistryResponse').innerHTML = '';
1237
- $('#switchRegistryModal').modal('show');
1234
+ document.getElementById('switchRegistryPersonGUID').value = NETDATA.registry.person_guid;
1235
+ document.getElementById('switchRegistryURL').innerHTML = NETDATA.registry.server;
1236
+ document.getElementById('switchRegistryResponse').innerHTML = '';
1237
+ $('#switchRegistryModal').modal('show');
1238
}
1239
1240
function notifyForSwitchRegistry() {
1241
- var n = document.getElementById('switchRegistryPersonGUID').value;
1242
-
1243
- if(n !== '' && n.length === 36) {
1244
- NETDATA.registry.switch(n, function(result) {
1245
- if(result !== null) {
1246
- $('#switchRegistryModal').modal('hide');
1247
- NETDATA.registry.init();
1248
- }
1249
- else {
1250
- document.getElementById('switchRegistryResponse').innerHTML = "<b>Sorry! The registry rejected your request.</b>";
1251
- }
1252
- });
1253
- }
1254
- else
1255
- document.getElementById('switchRegistryResponse').innerHTML = "<b>The ID you have entered is not a GUID.</b>";
1241
+ var n = document.getElementById('switchRegistryPersonGUID').value;
1242
+
1243
+ if(n !== '' && n.length === 36) {
1244
+ NETDATA.registry.switch(n, function(result) {
1245
+ if(result !== null) {
1246
+ $('#switchRegistryModal').modal('hide');
1247
+ NETDATA.registry.init();
1248
+ }
1249
+ else {
1250
+ document.getElementById('switchRegistryResponse').innerHTML = "<b>Sorry! The registry rejected your request.</b>";
1251
+ }
1252
+ });
1253
+ }
1254
+ else
1255
+ document.getElementById('switchRegistryResponse').innerHTML = "<b>The ID you have entered is not a GUID.</b>";
1256
}
1257
1258
var deleteRegistryUrl = null;
1259
function deleteRegistryModalHandler(guid, name, url) {
1260
- deleteRegistryUrl = url;
1261
- document.getElementById('deleteRegistryServerName').innerHTML = name;
1262
- document.getElementById('deleteRegistryServerName2').innerHTML = name;
1263
- document.getElementById('deleteRegistryServerURL').innerHTML = url;
1264
- document.getElementById('deleteRegistryResponse').innerHTML = '';
1265
- $('#deleteRegistryModal').modal('show');
1260
+ deleteRegistryUrl = url;
1261
+ document.getElementById('deleteRegistryServerName').innerHTML = name;
1262
+ document.getElementById('deleteRegistryServerName2').innerHTML = name;
1263
+ document.getElementById('deleteRegistryServerURL').innerHTML = url;
1264
+ document.getElementById('deleteRegistryResponse').innerHTML = '';
1265
+ $('#deleteRegistryModal').modal('show');
1266
}
1267
1268
function notifyForDeleteRegistry() {
1269
- if(deleteRegistryUrl) {
1270
- NETDATA.registry.delete(deleteRegistryUrl, function(result) {
1271
- if(result !== null) {
1272
- deleteRegistryUrl = null;
1273
- $('#deleteRegistryModal').modal('hide');
1274
- NETDATA.registry.init();
1275
- }
1276
- else {
1277
- document.getElementById('deleteRegistryResponse').innerHTML = "<b>Sorry! this command was rejected by the registry server.</b>";
1278
- }
1279
- });
1280
- }
1269
+ if(deleteRegistryUrl) {
1270
+ NETDATA.registry.delete(deleteRegistryUrl, function(result) {
1271
+ if(result !== null) {
1272
+ deleteRegistryUrl = null;
1273
+ $('#deleteRegistryModal').modal('hide');
1274
+ NETDATA.registry.init();
1275
+ }
1276
+ else {
1277
+ document.getElementById('deleteRegistryResponse').innerHTML = "<b>Sorry! this command was rejected by the registry server.</b>";
1278
+ }
1279
+ });
1280
+ }
1281
}
1282
1283
var options = {
1284
- sparklines_registry: {},
1285
- submenu_names: {},
1286
- data: null,
1287
- hostname: 'netdata_server', // will be overwritten by the netdata server
1288
- categories: new Array(),
1289
- categories_idx: {},
1290
- families: new Array(),
1291
- families_idx: {},
1292
-
1293
- chartsPerRow: 0,
1294
- chartsMinWidth: 1450,
1295
- chartsHeight: 180,
1296
- sparklinesHeight: 60,
1284
+ sparklines_registry: {},
1285
+ submenu_names: {},
1286
+ data: null,
1287
+ hostname: 'netdata_server', // will be overwritten by the netdata server
1288
+ categories: new Array(),
1289
+ categories_idx: {},
1290
+ families: new Array(),
1291
+ families_idx: {},
1292
+
1293
+ chartsPerRow: 0,
1294
+ chartsMinWidth: 1450,
1295
+ chartsHeight: 180,
1296
+ sparklinesHeight: 60,
1297
};
1298
1299
// generate a sparkline
1300
// used in the documentation
1301
function sparkline(chart, dimension, units) {
1302
- var key = chart + '.' + dimension;
1302
+ var key = chart + '.' + dimension;
1303
1304
- if(typeof units === 'undefined')
1305
- units = '';
1304
+ if(typeof units === 'undefined')
1305
+ units = '';
1306
1307
- if(typeof options.sparklines_registry[key] === 'undefined')
1308
- options.sparklines_registry[key] = { count: 1 };
1309
- else
1310
- options.sparklines_registry[key].count++;
1307
+ if(typeof options.sparklines_registry[key] === 'undefined')
1308
+ options.sparklines_registry[key] = { count: 1 };
1309
+ else
1310
+ options.sparklines_registry[key].count++;
1311
1312
- key = key + '.' + options.sparklines_registry[key].count;
1312
+ key = key + '.' + options.sparklines_registry[key].count;
1313
1314
- var h = '<div data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')';
1314
+ var h = '<div data-netdata="' + chart + '" data-after="-120" data-width="25%" data-height="15px" data-chart-library="dygraph" data-dygraph-theme="sparkline" data-dimensions="' + dimension + '" data-show-value-of-' + dimension + '-at="' + key + '"></div> (<span id="' + key + '" style="display: inline-block; min-width: 50px; text-align: right;">X</span>' + units + ')';
1315
1316
- return h;
1316
+ return h;
1317
}
1318
1319
function chartsPerRow(total) {
1320
- if(options.chartsPerRow === 0) {
1321
- width = Math.floor(total / options.chartsMinWidth);
1322
- if(width === 0) width = 1;
1323
- return width;
1324
- }
1325
- else return options.chartsPerRow;
1320
+ if(options.chartsPerRow === 0) {
1321
+ width = Math.floor(total / options.chartsMinWidth);
1322
+ if(width === 0) width = 1;
1323
+ return width;
1324
+ }
1325
+ else return options.chartsPerRow;
1326
}
1327
1328
function prioritySort(a, b) {
1329
- if(a.priority < b.priority) return -1;
1330
- if(a.priority > b.priority) return 1;
1331
- if(a.name < b.name) return -1;
1332
- return 1;
1329
+ if(a.priority < b.priority) return -1;
1330
+ if(a.priority > b.priority) return 1;
1331
+ if(a.name < b.name) return -1;
1332
+ return 1;
1333
}
1334
1335
function sortObjectByPriority(object) {
1336
- var idx = {};
1337
- var sorted = new Array();
1338
-
1339
- for(var i in object) {
1340
- if(typeof idx[i] === 'undefined') {
1341
- idx[i] = object[i];
1342
- sorted.push(i);
1343
- }
1344
- }
1345
-
1346
- sorted.sort(function(a, b) {
1347
- if(idx[a].priority < idx[b].priority) return -1;
1348
- if(idx[a].priority > idx[b].priority) return 1;
1349
- if(a < b) return -1;
1350
- return 1;
1351
- });
1352
-
1353
- return sorted;
1336
+ var idx = {};
1337
+ var sorted = new Array();
1338
+
1339
+ for(var i in object) {
1340
+ if(typeof idx[i] === 'undefined') {
1341
+ idx[i] = object[i];
1342
+ sorted.push(i);
1343
+ }
1344
+ }
1345
+
1346
+ sorted.sort(function(a, b) {
1347
+ if(idx[a].priority < idx[b].priority) return -1;
1348
+ if(idx[a].priority > idx[b].priority) return 1;
1349
+ if(a < b) return -1;
1350
+ return 1;
1351
+ });
1352
+
1353
+ return sorted;
1354
}
1355
1356
@@ -1358,200 +1358,200 @@ function sortObjectByPriority(object) {
1358
// scroll to a section, without changing the browser history
1359
1360
function scrollToId(hash) {
1361
- if(hash && hash != '') {
1362
- var offset = $('#' + hash).offset();
1363
- if(typeof offset !== 'undefined')
1364
- $('html, body').animate({ scrollTop: offset.top }, 0);
1365
- }
1366
-
1367
- // we must return false to prevent the default action
1368
- return false;
1361
+ if(hash && hash != '') {
1362
+ var offset = $('#' + hash).offset();
1363
+ if(typeof offset !== 'undefined')
1364
+ $('html, body').animate({ scrollTop: offset.top }, 0);
1365
+ }
1366
+
1367
+ // we must return false to prevent the default action
1368
+ return false;
1369
}
1370
1371
// ----------------------------------------------------------------------------
1372
1373
function gaugeChart(title, width, dimensions, colors) {
1374
- if(typeof colors === 'undefined')
1375
- colors = '';
1376
-
1377
- if(typeof dimensions === 'undefined')
1378
- dimensions = '';
1379
-
1380
- return '<div data-netdata="CHART_UNIQUE_ID"'
1381
- + ' data-dimensions="' + dimensions + '"'
1382
- + ' data-chart-library="gauge"'
1383
- + ' data-gauge-adjust="width"'
1384
- + ' data-title="' + title + '"'
1385
- + ' data-width="' + width + '"'
1386
- + ' data-before="0"'
1387
- + ' data-after="-CHART_DURATION"'
1388
- + ' data-points="CHART_DURATION"'
1389
- + ' data-colors="' + colors + '"'
1390
- + ' role="application"></div>';
1374
+ if(typeof colors === 'undefined')
1375
+ colors = '';
1376
+
1377
+ if(typeof dimensions === 'undefined')
1378
+ dimensions = '';
1379
+
1380
+ return '<div data-netdata="CHART_UNIQUE_ID"'
1381
+ + ' data-dimensions="' + dimensions + '"'
1382
+ + ' data-chart-library="gauge"'
1383
+ + ' data-gauge-adjust="width"'
1384
+ + ' data-title="' + title + '"'
1385
+ + ' data-width="' + width + '"'
1386
+ + ' data-before="0"'
1387
+ + ' data-after="-CHART_DURATION"'
1388
+ + ' data-points="CHART_DURATION"'
1389
+ + ' data-colors="' + colors + '"'
1390
+ + ' role="application"></div>';
1391
}
1392
1393
// ----------------------------------------------------------------------------
1394
1395
var menuData = {
1396
- 'system': {
1397
- title: 'System Overview',
1398
- info: 'Overview of the key system metrics.'
1399
- },
1400
-
1401
- 'ap': {
1402
- title: 'Access Points',
1403
- info: undefined
1404
- },
1405
-
1406
- 'tc': {
1407
- title: 'Quality of Service',
1408
- info: 'Netdata collects and visualizes tc class utilization using its <a href="https://github.com/firehol/netdata/blob/master/plugins.d/tc-qos-helper.sh" target="_blank">tc-helper plugin</a>. If you also use <a href="http://firehol.org/#fireqos" target="_blank">FireQOS</a> for setting up QoS, netdata automatically collects interface and class names. If your QoS configuration includes overheads calculation, the values shown here will include these overheads (the total bandwidth for the same interface as reported in the Network Interfaces section, will be lower than the total bandwidth reported here). Also, data collection may have a slight time difference compared to the interface (QoS data collection is implemented with a BASH script, so a shift in data collection of a few milliseconds should be justified).'
1409
- },
1410
-
1411
- 'net': {
1412
- title: 'Network Interfaces',
1413
- info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
1414
- },
1415
-
1416
- 'ipv4': {
1417
- title: 'IPv4 Networking',
1418
- info: undefined
1419
- },
1420
-
1421
- 'ipv6': {
1422
- title: 'IPv6 Networking',
1423
- info: undefined
1424
- },
1425
-
1426
- 'ipvs': {
1427
- title: 'IP Virtual Server',
1428
- info: undefined
1429
- },
1430
-
1431
- 'netfilter': {
1432
- title: 'Firewall (netfilter)',
1433
- info: undefined
1434
- },
1435
-
1436
- 'cpu': {
1437
- title: 'CPUs',
1438
- info: undefined
1439
- },
1440
-
1441
- 'mem': {
1442
- title: 'Memory',
1443
- info: undefined
1444
- },
1445
-
1446
- 'disk': {
1447
- title: 'Disks',
1448
- info: 'Charts with performance information for all the system disks. Special care has been given to present disk performance metrics in a way compatible with <code>iostat -x</code>. netdata by default prevents rendering performance charts for individual partitions and unmounted virtual disks. Disabled charts can still be enabled by altering the relative settings in the netdata configuration file.'
1449
- },
1450
-
1451
- 'sensors': {
1452
- title: 'Sensors',
1453
- info: undefined
1454
- },
1455
-
1456
- 'nfsd': {
1457
- title: 'File Server (nfsd)',
1458
- info: undefined
1459
- },
1460
-
1461
- 'apps': {
1462
- title: 'Applications',
1463
- info: 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics for applications of interest, defined in <code>/etc/netdata/apps_groups.conf</code> (the default is <a href="https://github.com/firehol/netdata/blob/master/conf.d/apps_groups.conf" target="_blank">here</a>). The plugin internally builds a process tree (much like <code>ps fax</code> does), and groups processes together (evaluating both child and parent processes) so that the result is always a chart with a predefined set of dimensions (of course, only application groups found running are reported). The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
1464
- height: 1.5
1465
- },
1466
-
1467
- 'users': {
1468
- title: 'Users',
1469
- info: 'Per user statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
1470
- height: 1.5
1471
- },
1472
-
1473
- 'groups': {
1474
- title: 'User Groups',
1475
- info: 'Per user group statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user group. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
1476
- height: 1.5
1477
- },
1478
-
1479
- 'netdata': {
1480
- title: 'Netdata Monitoring',
1481
- info: undefined
1482
- },
1483
-
1484
- 'example': {
1485
- title: 'Example Charts',
1486
- info: undefined
1487
- },
1488
-
1489
- 'cgroup': {
1490
- title: 'Container',
1491
- info: undefined
1492
- },
1493
-
1494
- 'memcached': {
1495
- title: 'memcached',
1496
- info: undefined
1497
- },
1498
-
1499
- 'mysql': {
1500
- title: 'MySQL',
1501
- info: undefined
1502
- },
1503
-
1504
- 'redis': {
1505
- title: 'Redis',
1506
- info: undefined
1507
- },
1508
-
1509
- 'ipfs': {
1510
- title: 'IPFS',
1511
- info: undefined
1512
- },
1513
-
1514
- 'phpfpm': {
1515
- title: 'PHP-FPM',
1516
- info: undefined,
1517
- },
1518
-
1519
- 'nginx': {
1520
- title: 'nginx',
1521
- info: undefined,
1522
- },
1523
-
1524
- 'apache': {
1525
- title: 'Apache',
1526
- info: undefined,
1527
- },
1528
-
1529
- 'named': {
1530
- title: 'named',
1531
- info: undefined
1532
- }
1396
+ 'system': {
1397
+ title: 'System Overview',
1398
+ info: 'Overview of the key system metrics.'
1399
+ },
1400
+
1401
+ 'ap': {
1402
+ title: 'Access Points',
1403
+ info: undefined
1404
+ },
1405
+
1406
+ 'tc': {
1407
+ title: 'Quality of Service',
1408
+ info: 'Netdata collects and visualizes tc class utilization using its <a href="https://github.com/firehol/netdata/blob/master/plugins.d/tc-qos-helper.sh" target="_blank">tc-helper plugin</a>. If you also use <a href="http://firehol.org/#fireqos" target="_blank">FireQOS</a> for setting up QoS, netdata automatically collects interface and class names. If your QoS configuration includes overheads calculation, the values shown here will include these overheads (the total bandwidth for the same interface as reported in the Network Interfaces section, will be lower than the total bandwidth reported here). Also, data collection may have a slight time difference compared to the interface (QoS data collection is implemented with a BASH script, so a shift in data collection of a few milliseconds should be justified).'
1409
+ },
1410
+
1411
+ 'net': {
1412
+ title: 'Network Interfaces',
1413
+ info: 'Per network interface statistics collected from <code>/proc/net/dev</code>.'
1414
+ },
1415
+
1416
+ 'ipv4': {
1417
+ title: 'IPv4 Networking',
1418
+ info: undefined
1419
+ },
1420
+
1421
+ 'ipv6': {
1422
+ title: 'IPv6 Networking',
1423
+ info: undefined
1424
+ },
1425
+
1426
+ 'ipvs': {
1427
+ title: 'IP Virtual Server',
1428
+ info: undefined
1429
+ },
1430
+
1431
+ 'netfilter': {
1432
+ title: 'Firewall (netfilter)',
1433
+ info: undefined
1434
+ },
1435
+
1436
+ 'cpu': {
1437
+ title: 'CPUs',
1438
+ info: undefined
1439
+ },
1440
+
1441
+ 'mem': {
1442
+ title: 'Memory',
1443
+ info: undefined
1444
+ },
1445
+
1446
+ 'disk': {
1447
+ title: 'Disks',
1448
+ info: 'Charts with performance information for all the system disks. Special care has been given to present disk performance metrics in a way compatible with <code>iostat -x</code>. netdata by default prevents rendering performance charts for individual partitions and unmounted virtual disks. Disabled charts can still be enabled by altering the relative settings in the netdata configuration file.'
1449
+ },
1450
+
1451
+ 'sensors': {
1452
+ title: 'Sensors',
1453
+ info: undefined
1454
+ },
1455
+
1456
+ 'nfsd': {
1457
+ title: 'File Server (nfsd)',
1458
+ info: undefined
1459
+ },
1460
+
1461
+ 'apps': {
1462
+ title: 'Applications',
1463
+ info: 'Per application statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics for applications of interest, defined in <code>/etc/netdata/apps_groups.conf</code> (the default is <a href="https://github.com/firehol/netdata/blob/master/conf.d/apps_groups.conf" target="_blank">here</a>). The plugin internally builds a process tree (much like <code>ps fax</code> does), and groups processes together (evaluating both child and parent processes) so that the result is always a chart with a predefined set of dimensions (of course, only application groups found running are reported). The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
1464
+ height: 1.5
1465
+ },
1466
+
1467
+ 'users': {
1468
+ title: 'Users',
1469
+ info: 'Per user statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
1470
+ height: 1.5
1471
+ },
1472
+
1473
+ 'groups': {
1474
+ title: 'User Groups',
1475
+ info: 'Per user group statistics are collected using netdata\'s <code>apps.plugin</code>. This plugin walks through the entire <code>/proc</code> filesystem and aggregates statistics per user group. The reported values are compatible with <code>top</code>, although the netdata plugin counts also the resources of exited children (unlike <code>top</code> which shows only the resources of the currently running processes). So for processes like shell scripts, the reported values include the resources used by the commands these scripts run within each timeframe.',
1476
+ height: 1.5
1477
+ },
1478
+
1479
+ 'netdata': {
1480
+ title: 'Netdata Monitoring',
1481
+ info: undefined
1482
+ },
1483
+
1484
+ 'example': {
1485
+ title: 'Example Charts',
1486
+ info: undefined
1487
+ },
1488
+
1489
+ 'cgroup': {
1490
+ title: 'Container',
1491
+ info: undefined
1492
+ },
1493
+
1494
+ 'memcached': {
1495
+ title: 'memcached',
1496
+ info: undefined
1497
+ },
1498
+
1499
+ 'mysql': {
1500
+ title: 'MySQL',
1501
+ info: undefined
1502
+ },
1503
+
1504
+ 'redis': {
1505
+ title: 'Redis',
1506
+ info: undefined
1507
+ },
1508
+
1509
+ 'ipfs': {
1510
+ title: 'IPFS',
1511
+ info: undefined
1512
+ },
1513
+
1514
+ 'phpfpm': {
1515
+ title: 'PHP-FPM',
1516
+ info: undefined,
1517
+ },
1518
+
1519
+ 'nginx': {
1520
+ title: 'nginx',
1521
+ info: undefined,
1522
+ },
1523
+
1524
+ 'apache': {
1525
+ title: 'Apache',
1526
+ info: undefined,
1527
+ },
1528
+
1529
+ 'named': {
1530
+ title: 'named',
1531
+ info: undefined
1532
+ }
1533
};
1534
1535
var submenuData = {
1536
- 'mem.ksm': {
1537
- title: 'Memory Deduper',
1538
- info: 'Kernel Same-page Merging (KSM) performance monitoring, read from several files in <code>/sys/kernel/mm/ksm/</code>. KSM is a memory-saving de-duplication feature in the Linux kernel (since version 2.6.32). The KSM daemon ksmd periodically scans those areas of user memory which have been registered with it, looking for pages of identical content which can be replaced by a single write-protected page (which is automatically copied if a process later wants to update its content). KSM was originally developed for use with KVM (where it was known as Kernel Shared Memory), to fit more virtual machines into physical memory, by sharing the data common between them. But it can be useful to any application which generates many instances of the same data.'
1539
- },
1540
-
1541
- 'netfilter.conntrack': {
1542
- title: 'Connection Tracker',
1543
- info: 'Netfilter Connection Tracker performance monitoring, read from <code>/proc/net/stat/nf_conntrack</code>. The connection tracker keeps track of all connections of the machine, inbound and outbound. It works by keeping a database with all open connections, tracking network and address translation and connection expectations.'
1544
- },
1545
-
1546
- 'netfilter.nfacct': {
1547
- title: 'Bandwidth Accounting',
1548
- info: 'The following information is read using the <code>nfacct.plugin</code>.'
1549
- },
1550
-
1551
- 'netfilter.synproxy': {
1552
- title: 'DDoS Protection',
1553
- info: 'DDoS Protection performance monitoring read from <code>/proc/net/stat/synproxy</code>. <a href="https://github.com/firehol/firehol/wiki/Working-with-SYNPROXY" target="_blank">SYNPROXY</a> is a TCP SYN packets proxy. It is used to protect any TCP server (like a web server) from SYN floods and similar DDoS attacks. It is a netfilter module, in the Linux kernel (since version 3.12). It is optimized to handle millions of packets per second utilizing all CPUs available without any concurrency locking between the connections. It can be used for any kind of TCP traffic (even encrypted), since it does not interfere with the content itself.'
1554
- }
1536
+ 'mem.ksm': {
1537
+ title: 'Memory Deduper',
1538
+ info: 'Kernel Same-page Merging (KSM) performance monitoring, read from several files in <code>/sys/kernel/mm/ksm/</code>. KSM is a memory-saving de-duplication feature in the Linux kernel (since version 2.6.32). The KSM daemon ksmd periodically scans those areas of user memory which have been registered with it, looking for pages of identical content which can be replaced by a single write-protected page (which is automatically copied if a process later wants to update its content). KSM was originally developed for use with KVM (where it was known as Kernel Shared Memory), to fit more virtual machines into physical memory, by sharing the data common between them. But it can be useful to any application which generates many instances of the same data.'
1539
+ },
1540
+
1541
+ 'netfilter.conntrack': {
1542
+ title: 'Connection Tracker',
1543
+ info: 'Netfilter Connection Tracker performance monitoring, read from <code>/proc/net/stat/nf_conntrack</code>. The connection tracker keeps track of all connections of the machine, inbound and outbound. It works by keeping a database with all open connections, tracking network and address translation and connection expectations.'
1544
+ },
1545
+
1546
+ 'netfilter.nfacct': {
1547
+ title: 'Bandwidth Accounting',
1548
+ info: 'The following information is read using the <code>nfacct.plugin</code>.'
1549
+ },
1550
+
1551
+ 'netfilter.synproxy': {
1552
+ title: 'DDoS Protection',
1553
+ info: 'DDoS Protection performance monitoring read from <code>/proc/net/stat/synproxy</code>. <a href="https://github.com/firehol/firehol/wiki/Working-with-SYNPROXY" target="_blank">SYNPROXY</a> is a TCP SYN packets proxy. It is used to protect any TCP server (like a web server) from SYN floods and similar DDoS attacks. It is a netfilter module, in the Linux kernel (since version 3.12). It is optimized to handle millions of packets per second utilizing all CPUs available without any concurrency locking between the connections. It can be used for any kind of TCP traffic (even encrypted), since it does not interfere with the content itself.'
1554
+ }
1555
};
1556
1557
//
@@ -1565,433 +1565,440 @@ var submenuData = {
1565
// height: the ratio of the chart height relative to the default
1566
//
1567
var chartData = {
1568
- 'system.cpu': {
1569
- info: 'Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the <a href="#cpu">CPUs</a> section and per application usage at the <a href="#apps">Applications Monitoring</a> section.<br/>Keep an eye on <b>iowait</b> ' + sparkline('system.cpu', 'iowait', '%') + '. If it is constantly high, your disks are a bottleneck and they slow your system down.<br/>Another important metric worth monitoring, is <b>softirq</b> ' + sparkline('system.cpu', 'softirq', '%') + '. A constantly high percentage of softirq may indicate network drivers issues.'
1570
- },
1571
-
1572
- 'system.load': {
1573
- info: 'Current system load, i.e. the number of processes using CPU or waiting for system resources (usually CPU and disk). The 3 metrics refer to 1, 5 and 15 minute averages. Linux calculates this once every 5 seconds. Netdata reads them from <code>/proc/loadavg</code>. For more information check <a href="https://en.wikipedia.org/wiki/Load_(computing)" target="_blank">this wikipedia article</a>',
1574
- height: 0.7
1575
- },
1576
-
1577
- 'system.io': {
1578
- info: 'Total Disk I/O, for all disks, read from <code>/proc/vmstat</code>. You can get detailed information about each disk at the <a href="#disk">Disks</a> section and per application Disk usage at the <a href="#apps">Applications Monitoring</a> section.'
1579
- },
1580
-
1581
- 'system.swapio': {
1582
- info: 'Total Swap I/O, read from <code>/proc/vmstat</code>. (netdata measures both <code>in</code> and <code>out</code>. If either of them is not shown in the chart, it is because it is zero - you can change the page settings to always render all the available dimensions on all charts).'
1583
- },
1584
-
1585
- 'system.pgfaults': {
1586
- info: 'Total page faults, read from <code>/proc/vmstat</code>. <b>Major page faults</b> indicates that the system is using its swap. You can find which applications use the swap at the <a href="#apps">Applications Monitoring</a> section.'
1587
- },
1588
-
1589
- 'system.entropy': {
1590
- colors: '#CC22AA',
1591
- info: '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, read from <code>/proc/sys/kernel/random/entropy_avail</code>, is like a pool of random numbers that are mainly used in cryptography. It is advised that the pool remains always <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/" target="_blank">above 200</a>. If the pool of entropy gets empty, you risk your security to be predictable and you should install a user-space random numbers generating daemon, like <a href="http://www.issihosts.com/haveged/" target="_blank">haveged</a>, to keep the pool in healthy levels.'
1592
- },
1593
-
1594
- 'system.forks': {
1595
- colors: '#5555DD',
1596
- info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'
1597
- },
1598
-
1599
- 'system.intr': {
1600
- colors: '#DD5555',
1601
- info: 'Total number of CPU interrupts, read from <code>/proc/stat</code>. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#cpu">CPUs</a> section where interrupts are analyzed per CPU core.'
1602
- },
1603
-
1604
- 'system.interrupts': {
1605
- info: 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#cpu">CPUs</a> section, interrupts are analyzed per CPU core.'
1606
- },
1607
-
1608
- 'system.softirqs': {
1609
- info: 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#cpu">CPUs</a> section, softirqs are analyzed per CPU core.'
1610
- },
1611
-
1612
- 'system.processes': {
1613
- info: 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.'
1614
- },
1615
-
1616
- 'system.active_processes': {
1617
- info: 'All system active processes, read from <code>/proc/loadavg</code>.'
1618
- },
1619
-
1620
- 'system.ctxt': {
1621
- info: '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.'
1622
- },
1623
-
1624
- 'system.idlejitter': {
1625
- colors: '#5555AA',
1626
- info: 'Idle jitter is calculated by netdata. A thread is spawned that requests to sleep for a few microseconds. When the system wakes it up, it measures how many microseconds have passed. The difference between the requested and the actual duration of the sleep, is the <b>idle jitter</b>. This number is useful in real-time environments, where CPU jitter can affect the quality of the service (like VoIP media gateways).'
1627
- },
1628
-
1629
- 'system.ipv4': {
1630
- info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>.'
1631
- },
1632
-
1633
- 'system.ipv6': {
1634
- info: 'Total IPv6 Traffic, read from <code>/proc/net/snmp6</code>.'
1635
- },
1636
-
1637
- 'system.ram': {
1638
- info: 'System memory, read from <code>/proc/meminfo</code>.'
1639
- },
1640
-
1641
- 'system.swap': {
1642
- info: 'System swap memory, read from <code>/proc/meminfo</code>.'
1643
- },
1644
-
1645
- // ------------------------------------------------------------------------
1646
- // MEMORY
1647
-
1648
- 'mem.ksm_savings': {
1649
- heads: [
1650
- gaugeChart('Saved', '12%', 'savings', '#0099CC')
1651
- ]
1652
- },
1653
-
1654
- 'mem.ksm_ratios': {
1655
- heads: [
1656
- function(id) {
1657
- return '<div data-netdata="' + id + '"'
1658
- + ' data-gauge-max-value="100"'
1659
- + ' data-chart-library="gauge"'
1660
- + ' data-title="Savings"'
1661
- + ' data-units="percentage %"'
1662
- + ' data-gauge-adjust="width"'
1663
- + ' data-width="12%"'
1664
- + ' data-before="0"'
1665
- + ' data-after="-CHART_DURATION"'
1666
- + ' data-points="CHART_DURATION"'
1667
- + ' role="application"></div>';
1668
- }
1669
- ]
1670
- },
1671
-
1672
- 'mem.committed': {
1673
- colors: NETDATA.colors[3]
1674
- },
1675
-
1676
- // ------------------------------------------------------------------------
1677
- // APPS
1678
-
1679
- 'apps.cpu': {
1680
- height: 2.0
1681
- },
1682
-
1683
- 'apps.preads': {
1684
- height: 2.0
1685
- },
1686
-
1687
- 'apps.pwrites': {
1688
- height: 2.0
1689
- },
1690
-
1691
- // ------------------------------------------------------------------------
1692
- // USERS
1693
-
1694
- 'users.cpu': {
1695
- height: 2.0
1696
- },
1697
-
1698
- 'users.preads': {
1699
- height: 2.0
1700
- },
1701
-
1702
- 'users.pwrites': {
1703
- height: 2.0
1704
- },
1705
-
1706
- // ------------------------------------------------------------------------
1707
- // GROUPS
1708
-
1709
- 'groups.cpu': {
1710
- height: 2.0
1711
- },
1712
-
1713
- 'groups.preads': {
1714
- height: 2.0
1715
- },
1716
-
1717
- 'groups.pwrites': {
1718
- height: 2.0
1719
- },
1720
-
1721
- // ------------------------------------------------------------------------
1722
- // NETWORK QoS
1723
-
1724
- 'tc.qos': {
1725
- heads: [
1726
- function(id) {
1727
- if(id.match(/.*-ifb$/))
1728
- return gaugeChart('Inbound', '12%', '', '#5555AA');
1729
- else
1730
- return gaugeChart('Outbound', '12%', '', '#AA9900');
1731
- }
1732
- ]
1733
- },
1734
-
1735
- // ------------------------------------------------------------------------
1736
- // NETWORK INTERFACES
1737
-
1738
- 'net.net': {
1739
- heads: [
1740
- gaugeChart('Received', '12%', 'received'),
1741
- gaugeChart('Sent', '12%', 'sent')
1742
- ]
1743
- },
1744
-
1745
- // ------------------------------------------------------------------------
1746
- // NETFILTER
1747
-
1748
- 'netfilter.sockets': {
1749
- colors: '#88AA00',
1750
- heads: [
1751
- gaugeChart('Active Connections', '12%', '', '#88AA00')
1752
- ]
1753
- },
1754
-
1755
- 'netfilter.new': {
1756
- heads: [
1757
- gaugeChart('New Connections', '12%', 'new', '#5555AA')
1758
- ]
1759
- },
1760
-
1761
- // ------------------------------------------------------------------------
1762
- // DISKS
1763
-
1764
- 'disk.util': {
1765
- colors: '#FF5588',
1766
- heads: [
1767
- gaugeChart('Utilization', '12%', '', '#FF5588')
1768
- ],
1769
- info: 'Disk Utilization measures the amount of time the disk was busy with something. This is not related to its performance. 100% means that the Linux kernel always had an outstanding operation on the disk. Keep in mind that depending on the underlying technology of the disk, 100% here may or may not be an indication of congestion.'
1770
- },
1771
-
1772
- 'disk.backlog': {
1773
- colors: '#0099CC',
1774
- info: 'Backlog is an indication of the duration of pending disk operations. On every I/O event the Linux kernel is multiplying the time spent doing I/O since the last update of this field with the number of pending operations. While not accurate, this metric can provide an indication of the expected completion time of the operations in progress.'
1775
- },
1776
-
1777
- 'disk.io': {
1778
- heads: [
1779
- gaugeChart('Read', '12%', 'reads'),
1780
- gaugeChart('Write', '12%', 'writes')
1781
- ],
1782
- info: 'Amount of data transferred to and from disk.'
1783
- },
1784
-
1785
- 'disk.ops': {
1786
- info: 'Completed disk I/O operations. Keep in mind the number of operations requested might be higher, since the Linux kernel is able to merge adjacent to each other (see merged operations chart).'
1787
- },
1788
-
1789
- 'disk.qops': {
1790
- info: 'I/O operations currently in progress. This metric is a snapshot - it is not an average over the last interval.'
1791
- },
1792
-
1793
- 'disk.iotime': {
1794
- height: 0.5,
1795
- info: 'The sum of the duration of all completed I/O operations. This number can exceed the interval if the disk is able to execute I/O operations in parallel.'
1796
- },
1797
- 'disk.mops': {
1798
- height: 0.5,
1799
- info: 'The number of merged disk operations. The Linux kernel is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'
1800
- },
1801
- 'disk.svctm': {
1802
- height: 0.5,
1803
- info: 'The average service time for completed I/O operations. This metric is calculated using the total busy time of the disk and the number of completed operations. If the disk is able to execute multiple parallel operations the reporting average service time will be misleading.'
1804
- },
1805
- 'disk.avgsz': {
1806
- height: 0.5,
1807
- info: 'The average I/O operation size.'
1808
- },
1809
- 'disk.await': {
1810
- height: 0.5,
1811
- info: 'The average time for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.'
1812
- },
1813
-
1814
- 'disk.space': {
1815
- info: 'Disk space utilization. reserved for root is automatically reserved by the system to prevent the root user from getting out of space.'
1816
- },
1817
- 'disk.inodes': {
1818
- info: 'inodes (or index nodes) are filesystem objects (e.g. files and directories). On many types of file system implementations, the maximum number of inodes is fixed at filesystem creation, limiting the maximum number of files the filesystem can hold. It is possible for a device to run out of inodes. When this happens, new files cannot be created on the device, even though there may be free space available.'
1819
- },
1820
-
1821
- 'mysql.net': {
1822
- info: 'The amount of data sent to mysql clients (<strong>out</strong>) and received from mysql clients (<strong>in</strong>).'
1823
- },
1824
-
1825
- // ------------------------------------------------------------------------
1826
- // MYSQL
1827
-
1828
- 'mysql.queries': {
1829
- info: 'The number of statements executed by the server.<ul>' +
1830
- '<li><strong>queries</strong> counts the statements executed within stored SQL programs.</li>' +
1831
- '<li><strong>questions</strong> counts the statements sent to the mysql server by mysql clients.</li>' +
1832
- '<li><strong>slow queries</strong> counts the number of statements that took more than <a href="http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_long_query_time" target="_blank">long_query_time</a> seconds to be executed.' +
1833
- ' For more information about slow queries check the mysql <a href="http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html" target="_blank">slow query log</a>.</li>' +
1834
- '</ul>'
1835
- },
1836
-
1837
- 'mysql.handlers': {
1838
- info: 'Usage of the internal handlers of mysql. This chart provides very good insights of what the mysql server is actually doing.' +
1839
- ' (if the chart is not showing all these dimensions it is because they are zero - set <strong>Which dimensions to show?</strong> to <strong>All</strong> from the dashboard settings, to render even the zero values)<ul>' +
1840
- '<li><strong>commit</strong>, the number of internal <a href="http://dev.mysql.com/doc/refman/5.7/en/commit.html" target="_blank">COMMIT</a> statements.</li>' +
1841
- '<li><strong>delete</strong>, the number of times that rows have been deleted from tables.</li>' +
1842
- '<li><strong>prepare</strong>, a counter for the prepare phase of two-phase commit operations.</li>' +
1843
- '<li><strong>read first</strong>, the number of times the first entry in an index was read. A high value suggests that the server is doing a lot of full index scans; e.g. <strong>SELECT col1 FROM foo</strong>, with col1 indexed.</li>' +
1844
- '<li><strong>read key</strong>, the number of requests to read a row based on a key. If this value is high, it is a good indication that your tables are properly indexed for your queries.</li>' +
1845
- '<li><strong>read next</strong>, the number of requests to read the next row in key order. This value is incremented if you are querying an index column with a range constraint or if you are doing an index scan.</li>' +
1846
- '<li><strong>read prev</strong>, the number of requests to read the previous row in key order. This read method is mainly used to optimize <strong>ORDER BY ... DESC</strong>.</li>' +
1847
- '<li><strong>read rnd</strong>, the number of requests to read a row based on a fixed position. A high value indicates you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan entire tables or you have joins that do not use keys properly.</li>' +
1848
- '<li><strong>read rnd next</strong>, the number of requests to read the next row in the data file. This value is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.</li>' +
1849
- '<li><strong>rollback</strong>, the number of requests for a storage engine to perform a rollback operation.</li>' +
1850
- '<li><strong>savepoint</strong>, the number of requests for a storage engine to place a savepoint.</li>' +
1851
- '<li><strong>savepoint rollback</strong>, the number of requests for a storage engine to roll back to a savepoint.</li>' +
1852
- '<li><strong>update</strong>, the number of requests to update a row in a table.</li>' +
1853
- '<li><strong>write</strong>, the number of requests to insert a row in a table.</li>' +
1854
- '</ul>'
1855
- },
1856
-
1857
- 'mysql.table_locks': {
1858
- info: 'MySQL table locks counters: <ul>' +
1859
- '<li><strong>immediate</strong>, the number of times that a request for a table lock could be granted immediately.</li>' +
1860
- '<li><strong>waited</strong>, the number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.</li>' +
1861
- '</ul>'
1862
- },
1863
-
1864
- // ------------------------------------------------------------------------
1865
- // APACHE
1866
-
1867
- 'apache.connections': {
1868
- colors: NETDATA.colors[4],
1869
- mainheads: [
1870
- gaugeChart('Connections', '12%', '', NETDATA.colors[4])
1871
- ]
1872
- },
1873
-
1874
- 'apache.requests': {
1875
- colors: NETDATA.colors[0],
1876
- mainheads: [
1877
- gaugeChart('Requests', '12%', '', NETDATA.colors[0])
1878
- ]
1879
- },
1880
-
1881
- 'apache.net': {
1882
- colors: NETDATA.colors[3],
1883
- mainheads: [
1884
- gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
1885
- ]
1886
- },
1887
-
1888
- 'apache.workers': {
1889
- mainheads: [
1890
- function(id) {
1891
- return '<div data-netdata="' + id + '"'
1892
- + ' data-dimensions="busy"'
1893
- + ' data-append-options="percentage"'
1894
- + ' data-gauge-max-value="100"'
1895
- + ' data-chart-library="gauge"'
1896
- + ' data-title="Workers Utilization"'
1897
- + ' data-units="percentage %"'
1898
- + ' data-gauge-adjust="width"'
1899
- + ' data-width="12%"'
1900
- + ' data-before="0"'
1901
- + ' data-after="-CHART_DURATION"'
1902
- + ' data-points="CHART_DURATION"'
1903
- + ' role="application"></div>';
1904
- }
1905
- ]
1906
- },
1907
-
1908
- 'apache.bytesperreq': {
1909
- colors: NETDATA.colors[3],
1910
- height: 0.5
1911
- },
1912
-
1913
- 'apache.reqpersec': {
1914
- colors: NETDATA.colors[4],
1915
- height: 0.5
1916
- },
1917
-
1918
- 'apache.bytespersec': {
1919
- colors: NETDATA.colors[6],
1920
- height: 0.5
1921
- },
1922
-
1923
-
1924
- // ------------------------------------------------------------------------
1925
- // NGINX
1926
-
1927
- 'nginx.connections': {
1928
- colors: NETDATA.colors[4],
1929
- mainheads: [
1930
- gaugeChart('Connections', '12%', '', NETDATA.colors[4])
1931
- ]
1932
- },
1933
-
1934
- 'nginx.requests': {
1935
- colors: NETDATA.colors[0],
1936
- mainheads: [
1937
- gaugeChart('Requests', '12%', '', NETDATA.colors[0])
1938
- ]
1939
- }
1568
+ 'system.cpu': {
1569
+ info: 'Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the <a href="#cpu">CPUs</a> section and per application usage at the <a href="#apps">Applications Monitoring</a> section.<br/>Keep an eye on <b>iowait</b> ' + sparkline('system.cpu', 'iowait', '%') + '. If it is constantly high, your disks are a bottleneck and they slow your system down.<br/>Another important metric worth monitoring, is <b>softirq</b> ' + sparkline('system.cpu', 'softirq', '%') + '. A constantly high percentage of softirq may indicate network drivers issues.'
1570
+ },
1571
+
1572
+ 'system.load': {
1573
+ info: 'Current system load, i.e. the number of processes using CPU or waiting for system resources (usually CPU and disk). The 3 metrics refer to 1, 5 and 15 minute averages. Linux calculates this once every 5 seconds. Netdata reads them from <code>/proc/loadavg</code>. For more information check <a href="https://en.wikipedia.org/wiki/Load_(computing)" target="_blank">this wikipedia article</a>',
1574
+ height: 0.7
1575
+ },
1576
+
1577
+ 'system.io': {
1578
+ info: 'Total Disk I/O, for all disks, read from <code>/proc/vmstat</code>. You can get detailed information about each disk at the <a href="#disk">Disks</a> section and per application Disk usage at the <a href="#apps">Applications Monitoring</a> section.'
1579
+ },
1580
+
1581
+ 'system.swapio': {
1582
+ info: 'Total Swap I/O, read from <code>/proc/vmstat</code>. (netdata measures both <code>in</code> and <code>out</code>. If either of them is not shown in the chart, it is because it is zero - you can change the page settings to always render all the available dimensions on all charts).'
1583
+ },
1584
+
1585
+ 'system.pgfaults': {
1586
+ info: 'Total page faults, read from <code>/proc/vmstat</code>. <b>Major page faults</b> indicates that the system is using its swap. You can find which applications use the swap at the <a href="#apps">Applications Monitoring</a> section.'
1587
+ },
1588
+
1589
+ 'system.entropy': {
1590
+ colors: '#CC22AA',
1591
+ info: '<a href="https://en.wikipedia.org/wiki/Entropy_(computing)" target="_blank">Entropy</a>, read from <code>/proc/sys/kernel/random/entropy_avail</code>, is like a pool of random numbers that are mainly used in cryptography. It is advised that the pool remains always <a href="https://blog.cloudflare.com/ensuring-randomness-with-linuxs-random-number-generator/" target="_blank">above 200</a>. If the pool of entropy gets empty, you risk your security to be predictable and you should install a user-space random numbers generating daemon, like <a href="http://www.issihosts.com/haveged/" target="_blank">haveged</a>, to keep the pool in healthy levels.'
1592
+ },
1593
+
1594
+ 'system.forks': {
1595
+ colors: '#5555DD',
1596
+ info: 'The number of new processes created per second, read from <code>/proc/stat</code>.'
1597
+ },
1598
+
1599
+ 'system.intr': {
1600
+ colors: '#DD5555',
1601
+ info: 'Total number of CPU interrupts, read from <code>/proc/stat</code>. Check <code>system.interrupts</code> that gives more detail about each interrupt and also the <a href="#cpu">CPUs</a> section where interrupts are analyzed per CPU core.'
1602
+ },
1603
+
1604
+ 'system.interrupts': {
1605
+ info: 'CPU interrupts in detail, read from <code>/proc/interrupts</code>. At the <a href="#cpu">CPUs</a> section, interrupts are analyzed per CPU core.'
1606
+ },
1607
+
1608
+ 'system.softirqs': {
1609
+ info: 'CPU softirqs in detail, read from <code>/proc/softirqs</code>. At the <a href="#cpu">CPUs</a> section, softirqs are analyzed per CPU core.'
1610
+ },
1611
+
1612
+ 'system.processes': {
1613
+ info: 'System processes, read from <code>/proc/stat</code>. <b>Blocked</b> are processes that are willing to execute but they cannot, e.g. because they wait for disk activity.'
1614
+ },
1615
+
1616
+ 'system.active_processes': {
1617
+ info: 'All system active processes, read from <code>/proc/loadavg</code>.'
1618
+ },
1619
+
1620
+ 'system.ctxt': {
1621
+ info: '<a href="https://en.wikipedia.org/wiki/Context_switch" target="_blank">Context Switches</a>, read from <code>/proc/stat</code>, is the switching of the CPU from one process, task or thread to another. If there are many processes or threads willing to execute and very few CPU cores available to handle them, the system is making more context switching to balance the CPU resources among them. The whole process is computationally intensive. The more the context switches, the slower the system gets.'
1622
+ },
1623
+
1624
+ 'system.idlejitter': {
1625
+ colors: '#5555AA',
1626
+ info: 'Idle jitter is calculated by netdata. A thread is spawned that requests to sleep for a few microseconds. When the system wakes it up, it measures how many microseconds have passed. The difference between the requested and the actual duration of the sleep, is the <b>idle jitter</b>. This number is useful in real-time environments, where CPU jitter can affect the quality of the service (like VoIP media gateways).'
1627
+ },
1628
+
1629
+ 'system.ipv4': {
1630
+ info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>.'
1631
+ },
1632
+
1633
+ 'system.ipv6': {
1634
+ info: 'Total IPv6 Traffic, read from <code>/proc/net/snmp6</code>.'
1635
+ },
1636
+
1637
+ 'system.ram': {
1638
+ info: 'System memory, read from <code>/proc/meminfo</code>.'
1639
+ },
1640
+
1641
+ 'system.swap': {
1642
+ info: 'System swap memory, read from <code>/proc/meminfo</code>.'
1643
+ },
1644
+
1645
+ // ------------------------------------------------------------------------
1646
+ // MEMORY
1647
+
1648
+ 'mem.ksm_savings': {
1649
+ heads: [
1650
+ gaugeChart('Saved', '12%', 'savings', '#0099CC')
1651
+ ]
1652
+ },
1653
+
1654
+ 'mem.ksm_ratios': {
1655
+ heads: [
1656
+ function(id) {
1657
+ return '<div data-netdata="' + id + '"'
1658
+ + ' data-gauge-max-value="100"'
1659
+ + ' data-chart-library="gauge"'
1660
+ + ' data-title="Savings"'
1661
+ + ' data-units="percentage %"'
1662
+ + ' data-gauge-adjust="width"'
1663
+ + ' data-width="12%"'
1664
+ + ' data-before="0"'
1665
+ + ' data-after="-CHART_DURATION"'
1666
+ + ' data-points="CHART_DURATION"'
1667
+ + ' role="application"></div>';
1668
+ }
1669
+ ]
1670
+ },
1671
+
1672
+ 'mem.committed': {
1673
+ colors: NETDATA.colors[3]
1674
+ },
1675
+
1676
+ // ------------------------------------------------------------------------
1677
+ // APPS
1678
+
1679
+ 'apps.cpu': {
1680
+ height: 2.0
1681
+ },
1682
+
1683
+ 'apps.preads': {
1684
+ height: 2.0
1685
+ },
1686
+
1687
+ 'apps.pwrites': {
1688
+ height: 2.0
1689
+ },
1690
+
1691
+ // ------------------------------------------------------------------------
1692
+ // USERS
1693
+
1694
+ 'users.cpu': {
1695
+ height: 2.0
1696
+ },
1697
+
1698
+ 'users.preads': {
1699
+ height: 2.0
1700
+ },
1701
+
1702
+ 'users.pwrites': {
1703
+ height: 2.0
1704
+ },
1705
+
1706
+ // ------------------------------------------------------------------------
1707
+ // GROUPS
1708
+
1709
+ 'groups.cpu': {
1710
+ height: 2.0
1711
+ },
1712
+
1713
+ 'groups.preads': {
1714
+ height: 2.0
1715
+ },
1716
+
1717
+ 'groups.pwrites': {
1718
+ height: 2.0
1719
+ },
1720
+
1721
+ // ------------------------------------------------------------------------
1722
+ // NETWORK QoS
1723
+
1724
+ 'tc.qos': {
1725
+ heads: [
1726
+ function(id) {
1727
+ if(id.match(/.*-ifb$/))
1728
+ return gaugeChart('Inbound', '12%', '', '#5555AA');
1729
+ else
1730
+ return gaugeChart('Outbound', '12%', '', '#AA9900');
1731
+ }
1732
+ ]
1733
+ },
1734
+
1735
+ // ------------------------------------------------------------------------
1736
+ // NETWORK INTERFACES
1737
+
1738
+ 'net.net': {
1739
+ heads: [
1740
+ gaugeChart('Received', '12%', 'received'),
1741
+ gaugeChart('Sent', '12%', 'sent')
1742
+ ]
1743
+ },
1744
+
1745
+ // ------------------------------------------------------------------------
1746
+ // NETFILTER
1747
+
1748
+ 'netfilter.sockets': {
1749
+ colors: '#88AA00',
1750
+ heads: [
1751
+ gaugeChart('Active Connections', '12%', '', '#88AA00')
1752
+ ]
1753
+ },
1754
+
1755
+ 'netfilter.new': {
1756
+ heads: [
1757
+ gaugeChart('New Connections', '12%', 'new', '#5555AA')
1758
+ ]
1759
+ },
1760
+
1761
+ // ------------------------------------------------------------------------
1762
+ // DISKS
1763
+
1764
+ 'disk.util': {
1765
+ colors: '#FF5588',
1766
+ heads: [
1767
+ gaugeChart('Utilization', '12%', '', '#FF5588')
1768
+ ],
1769
+ info: 'Disk Utilization measures the amount of time the disk was busy with something. This is not related to its performance. 100% means that the Linux kernel always had an outstanding operation on the disk. Keep in mind that depending on the underlying technology of the disk, 100% here may or may not be an indication of congestion.'
1770
+ },
1771
+
1772
+ 'disk.backlog': {
1773
+ colors: '#0099CC',
1774
+ info: 'Backlog is an indication of the duration of pending disk operations. On every I/O event the Linux kernel is multiplying the time spent doing I/O since the last update of this field with the number of pending operations. While not accurate, this metric can provide an indication of the expected completion time of the operations in progress.'
1775
+ },
1776
+
1777
+ 'disk.io': {
1778
+ heads: [
1779
+ gaugeChart('Read', '12%', 'reads'),
1780
+ gaugeChart('Write', '12%', 'writes')
1781
+ ],
1782
+ info: 'Amount of data transferred to and from disk.'
1783
+ },
1784
+
1785
+ 'disk.ops': {
1786
+ info: 'Completed disk I/O operations. Keep in mind the number of operations requested might be higher, since the Linux kernel is able to merge adjacent to each other (see merged operations chart).'
1787
+ },
1788
+
1789
+ 'disk.qops': {
1790
+ info: 'I/O operations currently in progress. This metric is a snapshot - it is not an average over the last interval.'
1791
+ },
1792
+
1793
+ 'disk.iotime': {
1794
+ height: 0.5,
1795
+ info: 'The sum of the duration of all completed I/O operations. This number can exceed the interval if the disk is able to execute I/O operations in parallel.'
1796
+ },
1797
+ 'disk.mops': {
1798
+ height: 0.5,
1799
+ info: 'The number of merged disk operations. The Linux kernel is able to merge adjacent I/O operations, for example two 4KB reads can become one 8KB read before given to disk.'
1800
+ },
1801
+ 'disk.svctm': {
1802
+ height: 0.5,
1803
+ info: 'The average service time for completed I/O operations. This metric is calculated using the total busy time of the disk and the number of completed operations. If the disk is able to execute multiple parallel operations the reporting average service time will be misleading.'
1804
+ },
1805
+ 'disk.avgsz': {
1806
+ height: 0.5,
1807
+ info: 'The average I/O operation size.'
1808
+ },
1809
+ 'disk.await': {
1810
+ height: 0.5,
1811
+ info: 'The average time for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.'
1812
+ },
1813
+
1814
+ 'disk.space': {
1815
+ info: 'Disk space utilization. reserved for root is automatically reserved by the system to prevent the root user from getting out of space.'
1816
+ },
1817
+ 'disk.inodes': {
1818
+ info: 'inodes (or index nodes) are filesystem objects (e.g. files and directories). On many types of file system implementations, the maximum number of inodes is fixed at filesystem creation, limiting the maximum number of files the filesystem can hold. It is possible for a device to run out of inodes. When this happens, new files cannot be created on the device, even though there may be free space available.'
1819
+ },
1820
+
1821
+ 'mysql.net': {
1822
+ info: 'The amount of data sent to mysql clients (<strong>out</strong>) and received from mysql clients (<strong>in</strong>).'
1823
+ },
1824
+
1825
+ // ------------------------------------------------------------------------
1826
+ // MYSQL
1827
+
1828
+ 'mysql.queries': {
1829
+ info: 'The number of statements executed by the server.<ul>' +
1830
+ '<li><strong>queries</strong> counts the statements executed within stored SQL programs.</li>' +
1831
+ '<li><strong>questions</strong> counts the statements sent to the mysql server by mysql clients.</li>' +
1832
+ '<li><strong>slow queries</strong> counts the number of statements that took more than <a href="http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_long_query_time" target="_blank">long_query_time</a> seconds to be executed.' +
1833
+ ' For more information about slow queries check the mysql <a href="http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html" target="_blank">slow query log</a>.</li>' +
1834
+ '</ul>'
1835
+ },
1836
+
1837
+ 'mysql.handlers': {
1838
+ info: 'Usage of the internal handlers of mysql. This chart provides very good insights of what the mysql server is actually doing.' +
1839
+ ' (if the chart is not showing all these dimensions it is because they are zero - set <strong>Which dimensions to show?</strong> to <strong>All</strong> from the dashboard settings, to render even the zero values)<ul>' +
1840
+ '<li><strong>commit</strong>, the number of internal <a href="http://dev.mysql.com/doc/refman/5.7/en/commit.html" target="_blank">COMMIT</a> statements.</li>' +
1841
+ '<li><strong>delete</strong>, the number of times that rows have been deleted from tables.</li>' +
1842
+ '<li><strong>prepare</strong>, a counter for the prepare phase of two-phase commit operations.</li>' +
1843
+ '<li><strong>read first</strong>, the number of times the first entry in an index was read. A high value suggests that the server is doing a lot of full index scans; e.g. <strong>SELECT col1 FROM foo</strong>, with col1 indexed.</li>' +
1844
+ '<li><strong>read key</strong>, the number of requests to read a row based on a key. If this value is high, it is a good indication that your tables are properly indexed for your queries.</li>' +
1845
+ '<li><strong>read next</strong>, the number of requests to read the next row in key order. This value is incremented if you are querying an index column with a range constraint or if you are doing an index scan.</li>' +
1846
+ '<li><strong>read prev</strong>, the number of requests to read the previous row in key order. This read method is mainly used to optimize <strong>ORDER BY ... DESC</strong>.</li>' +
1847
+ '<li><strong>read rnd</strong>, the number of requests to read a row based on a fixed position. A high value indicates you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan entire tables or you have joins that do not use keys properly.</li>' +
1848
+ '<li><strong>read rnd next</strong>, the number of requests to read the next row in the data file. This value is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.</li>' +
1849
+ '<li><strong>rollback</strong>, the number of requests for a storage engine to perform a rollback operation.</li>' +
1850
+ '<li><strong>savepoint</strong>, the number of requests for a storage engine to place a savepoint.</li>' +
1851
+ '<li><strong>savepoint rollback</strong>, the number of requests for a storage engine to roll back to a savepoint.</li>' +
1852
+ '<li><strong>update</strong>, the number of requests to update a row in a table.</li>' +
1853
+ '<li><strong>write</strong>, the number of requests to insert a row in a table.</li>' +
1854
+ '</ul>'
1855
+ },
1856
+
1857
+ 'mysql.table_locks': {
1858
+ info: 'MySQL table locks counters: <ul>' +
1859
+ '<li><strong>immediate</strong>, the number of times that a request for a table lock could be granted immediately.</li>' +
1860
+ '<li><strong>waited</strong>, the number of times that a request for a table lock could not be granted immediately and a wait was needed. If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication.</li>' +
1861
+ '</ul>'
1862
+ },
1863
+
1864
+ // ------------------------------------------------------------------------
1865
+ // APACHE
1866
+
1867
+ 'apache.connections': {
1868
+ colors: NETDATA.colors[4],
1869
+ mainheads: [
1870
+ gaugeChart('Connections', '12%', '', NETDATA.colors[4])
1871
+ ]
1872
+ },
1873
+
1874
+ 'apache.requests': {
1875
+ colors: NETDATA.colors[0],
1876
+ mainheads: [
1877
+ gaugeChart('Requests', '12%', '', NETDATA.colors[0])
1878
+ ]
1879
+ },
1880
+
1881
+ 'apache.net': {
1882
+ colors: NETDATA.colors[3],
1883
+ mainheads: [
1884
+ gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
1885
+ ]
1886
+ },
1887
+
1888
+ 'apache.workers': {
1889
+ mainheads: [
1890
+ function(id) {
1891
+ return '<div data-netdata="' + id + '"'
1892
+ + ' data-dimensions="busy"'
1893
+ + ' data-append-options="percentage"'
1894
+ + ' data-gauge-max-value="100"'
1895
+ + ' data-chart-library="gauge"'
1896
+ + ' data-title="Workers Utilization"'
1897
+ + ' data-units="percentage %"'
1898
+ + ' data-gauge-adjust="width"'
1899
+ + ' data-width="12%"'
1900
+ + ' data-before="0"'
1901
+ + ' data-after="-CHART_DURATION"'
1902
+ + ' data-points="CHART_DURATION"'
1903
+ + ' role="application"></div>';
1904
+ }
1905
+ ]
1906
+ },
1907
+
1908
+ 'apache.bytesperreq': {
1909
+ colors: NETDATA.colors[3],
1910
+ height: 0.5
1911
+ },
1912
+
1913
+ 'apache.reqpersec': {
1914
+ colors: NETDATA.colors[4],
1915
+ height: 0.5
1916
+ },
1917
+
1918
+ 'apache.bytespersec': {
1919
+ colors: NETDATA.colors[6],
1920
+ height: 0.5
1921
+ },
1922
+
1923
+
1924
+ // ------------------------------------------------------------------------
1925
+ // NGINX
1926
+
1927
+ 'nginx.connections': {
1928
+ colors: NETDATA.colors[4],
1929
+ mainheads: [
1930
+ gaugeChart('Connections', '12%', '', NETDATA.colors[4])
1931
+ ]
1932
+ },
1933
+
1934
+ 'nginx.requests': {
1935
+ colors: NETDATA.colors[0],
1936
+ mainheads: [
1937
+ gaugeChart('Requests', '12%', '', NETDATA.colors[0])
1938
+ ]
1939
+ },
1940
+
1941
+ // ------------------------------------------------------------------------
1942
+ // NETDATA
1943
+
1944
+ 'netdata.response_time': {
1945
+ info: 'The netdata API response time measures the time netdata needed to serve requests. This time includes everything, from the reception of the first byte of a request, to the dispatch of the last byte of its reply, therefore it includes all network latencies involved (i.e. a client over a slow network will influence these metrics).'
1946
+ }
1947
};
1948
1949
function anyAttribute(obj, attr, key, def) {
1943
- if(typeof obj[key] !== 'undefined') {
1944
- if(typeof obj[key][attr] !== 'undefined')
1945
- return obj[key][attr];
1946
- }
1947
- return def;
1950
+ if(typeof obj[key] !== 'undefined') {
1951
+ if(typeof obj[key][attr] !== 'undefined')
1952
+ return obj[key][attr];
1953
+ }
1954
+ return def;
1955
}
1956
1957
function menuTitle(chart) {
1951
- if(typeof chart.menu_pattern !== 'undefined') {
1952
- return anyAttribute(menuData, 'title', chart.menu_pattern, chart.menu_pattern).toString()
1953
- + ': ' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString();
1954
- }
1958
+ if(typeof chart.menu_pattern !== 'undefined') {
1959
+ return anyAttribute(menuData, 'title', chart.menu_pattern, chart.menu_pattern).toString()
1960
+ + ': ' + chart.type.slice(-(chart.type.length - chart.menu_pattern.length - 1)).toString();
1961
+ }
1962
1956
- return anyAttribute(menuData, 'title', chart.menu, chart.menu);
1963
+ return anyAttribute(menuData, 'title', chart.menu, chart.menu);
1964
}
1965
1966
function menuInfo(menu) {
1960
- return anyAttribute(menuData, 'info', menu, null);
1967
+ return anyAttribute(menuData, 'info', menu, null);
1968
}
1969
1970
function menuHeight(menu, relative) {
1964
- return anyAttribute(menuData, 'height', menu, 1.0) * relative;
1971
+ return anyAttribute(menuData, 'height', menu, 1.0) * relative;
1972
}
1973
1974
function submenuTitle(menu, submenu) {
1968
- var key = menu + '.' + submenu;
1969
- return anyAttribute(submenuData, 'title', key, submenu);
1975
+ var key = menu + '.' + submenu;
1976
+ return anyAttribute(submenuData, 'title', key, submenu);
1977
}
1978
1979
function submenuInfo(menu, submenu) {
1973
- var key = menu + '.' + submenu;
1974
- return anyAttribute(submenuData, 'info', key, null);
1980
+ var key = menu + '.' + submenu;
1981
+ return anyAttribute(submenuData, 'info', key, null);
1982
}
1983
1984
function submenuHeight(menu, submenu, relative) {
1978
- var key = menu + '.' + submenu;
1979
- return anyAttribute(submenuData, 'height', key, 1.0) * relative;
1985
+ var key = menu + '.' + submenu;
1986
+ return anyAttribute(submenuData, 'height', key, 1.0) * relative;
1987
}
1988
1989
1990
function chartInfo(id) {
1984
- if(typeof chartData[id] !== 'undefined' && typeof chartData[id].info !== 'undefined')
1985
- return '<div class="chart-message netdata-chart-alignment" role="document">' + chartData[id].info + '</div>';
1986
- else
1987
- return '';
1991
+ if(typeof chartData[id] !== 'undefined' && typeof chartData[id].info !== 'undefined')
1992
+ return '<div class="chart-message netdata-chart-alignment" role="document">' + chartData[id].info + '</div>';
1993
+ else
1994
+ return '';
1995
}
1996
1997
function chartHeight(id, def) {
1991
- if(typeof chartData[id] !== 'undefined' && typeof chartData[id].height !== 'undefined')
1992
- return def * chartData[id].height;
1993
- else
1994
- return def;
1998
+ if(typeof chartData[id] !== 'undefined' && typeof chartData[id].height !== 'undefined')
1999
+ return def * chartData[id].height;
2000
+ else
2001
+ return def;
2002
}
2003
2004
@@ -2000,794 +2007,794 @@ function chartHeight(id, def) {
2007
// enrich the data structure returned by netdata
2008
// to reflect our menu system and content
2009
function enrichChartData(chart) {
2003
- var tmp = chart.type.split('_')[0];
2004
-
2005
- switch(tmp) {
2006
- case 'ap':
2007
- case 'net':
2008
- case 'disk':
2009
- chart.menu = tmp;
2010
- break;
2011
-
2012
- case 'apache':
2013
- case 'cgroup':
2014
- case 'exim':
2015
- case 'memcached':
2016
- case 'mysql':
2017
- case 'named':
2018
- case 'nginx':
2019
- case 'phpfpm':
2020
- case 'postfix':
2021
- case 'redis':
2022
- case 'ipfs':
2023
- case 'squid':
2024
- case 'snmp':
2025
- case 'tomcat':
2026
- chart.menu = chart.type;
2027
- chart.menu_pattern = tmp;
2028
- break;
2029
-
2030
- case 'tc':
2031
- chart.menu = tmp;
2032
-
2033
- // find a name for this device from fireqos info
2034
- // we strip '_(in|out)' or '(in|out)_'
2035
- if(typeof options.submenu_names[chart.family] === 'undefined' || options.submenu_names[chart.family] === chart.family) {
2036
- var n = chart.name.split('.')[1];
2037
- if(n.endsWith('_in'))
2038
- options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_in'));
2039
- else if(n.endsWith('_out'))
2040
- options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_out'));
2041
- else if(n.startsWith('in_'))
2042
- options.submenu_names[chart.family] = n.slice(3, n.length);
2043
- else if(n.startsWith('out_'))
2044
- options.submenu_names[chart.family] = n.slice(4, n.length);
2045
- }
2046
-
2047
- // increase the priority of IFB devices
2048
- // to have inbound appear before outbound
2049
- if(chart.id.match(/.*-ifb$/))
2050
- chart.priority--;
2051
-
2052
- break;
2053
-
2054
- default:
2055
- chart.menu = chart.type;
2056
- break;
2057
- }
2058
-
2059
- chart.submenu = chart.family;
2010
+ var tmp = chart.type.split('_')[0];
2011
+
2012
+ switch(tmp) {
2013
+ case 'ap':
2014
+ case 'net':
2015
+ case 'disk':
2016
+ chart.menu = tmp;
2017
+ break;
2018
+
2019
+ case 'apache':
2020
+ case 'cgroup':
2021
+ case 'exim':
2022
+ case 'memcached':
2023
+ case 'mysql':
2024
+ case 'named':
2025
+ case 'nginx':
2026
+ case 'phpfpm':
2027
+ case 'postfix':
2028
+ case 'redis':
2029
+ case 'ipfs':
2030
+ case 'squid':
2031
+ case 'snmp':
2032
+ case 'tomcat':
2033
+ chart.menu = chart.type;
2034
+ chart.menu_pattern = tmp;
2035
+ break;
2036
+
2037
+ case 'tc':
2038
+ chart.menu = tmp;
2039
+
2040
+ // find a name for this device from fireqos info
2041
+ // we strip '_(in|out)' or '(in|out)_'
2042
+ if(typeof options.submenu_names[chart.family] === 'undefined' || options.submenu_names[chart.family] === chart.family) {
2043
+ var n = chart.name.split('.')[1];
2044
+ if(n.endsWith('_in'))
2045
+ options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_in'));
2046
+ else if(n.endsWith('_out'))
2047
+ options.submenu_names[chart.family] = n.slice(0, n.lastIndexOf('_out'));
2048
+ else if(n.startsWith('in_'))
2049
+ options.submenu_names[chart.family] = n.slice(3, n.length);
2050
+ else if(n.startsWith('out_'))
2051
+ options.submenu_names[chart.family] = n.slice(4, n.length);
2052
+ }
2053
+
2054
+ // increase the priority of IFB devices
2055
+ // to have inbound appear before outbound
2056
+ if(chart.id.match(/.*-ifb$/))
2057
+ chart.priority--;
2058
+
2059
+ break;
2060
+
2061
+ default:
2062
+ chart.menu = chart.type;
2063
+ break;
2064
+ }
2065
+
2066
+ chart.submenu = chart.family;
2067
}
2068
2069
// ----------------------------------------------------------------------------
2070
2071
function name2id(s) {
2065
- return s
2066
- .replace(/ /g, '_')
2067
- .replace(/\(/g, '_')
2068
- .replace(/\)/g, '_')
2069
- .replace(/\./g, '_')
2070
- .replace(/\//g, '_');
2072
+ return s
2073
+ .replace(/ /g, '_')
2074
+ .replace(/\(/g, '_')
2075
+ .replace(/\)/g, '_')
2076
+ .replace(/\./g, '_')
2077
+ .replace(/\//g, '_');
2078
}
2079
2080
function headMain(charts, duration) {
2074
- var head = '';
2075
-
2076
- if(typeof charts['system.swap'] !== 'undefined')
2077
- head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
2078
- + ' data-dimensions="free"'
2079
- + ' data-append-options="percentage"'
2080
- + ' data-chart-library="easypiechart"'
2081
- + ' data-title="Free Swap"'
2082
- + ' data-units="%"'
2083
- + ' data-easypiechart-max-value="100"'
2084
- + ' data-width="8%"'
2085
- + ' data-before="0"'
2086
- + ' data-after="-' + duration.toString() + '"'
2087
- + ' data-points="' + duration.toString() + '"'
2088
- + ' data-colors="#DD4400"'
2089
- + ' role="application"></div>';
2090
-
2091
- if(typeof charts['system.io'] !== 'undefined') {
2092
- head += '<div style="margin-right: 10px;" data-netdata="system.io"'
2093
- + ' data-dimensions="in"'
2094
- + ' data-chart-library="easypiechart"'
2095
- + ' data-title="Disk Read"'
2096
- + ' data-width="10%"'
2097
- + ' data-before="0"'
2098
- + ' data-after="-' + duration.toString() + '"'
2099
- + ' data-points="' + duration.toString() + '"'
2100
- + ' role="application"></div>';
2101
-
2102
- head += '<div style="margin-right: 10px;" data-netdata="system.io"'
2103
- + ' data-dimensions="out"'
2104
- + ' data-chart-library="easypiechart"'
2105
- + ' data-title="Disk Write"'
2106
- + ' data-width="10%"'
2107
- + ' data-before="0"'
2108
- + ' data-after="-' + duration.toString() + '"'
2109
- + ' data-points="' + duration.toString() + '"'
2110
- + ' role="application"></div>';
2111
- }
2112
-
2113
- if(typeof charts['system.cpu'] !== 'undefined')
2114
- head += '<div data-netdata="system.cpu"'
2115
- + ' data-chart-library="gauge"'
2116
- + ' data-title="CPU"'
2117
- + ' data-units="%"'
2118
- + ' data-gauge-max-value="100"'
2119
- + ' data-width="18%"'
2120
- + ' data-after="-' + duration.toString() + '"'
2121
- + ' data-points="' + duration.toString() + '"'
2122
- + ' data-colors="' + NETDATA.colors[12] + '"'
2123
- + ' role="application"></div>';
2124
-
2125
- if(typeof charts['system.ipv4'] !== 'undefined') {
2126
- head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
2127
- + ' data-dimensions="received"'
2128
- + ' data-chart-library="easypiechart"'
2129
- + ' data-title="IPv4 Inbound"'
2130
- + ' data-width="10%"'
2131
- + ' data-before="0"'
2132
- + ' data-after="-' + duration.toString() + '"'
2133
- + ' data-points="' + duration.toString() + '"'
2134
- + ' role="application"></div>';
2135
-
2136
- head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
2137
- + ' data-dimensions="sent"'
2138
- + ' data-chart-library="easypiechart"'
2139
- + ' data-title="IPv4 Outbound"'
2140
- + ' data-width="10%"'
2141
- + ' data-before="0"'
2142
- + ' data-after="-' + duration.toString() + '"'
2143
- + ' data-points="' + duration.toString() + '"'
2144
- + ' role="application"></div>';
2145
- }
2146
- else if(typeof charts['system.ipv6'] !== 'undefined') {
2147
- head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
2148
- + ' data-dimensions="received"'
2149
- + ' data-chart-library="easypiechart"'
2150
- + ' data-title="IPv6 Inbound"'
2151
- + ' data-units="kbps"'
2152
- + ' data-width="10%"'
2153
- + ' data-before="0"'
2154
- + ' data-after="-' + duration.toString() + '"'
2155
- + ' data-points="' + duration.toString() + '"'
2156
- + ' role="application"></div>';
2157
-
2158
- head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
2159
- + ' data-dimensions="sent"'
2160
- + ' data-chart-library="easypiechart"'
2161
- + ' data-title="IPv6 Outbound"'
2162
- + ' data-units="kbps"'
2163
- + ' data-width="10%"'
2164
- + ' data-before="0"'
2165
- + ' data-after="-' + duration.toString() + '"'
2166
- + ' data-points="' + duration.toString() + '"'
2167
- + ' role="application"></div>';
2168
- }
2169
-
2170
- if(typeof charts['system.ram'] !== 'undefined')
2171
- head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
2172
- + ' data-dimensions="cached|free"'
2173
- + ' data-append-options="percentage"'
2174
- + ' data-chart-library="easypiechart"'
2175
- + ' data-title="Available RAM"'
2176
- + ' data-units="%"'
2177
- + ' data-easypiechart-max-value="100"'
2178
- + ' data-width="8%"'
2179
- + ' data-after="-' + duration.toString() + '"'
2180
- + ' data-points="' + duration.toString() + '"'
2181
- + ' data-colors="' + NETDATA.colors[7] + '"'
2182
- + ' role="application"></div>';
2183
-
2184
- return head;
2081
+ var head = '';
2082
+
2083
+ if(typeof charts['system.swap'] !== 'undefined')
2084
+ head += '<div style="margin-right: 10px;" data-netdata="system.swap"'
2085
+ + ' data-dimensions="free"'
2086
+ + ' data-append-options="percentage"'
2087
+ + ' data-chart-library="easypiechart"'
2088
+ + ' data-title="Free Swap"'
2089
+ + ' data-units="%"'
2090
+ + ' data-easypiechart-max-value="100"'
2091
+ + ' data-width="8%"'
2092
+ + ' data-before="0"'
2093
+ + ' data-after="-' + duration.toString() + '"'
2094
+ + ' data-points="' + duration.toString() + '"'
2095
+ + ' data-colors="#DD4400"'
2096
+ + ' role="application"></div>';
2097
+
2098
+ if(typeof charts['system.io'] !== 'undefined') {
2099
+ head += '<div style="margin-right: 10px;" data-netdata="system.io"'
2100
+ + ' data-dimensions="in"'
2101
+ + ' data-chart-library="easypiechart"'
2102
+ + ' data-title="Disk Read"'
2103
+ + ' data-width="10%"'
2104
+ + ' data-before="0"'
2105
+ + ' data-after="-' + duration.toString() + '"'
2106
+ + ' data-points="' + duration.toString() + '"'
2107
+ + ' role="application"></div>';
2108
+
2109
+ head += '<div style="margin-right: 10px;" data-netdata="system.io"'
2110
+ + ' data-dimensions="out"'
2111
+ + ' data-chart-library="easypiechart"'
2112
+ + ' data-title="Disk Write"'
2113
+ + ' data-width="10%"'
2114
+ + ' data-before="0"'
2115
+ + ' data-after="-' + duration.toString() + '"'
2116
+ + ' data-points="' + duration.toString() + '"'
2117
+ + ' role="application"></div>';
2118
+ }
2119
+
2120
+ if(typeof charts['system.cpu'] !== 'undefined')
2121
+ head += '<div data-netdata="system.cpu"'
2122
+ + ' data-chart-library="gauge"'
2123
+ + ' data-title="CPU"'
2124
+ + ' data-units="%"'
2125
+ + ' data-gauge-max-value="100"'
2126
+ + ' data-width="18%"'
2127
+ + ' data-after="-' + duration.toString() + '"'
2128
+ + ' data-points="' + duration.toString() + '"'
2129
+ + ' data-colors="' + NETDATA.colors[12] + '"'
2130
+ + ' role="application"></div>';
2131
+
2132
+ if(typeof charts['system.ipv4'] !== 'undefined') {
2133
+ head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
2134
+ + ' data-dimensions="received"'
2135
+ + ' data-chart-library="easypiechart"'
2136
+ + ' data-title="IPv4 Inbound"'
2137
+ + ' data-width="10%"'
2138
+ + ' data-before="0"'
2139
+ + ' data-after="-' + duration.toString() + '"'
2140
+ + ' data-points="' + duration.toString() + '"'
2141
+ + ' role="application"></div>';
2142
+
2143
+ head += '<div style="margin-right: 10px;" data-netdata="system.ipv4"'
2144
+ + ' data-dimensions="sent"'
2145
+ + ' data-chart-library="easypiechart"'
2146
+ + ' data-title="IPv4 Outbound"'
2147
+ + ' data-width="10%"'
2148
+ + ' data-before="0"'
2149
+ + ' data-after="-' + duration.toString() + '"'
2150
+ + ' data-points="' + duration.toString() + '"'
2151
+ + ' role="application"></div>';
2152
+ }
2153
+ else if(typeof charts['system.ipv6'] !== 'undefined') {
2154
+ head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
2155
+ + ' data-dimensions="received"'
2156
+ + ' data-chart-library="easypiechart"'
2157
+ + ' data-title="IPv6 Inbound"'
2158
+ + ' data-units="kbps"'
2159
+ + ' data-width="10%"'
2160
+ + ' data-before="0"'
2161
+ + ' data-after="-' + duration.toString() + '"'
2162
+ + ' data-points="' + duration.toString() + '"'
2163
+ + ' role="application"></div>';
2164
+
2165
+ head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
2166
+ + ' data-dimensions="sent"'
2167
+ + ' data-chart-library="easypiechart"'
2168
+ + ' data-title="IPv6 Outbound"'
2169
+ + ' data-units="kbps"'
2170
+ + ' data-width="10%"'
2171
+ + ' data-before="0"'
2172
+ + ' data-after="-' + duration.toString() + '"'
2173
+ + ' data-points="' + duration.toString() + '"'
2174
+ + ' role="application"></div>';
2175
+ }
2176
+
2177
+ if(typeof charts['system.ram'] !== 'undefined')
2178
+ head += '<div style="margin-right: 10px;" data-netdata="system.ram"'
2179
+ + ' data-dimensions="cached|free"'
2180
+ + ' data-append-options="percentage"'
2181
+ + ' data-chart-library="easypiechart"'
2182
+ + ' data-title="Available RAM"'
2183
+ + ' data-units="%"'
2184
+ + ' data-easypiechart-max-value="100"'
2185
+ + ' data-width="8%"'
2186
+ + ' data-after="-' + duration.toString() + '"'
2187
+ + ' data-points="' + duration.toString() + '"'
2188
+ + ' data-colors="' + NETDATA.colors[7] + '"'
2189
+ + ' role="application"></div>';
2190
+
2191
+ return head;
2192
}
2193
2194
function generateHeadCharts(type, chart, duration) {
2188
- var head = '';
2189
- var hcharts = anyAttribute(chartData, type, chart.context, []);
2190
- if(hcharts.length > 0) {
2191
- var hi = 0, hlen = hcharts.length;
2192
- while(hi < hlen) {
2193
- if(typeof hcharts[hi] === 'function')
2194
- head += hcharts[hi](chart.id).replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
2195
- else
2196
- head += hcharts[hi].replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
2197
- hi++;
2198
- }
2199
- }
2200
- return head;
2195
+ var head = '';
2196
+ var hcharts = anyAttribute(chartData, type, chart.context, []);
2197
+ if(hcharts.length > 0) {
2198
+ var hi = 0, hlen = hcharts.length;
2199
+ while(hi < hlen) {
2200
+ if(typeof hcharts[hi] === 'function')
2201
+ head += hcharts[hi](chart.id).replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
2202
+ else
2203
+ head += hcharts[hi].replace('CHART_DURATION', duration.toString()).replace('CHART_UNIQUE_ID', chart.id);
2204
+ hi++;
2205
+ }
2206
+ }
2207
+ return head;
2208
}
2209
2210
function renderPage(menus, data) {
2204
- var div = document.getElementById('charts_div');
2205
- var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
2206
-
2207
- // find the proper duration for per-second updates
2208
- var duration = Math.round(($(div).width() * pcent_width / 100 * data.update_every / 3) / 60) * 60;
2209
- var html = '';
2210
- var sidebar = '<ul class="nav dashboard-sidenav" data-spy="affix" id="sidebar_ul">';
2211
- var mainhead = headMain(data.charts, duration);
2212
-
2213
- // sort the menus
2214
- var main = sortObjectByPriority(menus);
2215
- var i = 0, len = main.length;
2216
- while(i < len) {
2217
- var menu = main[i++];
2218
-
2219
- // generate an entry at the main menu
2220
-
2221
- var menuid = name2id(menu);
2222
- sidebar += '<li class=""><a href="#' + menuid + '" onClick="return scrollToId(\'' + menuid + '\');">' + menus[menu].title + '</a><ul class="nav">';
2223
- html += '<div role="section"><div role="sectionhead"><h1 id="' + menuid + '" role="heading">' + menus[menu].title + '</h1></div><div id="menu_' + menuid + '" role="document">';
2224
-
2225
- if(menus[menu].info !== null)
2226
- html += menus[menu].info;
2227
-
2228
- // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
2229
-
2230
- var shtml = '';
2231
- var mhead = '<div class="netdata-chart-row">' + mainhead;
2232
- mainhead = '';
2233
-
2234
- // sort the submenus of this menu
2235
- var sub = sortObjectByPriority(menus[menu].submenus);
2236
- var si = 0, slen = sub.length;
2237
- while(si < slen) {
2238
- var submenu = sub[si++];
2239
-
2240
- // generate an entry at the submenu
2241
- var submenuid = name2id(menu + '_' + submenu);
2242
- sidebar += '<li class><a href="#' + submenuid + '" onClick="return scrollToId(\'' + submenuid + '\');">' + menus[menu].submenus[submenu].title + '</a></li>';
2243
- shtml += '<div class="netdata-group-container" id="submenu_' + submenuid + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + submenuid + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
2244
-
2245
- if(menus[menu].submenus[submenu].info !== null)
2246
- shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
2247
-
2248
- var head = '<div class="netdata-chart-row">';
2249
- var chtml = '';
2250
-
2251
- // console.log(' \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
2252
-
2253
- // sort the charts in this submenu of this menu
2254
- menus[menu].submenus[submenu].charts.sort(prioritySort);
2255
- var ci = 0, clen = menus[menu].submenus[submenu].charts.length;
2256
- while(ci < clen) {
2257
- var chart = menus[menu].submenus[submenu].charts[ci++];
2258
-
2259
- // generate the submenu heading charts
2260
- mhead += generateHeadCharts('mainheads', chart, duration);
2261
- head += generateHeadCharts('heads', chart, duration);
2262
-
2263
- // generate the chart
2264
- chtml += chartInfo(chart.context) + '<div data-netdata="' + chart.id + '"'
2265
- + ' data-width="' + pcent_width.toString() + '%"'
2266
- + ' data-height="' + chartHeight(chart.context, options.chartsHeight).toString() + 'px"'
2267
- + ' data-before="0"'
2268
- + ' data-after="-' + duration.toString() + '"'
2269
- + ' data-id="' + name2id(options.hostname + '/' + chart.id) + '"'
2270
- + ' data-colors="' + anyAttribute(chartData, 'colors', chart.context, '') + '"'
2271
- + ' role="application"></div>';
2272
-
2273
- // console.log(' \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context + ' height: ' + menus[menu].submenus[submenu].height);
2274
- }
2275
-
2276
- head += '</div>';
2277
- shtml += head + chtml + '</div>';
2278
- }
2279
-
2280
- mhead += '</div>';
2281
- sidebar += '</ul></li>';
2282
- html += mhead + shtml + '</div></div><hr role="separator"/>';
2283
- }
2284
-
2285
- sidebar += '</ul>';
2286
- div.innerHTML = html;
2287
- document.getElementById('sidebar').innerHTML = sidebar;
2288
- finalizePage();
2211
+ var div = document.getElementById('charts_div');
2212
+ var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
2213
+
2214
+ // find the proper duration for per-second updates
2215
+ var duration = Math.round(($(div).width() * pcent_width / 100 * data.update_every / 3) / 60) * 60;
2216
+ var html = '';
2217
+ var sidebar = '<ul class="nav dashboard-sidenav" data-spy="affix" id="sidebar_ul">';
2218
+ var mainhead = headMain(data.charts, duration);
2219
+
2220
+ // sort the menus
2221
+ var main = sortObjectByPriority(menus);
2222
+ var i = 0, len = main.length;
2223
+ while(i < len) {
2224
+ var menu = main[i++];
2225
+
2226
+ // generate an entry at the main menu
2227
+
2228
+ var menuid = name2id(menu);
2229
+ sidebar += '<li class=""><a href="#' + menuid + '" onClick="return scrollToId(\'' + menuid + '\');">' + menus[menu].title + '</a><ul class="nav">';
2230
+ html += '<div role="section"><div role="sectionhead"><h1 id="' + menuid + '" role="heading">' + menus[menu].title + '</h1></div><div id="menu_' + menuid + '" role="document">';
2231
+
2232
+ if(menus[menu].info !== null)
2233
+ html += menus[menu].info;
2234
+
2235
+ // console.log(' >> ' + menu + ' (' + menus[menu].priority + '): ' + menus[menu].title);
2236
+
2237
+ var shtml = '';
2238
+ var mhead = '<div class="netdata-chart-row">' + mainhead;
2239
+ mainhead = '';
2240
+
2241
+ // sort the submenus of this menu
2242
+ var sub = sortObjectByPriority(menus[menu].submenus);
2243
+ var si = 0, slen = sub.length;
2244
+ while(si < slen) {
2245
+ var submenu = sub[si++];
2246
+
2247
+ // generate an entry at the submenu
2248
+ var submenuid = name2id(menu + '_' + submenu);
2249
+ sidebar += '<li class><a href="#' + submenuid + '" onClick="return scrollToId(\'' + submenuid + '\');">' + menus[menu].submenus[submenu].title + '</a></li>';
2250
+ shtml += '<div class="netdata-group-container" id="submenu_' + submenuid + '" style="display: inline-block; width: ' + pcent_width.toString() + '%"><h2 id="' + submenuid + '" class="netdata-chart-alignment" role="heading">' + menus[menu].submenus[submenu].title + '</h2>';
2251
+
2252
+ if(menus[menu].submenus[submenu].info !== null)
2253
+ shtml += '<div class="chart-message netdata-chart-alignment" role="document">' + menus[menu].submenus[submenu].info + '</div>';
2254
+
2255
+ var head = '<div class="netdata-chart-row">';
2256
+ var chtml = '';
2257
+
2258
+ // console.log(' \------- ' + submenu + ' (' + menus[menu].submenus[submenu].priority + '): ' + menus[menu].submenus[submenu].title);
2259
+
2260
+ // sort the charts in this submenu of this menu
2261
+ menus[menu].submenus[submenu].charts.sort(prioritySort);
2262
+ var ci = 0, clen = menus[menu].submenus[submenu].charts.length;
2263
+ while(ci < clen) {
2264
+ var chart = menus[menu].submenus[submenu].charts[ci++];
2265
+
2266
+ // generate the submenu heading charts
2267
+ mhead += generateHeadCharts('mainheads', chart, duration);
2268
+ head += generateHeadCharts('heads', chart, duration);
2269
+
2270
+ // generate the chart
2271
+ chtml += chartInfo(chart.context) + '<div data-netdata="' + chart.id + '"'
2272
+ + ' data-width="' + pcent_width.toString() + '%"'
2273
+ + ' data-height="' + chartHeight(chart.context, options.chartsHeight).toString() + 'px"'
2274
+ + ' data-before="0"'
2275
+ + ' data-after="-' + duration.toString() + '"'
2276
+ + ' data-id="' + name2id(options.hostname + '/' + chart.id) + '"'
2277
+ + ' data-colors="' + anyAttribute(chartData, 'colors', chart.context, '') + '"'
2278
+ + ' role="application"></div>';
2279
+
2280
+ // console.log(' \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context + ' height: ' + menus[menu].submenus[submenu].height);
2281
+ }
2282
+
2283
+ head += '</div>';
2284
+ shtml += head + chtml + '</div>';
2285
+ }
2286
+
2287
+ mhead += '</div>';
2288
+ sidebar += '</ul></li>';
2289
+ html += mhead + shtml + '</div></div><hr role="separator"/>';
2290
+ }
2291
+
2292
+ sidebar += '</ul>';
2293
+ div.innerHTML = html;
2294
+ document.getElementById('sidebar').innerHTML = sidebar;
2295
+ finalizePage();
2296
}
2297
2298
function renderChartsAndMenu(data) {
2292
- var menus = {};
2293
- var charts = data.charts;
2294
-
2295
- for(var c in charts) {
2296
- enrichChartData(charts[c]);
2297
-
2298
- // create the menu
2299
- if(typeof menus[charts[c].menu] === 'undefined') {
2300
- menus[charts[c].menu] = {
2301
- priority: charts[c].priority,
2302
- submenus: {},
2303
- title: menuTitle(charts[c]),
2304
- info: menuInfo(charts[c].menu),
2305
- height: menuHeight(charts[c].menu, options.chartsHeight)
2306
- };
2307
- }
2308
-
2309
- if(charts[c].priority < menus[charts[c].menu].priority)
2310
- menus[charts[c].menu].priority = charts[c].priority;
2311
-
2312
- // create the submenu
2313
- if(typeof menus[charts[c].menu].submenus[charts[c].submenu] === 'undefined') {
2314
- menus[charts[c].menu].submenus[charts[c].submenu] = {
2315
- priority: charts[c].priority,
2316
- charts: new Array(),
2317
- title: null,
2318
- info: submenuInfo(charts[c].menu, charts[c].submenu),
2319
- height: submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
2320
- };
2321
- }
2322
-
2323
- if(charts[c].priority < menus[charts[c].menu].submenus[charts[c].submenu].priority)
2324
- menus[charts[c].menu].submenus[charts[c].submenu].priority = charts[c].priority;
2325
-
2326
- // index the chart in the menu/submenu
2327
- menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
2328
- }
2329
-
2330
- // propagate the descriptive subname given to QoS
2331
- // to all the other submenus with the same name
2332
- for(var m in menus) {
2333
- for(var s in menus[m].submenus) {
2334
- // set the family using a name
2335
- if(typeof options.submenu_names[s] !== 'undefined') {
2336
- menus[m].submenus[s].title = s + ' (' + options.submenu_names[s] + ')';
2337
- }
2338
- else {
2339
- menus[m].submenus[s].title = submenuTitle(m, s);
2340
- }
2341
- }
2342
- }
2343
-
2344
- renderPage(menus, data);
2299
+ var menus = {};
2300
+ var charts = data.charts;
2301
+
2302
+ for(var c in charts) {
2303
+ enrichChartData(charts[c]);
2304
+
2305
+ // create the menu
2306
+ if(typeof menus[charts[c].menu] === 'undefined') {
2307
+ menus[charts[c].menu] = {
2308
+ priority: charts[c].priority,
2309
+ submenus: {},
2310
+ title: menuTitle(charts[c]),
2311
+ info: menuInfo(charts[c].menu),
2312
+ height: menuHeight(charts[c].menu, options.chartsHeight)
2313
+ };
2314
+ }
2315
+
2316
+ if(charts[c].priority < menus[charts[c].menu].priority)
2317
+ menus[charts[c].menu].priority = charts[c].priority;
2318
+
2319
+ // create the submenu
2320
+ if(typeof menus[charts[c].menu].submenus[charts[c].submenu] === 'undefined') {
2321
+ menus[charts[c].menu].submenus[charts[c].submenu] = {
2322
+ priority: charts[c].priority,
2323
+ charts: new Array(),
2324
+ title: null,
2325
+ info: submenuInfo(charts[c].menu, charts[c].submenu),
2326
+ height: submenuHeight(charts[c].menu, charts[c].submenu, menus[charts[c].menu].height)
2327
+ };
2328
+ }
2329
+
2330
+ if(charts[c].priority < menus[charts[c].menu].submenus[charts[c].submenu].priority)
2331
+ menus[charts[c].menu].submenus[charts[c].submenu].priority = charts[c].priority;
2332
+
2333
+ // index the chart in the menu/submenu
2334
+ menus[charts[c].menu].submenus[charts[c].submenu].charts.push(charts[c]);
2335
+ }
2336
+
2337
+ // propagate the descriptive subname given to QoS
2338
+ // to all the other submenus with the same name
2339
+ for(var m in menus) {
2340
+ for(var s in menus[m].submenus) {
2341
+ // set the family using a name
2342
+ if(typeof options.submenu_names[s] !== 'undefined') {
2343
+ menus[m].submenus[s].title = s + ' (' + options.submenu_names[s] + ')';
2344
+ }
2345
+ else {
2346
+ menus[m].submenus[s].title = submenuTitle(m, s);
2347
+ }
2348
+ }
2349
+ }
2350
+
2351
+ renderPage(menus, data);
2352
}
2353
2354
function downloadAllCharts(netdata_url) {
2348
- if(typeof netdata_url === 'undefined' || netdata_url === null)
2349
- netdata_url = NETDATA.serverDefault;
2355
+ if(typeof netdata_url === 'undefined' || netdata_url === null)
2356
+ netdata_url = NETDATA.serverDefault;
2357
2351
- NETDATA.pause(function() {
2352
- $("#loadOverlay").css("display","none");
2353
- $("#loadOverlay").css("display","none");
2358
+ NETDATA.pause(function() {
2359
+ $("#loadOverlay").css("display","none");
2360
+ $("#loadOverlay").css("display","none");
2361
2355
- // download all the charts the server knows
2356
- NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
2362
+ // download all the charts the server knows
2363
+ NETDATA.chartRegistry.downloadAll(netdata_url, function(data) {
2364
2358
- options.data = data;
2359
- options.hostname = data.hostname;
2360
- document.getElementById('hostname').innerHTML = options.hostname;
2361
- document.getElementById('hostname').href = NETDATA.serverDefault;
2362
- document.title = options.hostname + ' netdata dashboard';
2365
+ options.data = data;
2366
+ options.hostname = data.hostname;
2367
+ document.getElementById('hostname').innerHTML = options.hostname;
2368
+ document.getElementById('hostname').href = NETDATA.serverDefault;
2369
+ document.title = options.hostname + ' netdata dashboard';
2370
2364
- renderChartsAndMenu(data);
2371
+ renderChartsAndMenu(data);
2372
2366
- // prepare our DOM
2367
-// prepareScreen(data);
2373
+ // prepare our DOM
2374
+// prepareScreen(data);
2375
2369
- // due to affix issues, prepareScreen() will unpause
2370
- // netdata as needed
2371
- });
2372
- });
2376
+ // due to affix issues, prepareScreen() will unpause
2377
+ // netdata as needed
2378
+ });
2379
+ });
2380
}
2381
2382
// ----------------------------------------------------------------------------
2383
2384
function versionLog(msg) {
2378
- document.getElementById('versionCheckLog').innerHTML = msg;
2385
+ document.getElementById('versionCheckLog').innerHTML = msg;
2386
}
2387
2388
function getNetdataVersion(callback) {
2382
- versionLog('Downloading installed version info from netdata...');
2383
-
2384
- $.ajax({
2385
- url: 'version.txt',
2386
- async: true,
2387
- cache: false
2388
- })
2389
- .done(function(data) {
2390
- data = data.replace(/(\r\n|\n|\r| |\t)/gm,"");
2391
- if(data.length !== 40) {
2392
- versionLog('Received version string is invalid.');
2393
- callback(null);
2394
- }
2395
- else {
2396
- versionLog('Installed version of netdata is ' + data);
2397
- document.getElementById('netdataVersion').innerHTML = data;
2398
- callback(data);
2399
- }
2400
- })
2401
- .fail(function() {
2402
- versionLog('Failed to download installed version info from netdata!');
2403
- callback(null);
2404
- });
2389
+ versionLog('Downloading installed version info from netdata...');
2390
+
2391
+ $.ajax({
2392
+ url: 'version.txt',
2393
+ async: true,
2394
+ cache: false
2395
+ })
2396
+ .done(function(data) {
2397
+ data = data.replace(/(\r\n|\n|\r| |\t)/gm,"");
2398
+ if(data.length !== 40) {
2399
+ versionLog('Received version string is invalid.');
2400
+ callback(null);
2401
+ }
2402
+ else {
2403
+ versionLog('Installed version of netdata is ' + data);
2404
+ document.getElementById('netdataVersion').innerHTML = data;
2405
+ callback(data);
2406
+ }
2407
+ })
2408
+ .fail(function() {
2409
+ versionLog('Failed to download installed version info from netdata!');
2410
+ callback(null);
2411
+ });
2412
}
2413
2414
function getGithubLatestCommit(callback) {
2408
- versionLog('Downloading latest version info from github...');
2409
-
2410
- $.ajax({
2411
- url: 'https://api.github.com/repos/firehol/netdata/commits',
2412
- async: true,
2413
- cache: false
2414
- })
2415
- .done(function(data) {
2416
- versionLog('Latest version info from github is ' + data[0].sha);
2417
- callback(data[0].sha);
2418
- })
2419
- .fail(function() {
2420
- versionLog('Failed to download installed version info from github!');
2421
- callback(null);
2422
- });
2415
+ versionLog('Downloading latest version info from github...');
2416
+
2417
+ $.ajax({
2418
+ url: 'https://api.github.com/repos/firehol/netdata/commits',
2419
+ async: true,
2420
+ cache: false
2421
+ })
2422
+ .done(function(data) {
2423
+ versionLog('Latest version info from github is ' + data[0].sha);
2424
+ callback(data[0].sha);
2425
+ })
2426
+ .fail(function() {
2427
+ versionLog('Failed to download installed version info from github!');
2428
+ callback(null);
2429
+ });
2430
}
2431
2432
function checkForUpdate(callback) {
2426
- getNetdataVersion(function(sha1) {
2427
- if(sha1 === null) callback(null, null);
2433
+ getNetdataVersion(function(sha1) {
2434
+ if(sha1 === null) callback(null, null);
2435
2429
- getGithubLatestCommit(function(sha2) {
2430
- callback(sha1, sha2);
2431
- });
2432
- });
2436
+ getGithubLatestCommit(function(sha2) {
2437
+ callback(sha1, sha2);
2438
+ });
2439
+ });
2440
2434
- return null;
2441
+ return null;
2442
}
2443
2444
var updateBlinkCounter = 0;
2445
function notifyForUpdate(force) {
2439
- versionLog('<p>checking for updates...</p>');
2440
-
2441
- var now = new Date().getTime();
2442
-
2443
- if(typeof force === 'undefined' || force !== true) {
2444
- var last = loadLocalStorage('last_update_check');
2445
-
2446
- if(typeof last === 'string')
2447
- last = parseInt(last);
2448
- else
2449
- last = 0;
2450
-
2451
- if(now - last < 3600000 * 8) {
2452
- // no need to check it - too soon
2453
- return;
2454
- }
2455
- }
2456
-
2457
- checkForUpdate(function(sha1, sha2) {
2458
- var save = false;
2459
-
2460
- if(sha1 === null) {
2461
- save = false;
2462
- versionLog('<p><big>Failed to get your netdata version!</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
2463
- }
2464
- else if(sha2 === null) {
2465
- save = false;
2466
- versionLog('<p><big>Failed to get the latest version from github.</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
2467
- }
2468
- else if(sha1 === sha2) {
2469
- save = true;
2470
- versionLog('<p><big>You already have the latest version of netdata!</big></p><p>No update yet?<br/>Probably, we need some motivation to keep going on!</p><p>If you haven\'t already, <a href="https://github.com/firehol/netdata" target="_blank">give netdata a <b>Star</b> at its github page</a>.</p>');
2471
- }
2472
- else {
2473
- save = true;
2474
- var compare = 'https://github.com/firehol/netdata/compare/' + sha1.toString() + '...' + sha2.toString();
2475
-
2476
- versionLog('<p><big><strong>New version of netdata available!</strong></big></p><p>Latest version: ' + sha2.toString() + '</p><p><a href="' + compare + '" target="_blank">Click here for the changes log</a> since your installed version, and<br/><a href="https://github.com/firehol/netdata/wiki/Updating-Netdata" target="_blank">click here for directions on updating</a> your netdata installation.</p><p>We suggest to review the changes log for new features you may be interested, or important bug fixes you may need.<br/>Keeping your netdata updated, is generally a good idea.</p>');
2477
-
2478
- function updateButtonBlink() {
2479
- updateBlinkCounter--;
2480
- if(updateBlinkCounter > 0)
2481
- $('#updateButton').fadeOut(500).fadeIn(500, updateButtonBlink);
2482
- }
2483
-
2484
- if(updateBlinkCounter === 0) {
2485
- updateBlinkCounter = 300;
2486
- updateButtonBlink();
2487
- }
2488
- }
2489
-
2490
- if(save)
2491
- saveLocalStorage('last_update_check', now.toString());
2492
- });
2446
+ versionLog('<p>checking for updates...</p>');
2447
+
2448
+ var now = new Date().getTime();
2449
+
2450
+ if(typeof force === 'undefined' || force !== true) {
2451
+ var last = loadLocalStorage('last_update_check');
2452
+
2453
+ if(typeof last === 'string')
2454
+ last = parseInt(last);
2455
+ else
2456
+ last = 0;
2457
+
2458
+ if(now - last < 3600000 * 8) {
2459
+ // no need to check it - too soon
2460
+ return;
2461
+ }
2462
+ }
2463
+
2464
+ checkForUpdate(function(sha1, sha2) {
2465
+ var save = false;
2466
+
2467
+ if(sha1 === null) {
2468
+ save = false;
2469
+ versionLog('<p><big>Failed to get your netdata version!</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
2470
+ }
2471
+ else if(sha2 === null) {
2472
+ save = false;
2473
+ versionLog('<p><big>Failed to get the latest version from github.</big></p><p>You can always get the latest version of netdata from <a href="https://github.com/firehol/netdata" target="_blank">its github page</a>.</p>');
2474
+ }
2475
+ else if(sha1 === sha2) {
2476
+ save = true;
2477
+ versionLog('<p><big>You already have the latest version of netdata!</big></p><p>No update yet?<br/>Probably, we need some motivation to keep going on!</p><p>If you haven\'t already, <a href="https://github.com/firehol/netdata" target="_blank">give netdata a <b>Star</b> at its github page</a>.</p>');
2478
+ }
2479
+ else {
2480
+ save = true;
2481
+ var compare = 'https://github.com/firehol/netdata/compare/' + sha1.toString() + '...' + sha2.toString();
2482
+
2483
+ versionLog('<p><big><strong>New version of netdata available!</strong></big></p><p>Latest version: ' + sha2.toString() + '</p><p><a href="' + compare + '" target="_blank">Click here for the changes log</a> since your installed version, and<br/><a href="https://github.com/firehol/netdata/wiki/Updating-Netdata" target="_blank">click here for directions on updating</a> your netdata installation.</p><p>We suggest to review the changes log for new features you may be interested, or important bug fixes you may need.<br/>Keeping your netdata updated, is generally a good idea.</p>');
2484
+
2485
+ function updateButtonBlink() {
2486
+ updateBlinkCounter--;
2487
+ if(updateBlinkCounter > 0)
2488
+ $('#updateButton').fadeOut(500).fadeIn(500, updateButtonBlink);
2489
+ }
2490
+
2491
+ if(updateBlinkCounter === 0) {
2492
+ updateBlinkCounter = 300;
2493
+ updateButtonBlink();
2494
+ }
2495
+ }
2496
+
2497
+ if(save)
2498
+ saveLocalStorage('last_update_check', now.toString());
2499
+ });
2500
}
2501
2502
// ----------------------------------------------------------------------------
2503
2504
function finalizePage() {
2498
- // resize all charts - without starting the background thread
2499
- // this has to be done while NETDATA is paused
2500
- // if we ommit this, the affix menu will be wrong, since all
2501
- // the Dom elements are initially zero-sized
2502
- NETDATA.parseDom();
2503
-
2504
- if(urlOptions.pan_and_zoom === true) {
2505
- urlOptions.nowelcome = true;
2506
- NETDATA.globalPanAndZoom.setMaster(NETDATA.options.targets[0], urlOptions.after, urlOptions.before);
2507
- }
2508
-
2509
- // ------------------------------------------------------------------------
2510
- // https://github.com/viralpatel/jquery.shorten/blob/master/src/jquery.shorten.js
2511
- $.fn.shorten = function(settings) {
2512
- "use strict";
2513
-
2514
- var config = {
2515
- showChars: 750,
2516
- minHideChars: 10,
2517
- ellipsesText: "...",
2518
- moreText: '<i class="fa fa-expand" aria-hidden="true"></i> show more information',
2519
- lessText: '<i class="fa fa-compress" aria-hidden="true"></i> show less information',
2520
- onLess: function() { NETDATA.onscroll(); },
2521
- onMore: function() { NETDATA.onscroll(); },
2522
- errMsg: null,
2523
- force: false
2524
- };
2525
-
2526
- if (settings) {
2527
- $.extend(config, settings);
2528
- }
2529
-
2530
- if ($(this).data('jquery.shorten') && !config.force) {
2531
- return false;
2532
- }
2533
- $(this).data('jquery.shorten', true);
2534
-
2535
- $(document).off("click", '.morelink');
2536
-
2537
- $(document).on({
2538
- click: function() {
2539
-
2540
- var $this = $(this);
2541
- if ($this.hasClass('less')) {
2542
- $this.removeClass('less');
2543
- $this.html(config.moreText);
2544
- $this.parent().prev().animate({'height':'0'+'%'}, 0, function () { $this.parent().prev().prev().show(); }).hide(0, function() {
2545
- config.onLess();
2546
- });
2547
-
2548
- } else {
2549
- $this.addClass('less');
2550
- $this.html(config.lessText);
2551
- $this.parent().prev().animate({'height':'100'+'%'}, 0, function () { $this.parent().prev().prev().hide(); }).show(0, function() {
2552
- config.onMore();
2553
- });
2554
- }
2555
- return false;
2556
- }
2557
- }, '.morelink');
2558
-
2559
- return this.each(function() {
2560
- var $this = $(this);
2561
-
2562
- var content = $this.html();
2563
- var contentlen = $this.text().length;
2564
- if (contentlen > config.showChars + config.minHideChars) {
2565
- var c = content.substr(0, config.showChars);
2566
- if (c.indexOf('<') >= 0) // If there's HTML don't want to cut it
2567
- {
2568
- var inTag = false; // I'm in a tag?
2569
- var bag = ''; // Put the characters to be shown here
2570
- var countChars = 0; // Current bag size
2571
- var openTags = []; // Stack for opened tags, so I can close them later
2572
- var tagName = null;
2573
-
2574
- for (var i = 0, r = 0; r <= config.showChars; i++) {
2575
- if (content[i] == '<' && !inTag) {
2576
- inTag = true;
2577
-
2578
- // This could be "tag" or "/tag"
2579
- tagName = content.substring(i + 1, content.indexOf('>', i));
2580
-
2581
- // If its a closing tag
2582
- if (tagName[0] == '/') {
2583
-
2584
-
2585
- if (tagName != '/' + openTags[0]) {
2586
- config.errMsg = 'ERROR en HTML: the top of the stack should be the tag that closes';
2587
- } else {
2588
- openTags.shift(); // Pops the last tag from the open tag stack (the tag is closed in the retult HTML!)
2589
- }
2590
-
2591
- } else {
2592
- // There are some nasty tags that don't have a close tag like <br/>
2593
- if (tagName.toLowerCase() != 'br') {
2594
- openTags.unshift(tagName); // Add to start the name of the tag that opens
2595
- }
2596
- }
2597
- }
2598
- if (inTag && content[i] == '>') {
2599
- inTag = false;
2600
- }
2601
-
2602
- if (inTag) { bag += content.charAt(i); } // Add tag name chars to the result
2603
- else {
2604
- r++;
2605
- if (countChars <= config.showChars) {
2606
- bag += content.charAt(i); // Fix to ie 7 not allowing you to reference string characters using the []
2607
- countChars++;
2608
- } else // Now I have the characters needed
2609
- {
2610
- if (openTags.length > 0) // I have unclosed tags
2611
- {
2612
- //console.log('They were open tags');
2613
- //console.log(openTags);
2614
- for (j = 0; j < openTags.length; j++) {
2615
- //console.log('Cierro tag ' + openTags[j]);
2616
- bag += '</' + openTags[j] + '>'; // Close all tags that were opened
2617
-
2618
- // You could shift the tag from the stack to check if you end with an empty stack, that means you have closed all open tags
2619
- }
2620
- break;
2621
- }
2622
- }
2623
- }
2624
- }
2625
- c = $('<div/>').html(bag + '<span class="ellip">' + config.ellipsesText + '</span>').html();
2626
- }else{
2627
- c+=config.ellipsesText;
2628
- }
2629
-
2630
- var html = '<div class="shortcontent">' + c +
2631
- '</div><div class="allcontent">' + content +
2632
- '</div><span><a href="javascript://nop/" class="morelink">' + config.moreText + '</a></span>';
2633
-
2634
- $this.html(html);
2635
- $this.find(".allcontent").hide(); // Hide all text
2636
- $('.shortcontent p:last', $this).css('margin-bottom', 0); //Remove bottom margin on last paragraph as it's likely shortened
2637
- }
2638
- });
2639
-
2640
- };
2641
- $(".chart-message").shorten();
2642
- // ------------------------------------------------------------------------
2643
-
2644
- // callback for us to track PanAndZoom operations
2645
- NETDATA.globalPanAndZoom.callback = netdataPanAndZoomCallback;
2646
-
2647
- // let it run (update the charts)
2648
- NETDATA.unpause();
2649
-
2650
- // check if we have to jump to a specific section
2651
- scrollToId(urlOptions.hash.replace('#',''));
2652
-
2653
- /* activate bootstrap sidebar (affix) */
2654
- $('#sidebar').affix({
2655
- offset: {
2656
- top: (isdemo())?150:0,
2657
- bottom: 0
2658
- }
2659
- });
2660
-
2661
- /* fix scrolling of very long affix lists
2662
- http://stackoverflow.com/questions/21691585/bootstrap-3-1-0-affix-too-long
2663
- */
2664
- $('#sidebar').on('affixed.bs.affix', function() {
2665
- $(this).removeAttr('style');
2666
- });
2667
-
2668
- /* activate bootstrap scrollspy (needed for sidebar) */
2669
- $(document.body).scrollspy({
2670
- target: '#sidebar',
2671
- offset: $(window).height() / 3 // controls the diff of the <hX> element to the top, to select it
2672
- });
2673
-
2674
- // change the URL based on the current position of the screen
2675
- $('#sidebar').on('activate.bs.scrollspy', function (e) {
2676
- var el = $(e.target);
2677
- if(el.find('ul').size() == 0) {
2678
- var hash = el.find('a').attr('href');
2679
- if(typeof hash === 'string' && hash.substring(0, 1) == '#') {
2680
- urlOptions.hash = hash;
2681
- // console.log(urlOptions.hash);
2682
- netdataHashUpdate();
2683
- }
2684
- }
2685
- });
2686
-
2687
- document.getElementById('footer').style.display = 'block';
2688
-
2689
- var update_options_modal = function() {
2690
- // console.log('update_options_modal');
2691
-
2692
- var sync_option = function(option) {
2693
- var self = $('#' + option);
2694
-
2695
- if(self.prop('checked') !== NETDATA.getOption(option)) {
2696
- // console.log('switching ' + option.toString());
2697
- self.bootstrapToggle(NETDATA.getOption(option)?'on':'off');
This file is too large to show in full.
web/registry.html
+191
-191
@@ -1,202 +1,202 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>NetData Registry Dashboard</title>
5
- <meta name="application-name" content="netdata">
6
-
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
-
14
- <meta property="og:locale" content="en_US" />
15
- <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16
- <meta property="og:url" content="http://my-netdata.io/"/>
17
- <meta property="og:type" content="website"/>
18
- <meta property="og:site_name" content="netdata"/>
19
- <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20
- <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
21
-
22
- <script>
23
- // this section has to appear before loading dashboard.js
24
-
25
- // Select a theme.
26
- // uncomment on of the two themes:
27
-
28
- // var netdataTheme = 'default'; // this is white
29
- var netdataTheme = 'slate'; // this is dark
30
-
31
-
32
- // Set the default netdata server.
33
- // on charts without a 'data-host', this one will be used.
34
- // the default is the server that dashboard.js is downloaded from.
35
-
36
- // var netdataServer = 'http://my.server:19999/';
37
-
38
- function registryGotoServer(guid) {
39
- console.log('goto server: ' + guid);
40
- }
41
-
42
- function registryAddServer(u) {
43
- return '<div id="registry_server_' + u.guid + '" class="registry-server-container" onClick="registryGotoServer(\'' + u.guid + '\'); return false;">'
44
- + '<div class="registry-server-name">' + u.name + '</div>'
45
- + '<div data-netdata="system.cpu"'
46
- + ' data-host="' + u.url + '"'
47
- + ' data-chart-library="sparkline"'
48
- + ' data-sparkline-chartrangemin="0"'
49
- + ' data-sparkline-chartrangemax="100"'
50
- + ' data-sparkline-chartrangeclip="true"'
51
- + ' data-sparkline-disabletooltips="true"'
52
- + ' data-sparkline-disableinteraction="true"'
53
- + ' data-sparkline-disablehighlight="true"'
54
- + ' data-sparkline-linecolor="#444"'
55
- + ' data-sparkline-spotcolor="disable"'
56
- + ' data-sparkline-minspotcolor="disable"'
57
- + ' data-sparkline-maxspotcolor="disable"'
58
- + ' data-width="100%"'
59
- + ' data-height="20px"'
60
- + ' data-after="-200"'
61
- + '></div>'
62
- + '</div>';
63
- }
64
-
65
- var netdataRegistryCallback = function(machines_array) {
66
- var el = '';
67
- var a1 = '';
68
- var found = 0;
69
-
70
- if(machines_array) {
71
- function name_comparator_desc(a, b) {
72
- if (a.name > b.name) return -1;
73
- if (a.name < b.name) return 1;
74
- return 0;
75
- }
76
-
77
- var machines = machines_array.sort(name_comparator_desc);
78
- var len = machines.length;
79
- while(len--) {
80
- var u = machines[len];
81
-
82
- var status = "enabled";
83
- found++;
84
-
85
- if(u.guid === NETDATA.registry.machine_guid)
86
- status = "disabled"
87
-
88
- el += registryAddServer(u);
89
- a1 += '<li id="registry_action_' + u.guid + '"><a href="#" onclick="deleteRegistryModalHandler(\'' + u.guid + '\',\'' + u.name + '\',\'' + u.url + '\'); return false;"><i class="fa fa-trash-o" aria-hidden="true" style="color: #999;"></i></a></li>';
90
- }
91
- }
92
-
93
- if(!found) {
94
- if(machines)
95
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">your netdata server list is empty...</a></li>';
96
- else
97
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">failed to contact the registry...</a></li>';
98
-
99
- a1 += '<li><a href="#"> </a></li>';
100
-
101
- el += '<li role="separator" class="divider"></li>' +
102
- '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
103
- '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
104
- '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
105
- a1 += '<li role="separator" class="divider"></li>' +
106
- '<li><a href="#"> </a></li>' +
107
- '<li><a href="#"> </a></li>'+
108
- '<li><a href="#"> </a></li>';
109
- }
110
-
111
- el += '<li role="separator" class="divider"></li>';
112
- a1 += '<li role="separator" class="divider"></li>';
113
-
114
- el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
115
- a1 += '<li><a href="#" style="color: #999;" onclick="switchRegistryModalHandler(); return false;"><i class="fa fa-cog" aria-hidden="true" style="color: #999;"></i></a></li>'
116
-
117
- document.getElementById('mynetdata_servers').innerHTML = el;
118
- //document.getElementById('mynetdata_servers2').innerHTML = el;
119
- //document.getElementById('mynetdata_actions1').innerHTML = a1;
120
- NETDATA.updatedDom();
121
- };
122
- </script>
123
-
124
- <!--
125
- Load dashboard.js
126
-
127
- to host this HTML file on your web server,
128
- you have to load dashboard.js from the netdata server.
129
-
130
- So, pick one the two below
131
- If you pick the first, set the server name/IP.
132
-
133
- The second assumes you host this file on /usr/share/netdata/web
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?v40"></script>
138
-
139
- <script>
140
- // Set options for TV operation
141
- // This has to be done, after dashboard.js is loaded
142
-
143
- // destroy charts not shown (lowers memory on the browser)
144
- NETDATA.options.current.destroy_on_hide = true;
145
-
146
- // set this to false, to always show all dimensions
147
- NETDATA.options.current.eliminate_zero_dimensions = true;
148
-
149
- // lower the pressure on this browser
150
- NETDATA.options.current.concurrent_refreshes = true;
151
-
152
- // if the tv browser is too slow (a pi?)
153
- // set this to false
154
- NETDATA.options.current.parallel_refresher = true;
155
-
156
- // always update the charts, even if focus is lost
157
- // NETDATA.options.current.stop_updates_when_focus_is_lost = false;
158
- </script>
159
-
160
- <style>
161
- .registry-container {
162
- margin-left: 50px;
163
- max-width: 400px;
164
- min-width: 200px;
165
- border: 1px solid #555;
166
- max-height: 80vh;
167
- height: auto;
168
- overflow-x: hidden;
169
- /* background-color: #3a3f44; */
170
- text-align: center;
171
- }
172
- .registry-server-container {
173
- width: 100%;
174
- height: auto;
175
- overflow-x: hidden;
176
- font-size: 10px;
177
- padding-left: 10px;
178
- padding-right: 10px;
179
- }
180
- .registry-server-container:hover {
181
- color: #f5f5f5;
182
- background-color: #262626;
183
- }
184
- .registry-server-name {
185
- display: block;
186
- text-decoration: none !important;
187
- clear: both;
188
- font-size: 16px;
189
- font-weight: bold;
190
- white-space: normal;
191
- padding-top: 10px;
192
- }
193
- </style>
4
+ <title>NetData Registry Dashboard</title>
5
+ <meta name="application-name" content="netdata">
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
+
14
+ <meta property="og:locale" content="en_US" />
15
+ <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16
+ <meta property="og:url" content="http://my-netdata.io/"/>
17
+ <meta property="og:type" content="website"/>
18
+ <meta property="og:site_name" content="netdata"/>
19
+ <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20
+ <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
21
+
22
+ <script>
23
+ // this section has to appear before loading dashboard.js
24
+
25
+ // Select a theme.
26
+ // uncomment on of the two themes:
27
+
28
+ // var netdataTheme = 'default'; // this is white
29
+ var netdataTheme = 'slate'; // this is dark
30
+
31
+
32
+ // Set the default netdata server.
33
+ // on charts without a 'data-host', this one will be used.
34
+ // the default is the server that dashboard.js is downloaded from.
35
+
36
+ // var netdataServer = 'http://my.server:19999/';
37
+
38
+ function registryGotoServer(guid) {
39
+ console.log('goto server: ' + guid);
40
+ }
41
+
42
+ function registryAddServer(u) {
43
+ return '<div id="registry_server_' + u.guid + '" class="registry-server-container" onClick="registryGotoServer(\'' + u.guid + '\'); return false;">'
44
+ + '<div class="registry-server-name">' + u.name + '</div>'
45
+ + '<div data-netdata="system.cpu"'
46
+ + ' data-host="' + u.url + '"'
47
+ + ' data-chart-library="sparkline"'
48
+ + ' data-sparkline-chartrangemin="0"'
49
+ + ' data-sparkline-chartrangemax="100"'
50
+ + ' data-sparkline-chartrangeclip="true"'
51
+ + ' data-sparkline-disabletooltips="true"'
52
+ + ' data-sparkline-disableinteraction="true"'
53
+ + ' data-sparkline-disablehighlight="true"'
54
+ + ' data-sparkline-linecolor="#444"'
55
+ + ' data-sparkline-spotcolor="disable"'
56
+ + ' data-sparkline-minspotcolor="disable"'
57
+ + ' data-sparkline-maxspotcolor="disable"'
58
+ + ' data-width="100%"'
59
+ + ' data-height="20px"'
60
+ + ' data-after="-200"'
61
+ + '></div>'
62
+ + '</div>';
63
+ }
64
+
65
+ var netdataRegistryCallback = function(machines_array) {
66
+ var el = '';
67
+ var a1 = '';
68
+ var found = 0;
69
+
70
+ if(machines_array) {
71
+ function name_comparator_desc(a, b) {
72
+ if (a.name > b.name) return -1;
73
+ if (a.name < b.name) return 1;
74
+ return 0;
75
+ }
76
+
77
+ var machines = machines_array.sort(name_comparator_desc);
78
+ var len = machines.length;
79
+ while(len--) {
80
+ var u = machines[len];
81
+
82
+ var status = "enabled";
83
+ found++;
84
+
85
+ if(u.guid === NETDATA.registry.machine_guid)
86
+ status = "disabled"
87
+
88
+ el += registryAddServer(u);
89
+ a1 += '<li id="registry_action_' + u.guid + '"><a href="#" onclick="deleteRegistryModalHandler(\'' + u.guid + '\',\'' + u.name + '\',\'' + u.url + '\'); return false;"><i class="fa fa-trash-o" aria-hidden="true" style="color: #999;"></i></a></li>';
90
+ }
91
+ }
92
+
93
+ if(!found) {
94
+ if(machines)
95
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">your netdata server list is empty...</a></li>';
96
+ else
97
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #666;" target="_blank">failed to contact the registry...</a></li>';
98
+
99
+ a1 += '<li><a href="#"> </a></li>';
100
+
101
+ el += '<li role="separator" class="divider"></li>' +
102
+ '<li><a href="//london.netdata.rocks/default.html">EU - London (DigitalOcean.com)</a></li>' +
103
+ '<li><a href="//atlanta.netdata.rocks/default.html">US - Atlanta (CDN77.com)</a></li>' +
104
+ '<li><a href="//athens.netdata.rocks/default.html">EU - Athens</a></li>';
105
+ a1 += '<li role="separator" class="divider"></li>' +
106
+ '<li><a href="#"> </a></li>' +
107
+ '<li><a href="#"> </a></li>'+
108
+ '<li><a href="#"> </a></li>';
109
+ }
110
+
111
+ el += '<li role="separator" class="divider"></li>';
112
+ a1 += '<li role="separator" class="divider"></li>';
113
+
114
+ el += '<li><a href="https://github.com/firehol/netdata/wiki/mynetdata-menu-item" style="color: #999;" target="_blank">What is this?</a></li>';
115
+ a1 += '<li><a href="#" style="color: #999;" onclick="switchRegistryModalHandler(); return false;"><i class="fa fa-cog" aria-hidden="true" style="color: #999;"></i></a></li>'
116
+
117
+ document.getElementById('mynetdata_servers').innerHTML = el;
118
+ //document.getElementById('mynetdata_servers2').innerHTML = el;
119
+ //document.getElementById('mynetdata_actions1').innerHTML = a1;
120
+ NETDATA.updatedDom();
121
+ };
122
+ </script>
123
+
124
+ <!--
125
+ Load dashboard.js
126
+
127
+ to host this HTML file on your web server,
128
+ you have to load dashboard.js from the netdata server.
129
+
130
+ So, pick one the two below
131
+ If you pick the first, set the server name/IP.
132
+
133
+ The second assumes you host this file on /usr/share/netdata/web
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?v40"></script>
138
+
139
+ <script>
140
+ // Set options for TV operation
141
+ // This has to be done, after dashboard.js is loaded
142
+
143
+ // destroy charts not shown (lowers memory on the browser)
144
+ NETDATA.options.current.destroy_on_hide = true;
145
+
146
+ // set this to false, to always show all dimensions
147
+ NETDATA.options.current.eliminate_zero_dimensions = true;
148
+
149
+ // lower the pressure on this browser
150
+ NETDATA.options.current.concurrent_refreshes = true;
151
+
152
+ // if the tv browser is too slow (a pi?)
153
+ // set this to false
154
+ NETDATA.options.current.parallel_refresher = true;
155
+
156
+ // always update the charts, even if focus is lost
157
+ // NETDATA.options.current.stop_updates_when_focus_is_lost = false;
158
+ </script>
159
+
160
+ <style>
161
+ .registry-container {
162
+ margin-left: 50px;
163
+ max-width: 400px;
164
+ min-width: 200px;
165
+ border: 1px solid #555;
166
+ max-height: 80vh;
167
+ height: auto;
168
+ overflow-x: hidden;
169
+ /* background-color: #3a3f44; */
170
+ text-align: center;
171
+ }
172
+ .registry-server-container {
173
+ width: 100%;
174
+ height: auto;
175
+ overflow-x: hidden;
176
+ font-size: 10px;
177
+ padding-left: 10px;
178
+ padding-right: 10px;
179
+ }
180
+ .registry-server-container:hover {
181
+ color: #f5f5f5;
182
+ background-color: #262626;
183
+ }
184
+ .registry-server-name {
185
+ display: block;
186
+ text-decoration: none !important;
187
+ clear: both;
188
+ font-size: 16px;
189
+ font-weight: bold;
190
+ white-space: normal;
191
+ padding-top: 10px;
192
+ }
193
+ </style>
194
</head>
195
<body>
196
197
<div id="mynetdata_servers" class="registry-container" onscroll="NETDATA.onscroll();">
198
199
- Loading....
199
+ Loading....
200
201
</div> <!-- registry-container -->
202
</body>
web/tv.html
+241
-241
@@ -1,253 +1,253 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
- <title>NetData TV Dashboard</title>
5
- <meta name="application-name" content="netdata">
6
-
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <meta charset="utf-8">
9
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
- <meta name="viewport" content="width=device-width, initial-scale=1">
11
- <meta name="apple-mobile-web-app-capable" content="yes">
12
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
-
14
- <meta property="og:locale" content="en_US" />
15
- <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16
- <meta property="og:url" content="http://my-netdata.io/"/>
17
- <meta property="og:type" content="website"/>
18
- <meta property="og:site_name" content="netdata"/>
19
- <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20
- <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
21
-
22
- <script>
23
- // this section has to appear before loading dashboard.js
24
-
25
- // Select a theme.
26
- // uncomment on of the two themes:
27
-
28
- // var netdataTheme = 'default'; // this is white
29
- var netdataTheme = 'slate'; // this is dark
30
-
31
-
32
- // Set the default netdata server.
33
- // on charts without a 'data-host', this one will be used.
34
- // the default is the server that dashboard.js is downloaded from.
35
-
36
- // var netdataServer = 'http://my.server:19999/';
37
- </script>
38
-
39
- <!--
40
- Load dashboard.js
41
-
42
- to host this HTML file on your web server,
43
- you have to load dashboard.js from the netdata server.
44
-
45
- So, pick one the two below
46
- If you pick the first, set the server name/IP.
47
-
48
- The second assumes you host this file on /usr/share/netdata/web
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?v39"></script>
53
-
54
- <script>
55
- // Set options for TV operation
56
- // This has to be done, after dashboard.js is loaded
57
-
58
- // destroy charts not shown (lowers memory on the browser)
59
- NETDATA.options.current.destroy_on_hide = true;
60
-
61
- // set this to false, to always show all dimensions
62
- NETDATA.options.current.eliminate_zero_dimensions = true;
63
-
64
- // lower the pressure on this browser
65
- NETDATA.options.current.concurrent_refreshes = false;
66
-
67
- // if the tv browser is too slow (a pi?)
68
- // set this to false
69
- NETDATA.options.current.parallel_refresher = true;
70
-
71
- // always update the charts, even if focus is lost
72
- // NETDATA.options.current.stop_updates_when_focus_is_lost = false;
73
-
74
- // Since you may render charts from many servers and any of them may
75
- // become offline for some time, the charts will break.
76
- // This will reload the page every RELOAD_EVERY minutes
77
-
78
- var RELOAD_EVERY = 5;
79
- setTimeout(function(){
80
- location.reload();
81
- }, RELOAD_EVERY * 60 * 1000);
82
-
83
- </script>
4
+ <title>NetData TV Dashboard</title>
5
+ <meta name="application-name" content="netdata">
6
+
7
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+ <meta charset="utf-8">
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <meta name="apple-mobile-web-app-capable" content="yes">
12
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
13
+
14
+ <meta property="og:locale" content="en_US" />
15
+ <meta property="og:image" content="https://my-netdata.io/images/seo-performance-512.png"/>
16
+ <meta property="og:url" content="http://my-netdata.io/"/>
17
+ <meta property="og:type" content="website"/>
18
+ <meta property="og:site_name" content="netdata"/>
19
+ <meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
20
+ <meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
21
+
22
+ <script>
23
+ // this section has to appear before loading dashboard.js
24
+
25
+ // Select a theme.
26
+ // uncomment on of the two themes:
27
+
28
+ // var netdataTheme = 'default'; // this is white
29
+ var netdataTheme = 'slate'; // this is dark
30
+
31
+
32
+ // Set the default netdata server.
33
+ // on charts without a 'data-host', this one will be used.
34
+ // the default is the server that dashboard.js is downloaded from.
35
+
36
+ // var netdataServer = 'http://my.server:19999/';
37
+ </script>
38
+
39
+ <!--
40
+ Load dashboard.js
41
+
42
+ to host this HTML file on your web server,
43
+ you have to load dashboard.js from the netdata server.
44
+
45
+ So, pick one the two below
46
+ If you pick the first, set the server name/IP.
47
+
48
+ The second assumes you host this file on /usr/share/netdata/web
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?v39"></script>
53
+
54
+ <script>
55
+ // Set options for TV operation
56
+ // This has to be done, after dashboard.js is loaded
57
+
58
+ // destroy charts not shown (lowers memory on the browser)
59
+ NETDATA.options.current.destroy_on_hide = true;
60
+
61
+ // set this to false, to always show all dimensions
62
+ NETDATA.options.current.eliminate_zero_dimensions = true;
63
+
64
+ // lower the pressure on this browser
65
+ NETDATA.options.current.concurrent_refreshes = false;
66
+
67
+ // if the tv browser is too slow (a pi?)
68
+ // set this to false
69
+ NETDATA.options.current.parallel_refresher = true;
70
+
71
+ // always update the charts, even if focus is lost
72
+ // NETDATA.options.current.stop_updates_when_focus_is_lost = false;
73
+
74
+ // Since you may render charts from many servers and any of them may
75
+ // become offline for some time, the charts will break.
76
+ // This will reload the page every RELOAD_EVERY minutes
77
+
78
+ var RELOAD_EVERY = 5;
79
+ setTimeout(function(){
80
+ location.reload();
81
+ }, RELOAD_EVERY * 60 * 1000);
82
+
83
+ </script>
84
85
</head>
86
<body>
87
88
<div style="width: 100%; text-align: center; display: inline-block;">
89
90
- <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
91
- <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
92
- <b>CPU On both servers</b>
93
- </div>
94
- <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
95
- <br/>
96
- <div data-netdata="system.cpu"
97
- data-host="http://netdata.firehol.org"
98
- data-title="CPU usage of netdata.firehol.org"
99
- data-chart-library="dygraph"
100
- data-width="49%"
101
- data-height="100%"
102
- data-after="-300"
103
- ></div>
104
- <div data-netdata="system.cpu"
105
- data-title="CPU usage of your netdata server"
106
- data-chart-library="dygraph"
107
- data-width="49%"
108
- data-height="100%"
109
- data-after="-300"
110
- ></div>
111
- </div>
112
- </div>
113
-
114
-
115
- <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
116
- <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
117
- <b>Disk I/O on both servers</b>
118
- </div>
119
- <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
120
- <div data-netdata="system.io"
121
- data-host="http://netdata.firehol.org"
122
- data-title="I/O on netdata.firehol.org"
123
- data-chart-library="dygraph"
124
- data-width="49%"
125
- data-height="100%"
126
- data-after="-300"
127
- ></div>
128
- <div data-netdata="system.io"
129
- data-title="I/O on your netdata server"
130
- data-chart-library="dygraph"
131
- data-width="49%"
132
- data-height="100%"
133
- data-after="-300"
134
- ></div>
135
- </div>
136
- </div>
137
-
138
-
139
- <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
140
- <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
141
- <b>IPv4 traffic on both servers</b>
142
- </div>
143
- <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
144
- <div data-netdata="system.ipv4"
145
- data-host="http://netdata.firehol.org"
146
- data-title="IPv4 traffic on netdata.firehol.org"
147
- data-chart-library="dygraph"
148
- data-width="49%"
149
- data-height="100%"
150
- data-after="-300"
151
- ></div>
152
- <div data-netdata="system.ipv4"
153
- data-title="IPv4 traffic on your netdata server"
154
- data-chart-library="dygraph"
155
- data-width="49%"
156
- data-height="100%"
157
- data-after="-300"
158
- ></div>
159
- </div>
160
- </div>
161
-
162
- <div style="width: 100%; height: 23vh; text-align: center; display: inline-block;">
163
- <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
164
- <b>Netdata statistics on both servers</b>
165
- </div>
166
- <div style="width: 100%; max-height: calc(100% - 15px); text-align: center; display: inline-block;">
167
- <div style="width: 49%; height:100%; align: center; display: inline-block;">
168
- netdata.firehol.org
169
- <br/>
170
- <div data-netdata="netdata.requests"
171
- data-host="http://netdata.firehol.org"
172
- data-title="Chart Refreshes/s"
173
- data-chart-library="gauge"
174
- data-width="20%"
175
- data-height="100%"
176
- data-after="-300"
177
- data-points="300"
178
- ></div>
179
- <div data-netdata="netdata.clients"
180
- data-host="http://netdata.firehol.org"
181
- data-title="Sockets"
182
- data-chart-library="gauge"
183
- data-width="20%"
184
- data-height="100%"
185
- data-after="-300"
186
- data-points="300"
187
- data-colors="#AA5500"
188
- ></div>
189
- <div data-netdata="netdata.net"
190
- data-dimensions="in"
191
- data-host="http://netdata.firehol.org"
192
- data-title="Requests Traffic"
193
- data-chart-library="easypiechart"
194
- data-width="15%"
195
- data-height="100%"
196
- data-after="-300"
197
- data-points="300"
198
- ></div>
199
- <div data-netdata="netdata.net"
200
- data-dimensions="out"
201
- data-host="http://netdata.firehol.org"
202
- data-title="Chart Data Traffic"
203
- data-chart-library="easypiechart"
204
- data-width="15%"
205
- data-height="100%"
206
- data-after="-300"
207
- data-points="300"
208
- ></div>
209
- </div>
210
- <div style="width: 49%; height:100%; align: center; display: inline-block;">
211
- your netdata server
212
- <br/>
213
- <div data-netdata="netdata.requests"
214
- data-title="Chart Refreshes/s"
215
- data-chart-library="gauge"
216
- data-width="20%"
217
- data-height="100%"
218
- data-after="-300"
219
- data-points="300"
220
- ></div>
221
- <div data-netdata="netdata.clients"
222
- data-title="Sockets"
223
- data-chart-library="gauge"
224
- data-width="20%"
225
- data-height="100%"
226
- data-after="-300"
227
- data-points="300"
228
- data-colors="#AA5500"
229
- ></div>
230
- <div data-netdata="netdata.net"
231
- data-dimensions="in"
232
- data-title="Requests Traffic"
233
- data-chart-library="easypiechart"
234
- data-width="15%"
235
- data-height="100%"
236
- data-after="-300"
237
- data-points="300"
238
- ></div>
239
- <div data-netdata="netdata.net"
240
- data-dimensions="out"
241
- data-title="Chart Data Traffic"
242
- data-chart-library="easypiechart"
243
- data-width="15%"
244
- data-height="100%"
245
- data-after="-300"
246
- data-points="300"
247
- ></div>
248
- </div>
249
- </div>
250
- </div>
90
+ <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
91
+ <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
92
+ <b>CPU On both servers</b>
93
+ </div>
94
+ <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
95
+ <br/>
96
+ <div data-netdata="system.cpu"
97
+ data-host="http://netdata.firehol.org"
98
+ data-title="CPU usage of netdata.firehol.org"
99
+ data-chart-library="dygraph"
100
+ data-width="49%"
101
+ data-height="100%"
102
+ data-after="-300"
103
+ ></div>
104
+ <div data-netdata="system.cpu"
105
+ data-title="CPU usage of your netdata server"
106
+ data-chart-library="dygraph"
107
+ data-width="49%"
108
+ data-height="100%"
109
+ data-after="-300"
110
+ ></div>
111
+ </div>
112
+ </div>
113
+
114
+
115
+ <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
116
+ <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
117
+ <b>Disk I/O on both servers</b>
118
+ </div>
119
+ <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
120
+ <div data-netdata="system.io"
121
+ data-host="http://netdata.firehol.org"
122
+ data-title="I/O on netdata.firehol.org"
123
+ data-chart-library="dygraph"
124
+ data-width="49%"
125
+ data-height="100%"
126
+ data-after="-300"
127
+ ></div>
128
+ <div data-netdata="system.io"
129
+ data-title="I/O on your netdata server"
130
+ data-chart-library="dygraph"
131
+ data-width="49%"
132
+ data-height="100%"
133
+ data-after="-300"
134
+ ></div>
135
+ </div>
136
+ </div>
137
+
138
+
139
+ <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
140
+ <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
141
+ <b>IPv4 traffic on both servers</b>
142
+ </div>
143
+ <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
144
+ <div data-netdata="system.ipv4"
145
+ data-host="http://netdata.firehol.org"
146
+ data-title="IPv4 traffic on netdata.firehol.org"
147
+ data-chart-library="dygraph"
148
+ data-width="49%"
149
+ data-height="100%"
150
+ data-after="-300"
151
+ ></div>
152
+ <div data-netdata="system.ipv4"
153
+ data-title="IPv4 traffic on your netdata server"
154
+ data-chart-library="dygraph"
155
+ data-width="49%"
156
+ data-height="100%"
157
+ data-after="-300"
158
+ ></div>
159
+ </div>
160
+ </div>
161
+
162
+ <div style="width: 100%; height: 23vh; text-align: center; display: inline-block;">
163
+ <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
164
+ <b>Netdata statistics on both servers</b>
165
+ </div>
166
+ <div style="width: 100%; max-height: calc(100% - 15px); text-align: center; display: inline-block;">
167
+ <div style="width: 49%; height:100%; align: center; display: inline-block;">
168
+ netdata.firehol.org
169
+ <br/>
170
+ <div data-netdata="netdata.requests"
171
+ data-host="http://netdata.firehol.org"
172
+ data-title="Chart Refreshes/s"
173
+ data-chart-library="gauge"
174
+ data-width="20%"
175
+ data-height="100%"
176
+ data-after="-300"
177
+ data-points="300"
178
+ ></div>
179
+ <div data-netdata="netdata.clients"
180
+ data-host="http://netdata.firehol.org"
181
+ data-title="Sockets"
182
+ data-chart-library="gauge"
183
+ data-width="20%"
184
+ data-height="100%"
185
+ data-after="-300"
186
+ data-points="300"
187
+ data-colors="#AA5500"
188
+ ></div>
189
+ <div data-netdata="netdata.net"
190
+ data-dimensions="in"
191
+ data-host="http://netdata.firehol.org"
192
+ data-title="Requests Traffic"
193
+ data-chart-library="easypiechart"
194
+ data-width="15%"
195
+ data-height="100%"
196
+ data-after="-300"
197
+ data-points="300"
198
+ ></div>
199
+ <div data-netdata="netdata.net"
200
+ data-dimensions="out"
201
+ data-host="http://netdata.firehol.org"
202
+ data-title="Chart Data Traffic"
203
+ data-chart-library="easypiechart"
204
+ data-width="15%"
205
+ data-height="100%"
206
+ data-after="-300"
207
+ data-points="300"
208
+ ></div>
209
+ </div>
210
+ <div style="width: 49%; height:100%; align: center; display: inline-block;">
211
+ your netdata server
212
+ <br/>
213
+ <div data-netdata="netdata.requests"
214
+ data-title="Chart Refreshes/s"
215
+ data-chart-library="gauge"
216
+ data-width="20%"
217
+ data-height="100%"
218
+ data-after="-300"
219
+ data-points="300"
220
+ ></div>
221
+ <div data-netdata="netdata.clients"
222
+ data-title="Sockets"
223
+ data-chart-library="gauge"
224
+ data-width="20%"
225
+ data-height="100%"
226
+ data-after="-300"
227
+ data-points="300"
228
+ data-colors="#AA5500"
229
+ ></div>
230
+ <div data-netdata="netdata.net"
231
+ data-dimensions="in"
232
+ data-title="Requests Traffic"
233
+ data-chart-library="easypiechart"
234
+ data-width="15%"
235
+ data-height="100%"
236
+ data-after="-300"
237
+ data-points="300"
238
+ ></div>
239
+ <div data-netdata="netdata.net"
240
+ data-dimensions="out"
241
+ data-title="Chart Data Traffic"
242
+ data-chart-library="easypiechart"
243
+ data-width="15%"
244
+ data-height="100%"
245
+ data-after="-300"
246
+ data-points="300"
247
+ ></div>
248
+ </div>
249
+ </div>
250
+ </div>
251
</div>
252
</body>
253
</html>