sidebar-info update - DB engine (#6744)
* remove "Netdata is using # MB of memory on HOSTNAME for # hour, # minutes, and # seconds of real-time history." * Added "memory_mode" key to the get "charts" API call * don't show db engine tip when user has it already installed * add back hostname information * add oxford comma (only for db-engine users) * update main.js hash * <b> --> <strong> (but only in sidebar info, main.js)
Jacek Kolasa committed
Sep 12, 2019 at 15:35 UTC
788fbb219a3a9bbfe4e2d89a5b503d8360f5ce3d
3 files changed
+19
-12
web/api/formatters/charts2json.c
+2
@@ -54,6 +54,7 @@ void charts2json(RRDHOST *host, BUFFER *wb) {
54
",\n\t\"timezone\": \"%s\""
55
",\n\t\"update_every\": %d"
56
",\n\t\"history\": %ld"
57
+ ",\n\t\"memory_mode\": \"%s\""
58
",\n\t\"custom_info\": \"%s\""
59
",\n\t\"charts\": {"
60
, host->hostname
@@ -63,6 +64,7 @@ void charts2json(RRDHOST *host, BUFFER *wb) {
64
, host->timezone
65
, host->rrd_update_every
66
, host->rrd_history_entries
67
+ , rrd_memory_mode_name(host->rrd_memory_mode)
68
, custom_dashboard_info_js_filename
69
);
70
web/gui/index.html
+1
-1
@@ -33,7 +33,7 @@
33
<meta name="twitter:description" content="Unparalleled insights, in real-time, of everything happening on your Linux systems and applications, with stunning, interactive web dashboards and powerful performance and health alarms." />
34
<meta name="twitter:image" content="https://cloud.githubusercontent.com/assets/2662304/14092712/93b039ea-f551-11e5-822c-beadbf2b2a2e.gif" />
35
36
- <script src="main.js?v20190902-0"></script>
36
+ <script src="main.js?v20190905-0"></script>
37
</head>
38
39
<body data-spy="scroll" data-target="#sidebar" data-offset="100">
web/gui/main.js
+16
-11
@@ -1786,21 +1786,26 @@ function renderPage(menus, data) {
1786
html += mhead + shtml + '</div></div><hr role="separator"/>';
1787
}
1788
1789
+ const isMemoryModeDbEngine = data.memory_mode === "dbengine";
1790
+
1791
sidebar += '<li class="" style="padding-top:15px;"><a href="https://github.com/netdata/netdata/blob/master/docs/Add-more-charts-to-netdata.md#add-more-charts-to-netdata" target="_blank"><i class="fas fa-plus"></i> add more charts</a></li>';
1792
sidebar += '<li class=""><a href="https://github.com/netdata/netdata/tree/master/health#Health-monitoring" target="_blank"><i class="fas fa-plus"></i> add more alarms</a></li>';
1793
sidebar += '<li class="" style="margin:20px;color:#666;"><small>Every ' +
1794
((data.update_every === 1) ? 'second' : data.update_every.toString() + ' seconds') + ', ' +
1793
- 'Netdata collects <b>' + data.dimensions_count.toLocaleString() + '</b> metrics, presents them in <b>' +
1794
- data.charts_count.toLocaleString() + '</b> charts and monitors them with <b>' +
1795
- data.alarms_count.toLocaleString() + '</b> alarms. Netdata is using ' +
1796
- Math.round(data.rrd_memory_bytes / 1024 / 1024).toLocaleString() + ' MB of memory on <b>' +
1797
- data.hostname.toString() + '</b> for ' +
1798
- NETDATA.seconds4human(data.update_every * data.history, {
1799
- minute: 'minute', minutes: 'minutes', second: 'second', seconds: 'seconds', space: ' ',
1800
- }) +
1801
- ' of real-time history.<br /> <br />' + 'Get more history by ' +
1802
- '<a href="https://docs.netdata.cloud/docs/configuration-guide/#increase-the-metrics-retention-period" target=_blank>configuring Netdata\'s <b>history</b></a> or using the <a href="https://docs.netdata.cloud/database/engine/" target=_blank>DB engine.</a>' +
1803
- '<br/> <br/><b>netdata</b><br/>' + data.version.toString() + '</small></li>';
1795
+ 'Netdata collects <strong>' + data.dimensions_count.toLocaleString() + '</strong> metrics on ' +
1796
+ data.hostname.toString() + ', presents them in <strong>' +
1797
+ data.charts_count.toLocaleString() + '</strong> charts' +
1798
+ (isMemoryModeDbEngine ? '' : ',') + // oxford comma
1799
+ ' and monitors them with <strong>' +
1800
+ data.alarms_count.toLocaleString() + '</strong> alarms.';
1801
+
1802
+ if (!isMemoryModeDbEngine) {
1803
+ sidebar += '<br /> <br />Get more history by ' +
1804
+ '<a href="https://docs.netdata.cloud/docs/configuration-guide/#increase-the-metrics-retention-period" target=_blank>configuring Netdata\'s <strong>history</strong></a> or using the <a href="https://docs.netdata.cloud/database/engine/" target=_blank>DB engine.</a>'
1805
+ }
1806
+
1807
+ sidebar += '<br/> <br/><strong>netdata</strong><br/>' + data.version.toString() + '</small></li>';
1808
+
1809
sidebar += '</ul>';
1810
div.innerHTML = html;
1811
document.getElementById('sidebar').innerHTML = sidebar;