Skip to content

Commit

Permalink
for es7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang committed Mar 25, 2020
1 parent 74905c7 commit b5b10fa
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 56 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Bigdesk

Live charts and statistics for Elasticsearch 2.x /5.x cluster.
Live charts and statistics for Elasticsearch 2.x/5.x/7.x+ cluster.
## 2020-03-25
- Test on Elasticsearch 7.6.1

- Running as a Chrome extension

download crx/es-bigdesk.crx , check extentions develop mode on , drag to webbrowser

if cannot installed , enable installing local CRX files , or unzip es-bigdesk.crx then install from local folder

Click the extension icon in the toolbar of your web browser.

Note that you don¡¯t need to enable CORS with this method.

Test on Chrome 75.x and Opera 67

- Run bigdesk standalone

site plugins are not supported. Run bigdesk standalone ,see below

## 2016-10-30
- How to use for ES5.x

Expand Down
4 changes: 4 additions & 0 deletions _site/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
chrome.browserAction.onClicked.addListener(function (tab) {
chrome.tabs.create({'url': chrome.extension.getURL('index.html')}, function (tab) {
});
});
Binary file modified _site/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@
<div class="sixcol">
<span class="connectionPanelSectionWithoutDecoration">
ES node REST endpoint
<input id="restEndPoint" type="text" size="40" value="http://localhost:9200" />
<input id="restEndPoint" type="text" size="40" value="http://localhost:4200" />
</span>
</div>
<div class="sixcol last">
<span class="connectionPanelSection">
Refresh every
<select id="refreshInterval">
<option value="1000" label="1 sec">1 sec</option>
<option value="2000" label="2 sec" selected="selected">2 sec</option>
<option value="3000" label="3 sec">3 sec</option>
<option value="2000" label="2 sec">2 sec</option>
<option value="3000" label="3 sec" selected="selected">3 sec</option>
<option value="5000" label="5 sec">5 sec</option>
<option value="10000" label="10 sec">10 sec</option>
<option value="30000" label="30 sec">30 sec</option>
Expand Down Expand Up @@ -122,8 +122,8 @@
<script>
function checkServer(){
if(location.hostname != ""){
if($("#restEndPoint").val() == "http://localhost:9200"){
$("#restEndPoint").val(location.protocol+"//"+location.hostname+":9200");
if($("#restEndPoint").val() == "http://localhost:4200"){
$("#restEndPoint").val(location.protocol+"//"+location.hostname+":4200");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions _site/js/bigdeskApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ var selectedView = undefined;
var selectedClusterName = undefined;

var connectTo = function(url, refreshInterval, storeSize, dispatcher, selectedView, callback) {

//fix 20200324
if( url.endsWith('/')){url=url.substring(0,url.length-1);}
var connectionConfig = { baseUrl: url };
var clusterHealth = new ClusterHealth({},connectionConfig);

Expand Down Expand Up @@ -217,7 +218,6 @@ $(document).ready(
storeSize = $("#storeSize"),
button = $("#connectButton"),
ajaxIndicator = $("#ajaxIndicator");

var isConnected = function() {
return (button.val() !== "Connect");
};
Expand Down Expand Up @@ -303,7 +303,7 @@ $(document).ready(
var parseUrlParams = function() {
return {
endpoint: getSearchUrlVar("endpoint") || "http://localhost:9200",
refresh: getSearchUrlVar("refresh") || 2000,
refresh: getSearchUrlVar("refresh") || 3000,
history: getSearchUrlVar("history") || 300000,
connect: getSearchUrlVar("connect") || false
}
Expand Down
20 changes: 10 additions & 10 deletions _site/js/charts/bigdesk_charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ bigdesk_charts.threadpoolSearch = {

}

bigdesk_charts.threadpoolIndex = {
bigdesk_charts.threadpoolGet = {
chart: function(element) {
return timeSeriesChart()
.width(bigdesk_charts.default.width).height(bigdesk_charts.default.height)
.legend({
caption: "Index",
caption: "Get",
series1: "Count",
series2: "Peak",
series3: "Queue",
Expand All @@ -239,7 +239,7 @@ bigdesk_charts.threadpoolIndex = {
return stats.map(function(snapshot){
return {
timestamp: +snapshot.node.timestamp,
value: +snapshot.node.thread_pool.index.active
value: +snapshot.node.thread_pool.get.active
}
})
},
Expand All @@ -248,7 +248,7 @@ bigdesk_charts.threadpoolIndex = {
return stats.map(function(snapshot){
return {
timestamp: +snapshot.node.timestamp,
value: +snapshot.node.thread_pool.index.largest
value: +snapshot.node.thread_pool.get.largest
}
})
},
Expand All @@ -257,19 +257,19 @@ bigdesk_charts.threadpoolIndex = {
return stats.map(function(snapshot){
return {
timestamp: +snapshot.node.timestamp,
value: +snapshot.node.thread_pool.index.queue
value: +snapshot.node.thread_pool.get.queue
}
})
}

}

bigdesk_charts.threadpoolBulk = {
bigdesk_charts.threadpoolWrite = {
chart: function(element) {
return timeSeriesChart()
.width(bigdesk_charts.default.width).height(bigdesk_charts.default.height)
.legend({
caption: "Bulk",
caption: "Write",
series1: "Count",
series2: "Peak",
series3: "Queue",
Expand All @@ -283,7 +283,7 @@ bigdesk_charts.threadpoolBulk = {
return stats.map(function(snapshot){
return {
timestamp: +snapshot.node.timestamp,
value: +snapshot.node.thread_pool.bulk.active
value: +snapshot.node.thread_pool.write.active
}
})
},
Expand All @@ -292,7 +292,7 @@ bigdesk_charts.threadpoolBulk = {
return stats.map(function(snapshot){
return {
timestamp: +snapshot.node.timestamp,
value: +snapshot.node.thread_pool.bulk.largest
value: +snapshot.node.thread_pool.write.largest
}
})
},
Expand All @@ -301,7 +301,7 @@ bigdesk_charts.threadpoolBulk = {
return stats.map(function(snapshot){
return {
timestamp: +snapshot.node.timestamp,
value: +snapshot.node.thread_pool.bulk.queue
value: +snapshot.node.thread_pool.write.queue
}
})
}
Expand Down
46 changes: 23 additions & 23 deletions _site/js/views/SelectedClusterNodeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ var SelectedClusterNodeView = Backbone.View.extend({
var chart_jvmGC = bigdesk_charts.jvmGC.chart(d3.select("#svg_jvmGC"));

var chart_threadpoolSearch = bigdesk_charts.threadpoolSearch.chart(d3.select("#svg_threadpoolSearch"));
var chart_threadpoolIndex = bigdesk_charts.threadpoolIndex.chart(d3.select("#svg_threadpoolIndex"));
var chart_threadpoolBulk = bigdesk_charts.threadpoolBulk.chart(d3.select("#svg_threadpoolBulk"));
var chart_threadpoolGet = bigdesk_charts.threadpoolGet.chart(d3.select("#svg_threadpoolGet"));
var chart_threadpoolWrite = bigdesk_charts.threadpoolWrite.chart(d3.select("#svg_threadpoolWrite"));
var chart_threadpoolRefresh = bigdesk_charts.threadpoolRefresh.chart(d3.select("#svg_threadpoolRefresh"));

var chart_channels = bigdesk_charts.channels.chart(d3.select("#svg_channels"));
Expand Down Expand Up @@ -254,19 +254,19 @@ var SelectedClusterNodeView = Backbone.View.extend({
});

// --------------------------------------------
// Threadpool Index
// Threadpool Get

_.defer(function(){
var threadpool_index_count = bigdesk_charts.threadpoolIndex.series1(stats);
var threadpool_index_peak = bigdesk_charts.threadpoolIndex.series2(stats);
var threadpool_index_queue = bigdesk_charts.threadpoolIndex.series3(stats);
var threadpool_index_count = bigdesk_charts.threadpoolGet.series1(stats);
var threadpool_index_peak = bigdesk_charts.threadpoolGet.series2(stats);
var threadpool_index_queue = bigdesk_charts.threadpoolGet.series3(stats);

try { chart_threadpoolIndex.animate(animatedCharts).update(threadpool_index_count, threadpool_index_peak, threadpool_index_queue); } catch (ignore) {}
try { chart_threadpoolGet.animate(animatedCharts).update(threadpool_index_count, threadpool_index_peak, threadpool_index_queue); } catch (ignore) {}

if (stats_the_latest && stats_the_latest.node) {
$("#tp_index_count").text(stats_the_latest.node.thread_pool.index.active);
$("#tp_index_peak").text(stats_the_latest.node.thread_pool.index.largest);
$("#tp_index_queue").text(stats_the_latest.node.thread_pool.index.queue);
$("#tp_index_count").text(stats_the_latest.node.thread_pool.get.active);
$("#tp_index_peak").text(stats_the_latest.node.thread_pool.get.largest);
$("#tp_index_queue").text(stats_the_latest.node.thread_pool.get.queue);
} else {
$("#tp_index_count").text("n/a");
$("#tp_index_peak").text("n/a");
Expand All @@ -275,19 +275,19 @@ var SelectedClusterNodeView = Backbone.View.extend({
});

// --------------------------------------------
// Threadpool Bulk
// Threadpool Write

_.defer(function(){
var threadpool_bulk_count = bigdesk_charts.threadpoolBulk.series1(stats);
var threadpool_bulk_peak = bigdesk_charts.threadpoolBulk.series2(stats);
var threadpool_bulk_queue = bigdesk_charts.threadpoolBulk.series3(stats);
var threadpool_bulk_count = bigdesk_charts.threadpoolWrite.series1(stats);
var threadpool_bulk_peak = bigdesk_charts.threadpoolWrite.series2(stats);
var threadpool_bulk_queue = bigdesk_charts.threadpoolWrite.series3(stats);

try { chart_threadpoolBulk.animate(animatedCharts).update(threadpool_bulk_count, threadpool_bulk_peak, threadpool_bulk_queue); } catch (ignore) {}
try { chart_threadpoolWrite.animate(animatedCharts).update(threadpool_bulk_count, threadpool_bulk_peak, threadpool_bulk_queue); } catch (ignore) {}

if (stats_the_latest && stats_the_latest.node) {
$("#tp_bulk_count").text(stats_the_latest.node.thread_pool.bulk.active);
$("#tp_bulk_peak").text(stats_the_latest.node.thread_pool.bulk.largest);
$("#tp_bulk_queue").text(stats_the_latest.node.thread_pool.bulk.queue);
$("#tp_bulk_count").text(stats_the_latest.node.thread_pool.write.active);
$("#tp_bulk_peak").text(stats_the_latest.node.thread_pool.write.largest);
$("#tp_bulk_queue").text(stats_the_latest.node.thread_pool.write.queue);
} else {
$("#tp_bulk_count").text("n/a");
$("#tp_bulk_peak").text("n/a");
Expand Down Expand Up @@ -489,7 +489,7 @@ var SelectedClusterNodeView = Backbone.View.extend({

try { chart_indicesGetTime.animate(animatedCharts).update(indices_get_time, indices_missing_time, indices_exists_time); } catch (ignore) {}

$("#indices_get_time").text(stats_the_latest.node.indices.get.get_time);
$("#indices_get_time").text(stats_the_latest.node.indices.get.getTime);
$("#indices_exists_time").text(stats_the_latest.node.indices.get.exists_time);
$("#indices_missing_time").text(stats_the_latest.node.indices.get.missing_time);
}
Expand Down Expand Up @@ -756,26 +756,26 @@ var SelectedClusterNodeView = Backbone.View.extend({
// Threadpool row for charts

var tpSearch = Mustache.render(templates.selectedClusterNode.threadPoolSearch, jsonModel);
var tpIndex = Mustache.render(templates.selectedClusterNode.threadPoolIndex, jsonModel);
var tpIndex = Mustache.render(templates.selectedClusterNode.threadPoolGet, jsonModel);

var tppCharts1 = this.make("p", {},
"<div style='overflow: auto;'>" +
"<svg width='100%' height='160'>" +
"<svg id='svg_threadpoolSearch' clip_id='clip_threadpoolSearch' width='46.5%' height='100%' x='0' y='0' preserveAspectRatio='xMinYMid' viewBox='0 0 270 160'/>" +
"<svg id='svg_threadpoolIndex' clip_id='clip_threadpoolIndex' width='46.5%' height='100%' x='54%' y='0' preserveAspectRatio='xMinYMid' viewBox='0 0 270 160'/>" +
"<svg id='svg_threadpoolGet' clip_id='clip_threadpoolGet' width='46.5%' height='100%' x='54%' y='0' preserveAspectRatio='xMinYMid' viewBox='0 0 270 160'/>" +
"</svg>" +
"<div width='46.5%' style='margin-left: 0%; float: left;'>" + tpSearch + "</div>" +
"<div width='46.5%' style='margin-left: 54%;'>" + tpIndex + "</div>" +
"</div>"
);

var tpBulk = Mustache.render(templates.selectedClusterNode.threadPoolBulk, jsonModel);
var tpBulk = Mustache.render(templates.selectedClusterNode.threadPoolWrite, jsonModel);
var tpRefresh = Mustache.render(templates.selectedClusterNode.threadPoolRefresh, jsonModel);

var tppCharts2 = this.make("p", {},
"<div style='overflow: auto;'>" +
"<svg width='100%' height='160'>" +
"<svg id='svg_threadpoolBulk' clip_id='clip_threadpoolBulk' width='46.5%' height='100%' x='0' y='0' preserveAspectRatio='xMinYMid' viewBox='0 0 270 160'/>" +
"<svg id='svg_threadpoolWrite' clip_id='clip_threadpoolWrite' width='46.5%' height='100%' x='0' y='0' preserveAspectRatio='xMinYMid' viewBox='0 0 270 160'/>" +
"<svg id='svg_threadpoolRefresh' clip_id='clip_threadpoolRefresh' width='46.5%' height='100%' x='54%' y='0' preserveAspectRatio='xMinYMid' viewBox='0 0 270 160'/>" +
"</svg>" +
"<div width='46.5%' style='margin-left: 0%; float: left;'>" + tpBulk + "</div>" +
Expand Down
28 changes: 14 additions & 14 deletions _site/js/views/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,29 @@ var templates = {
"<div>Total count (O/Y): <span id='jvm_gc_count'>n/a</span></div>"
].join(""),

threadPoolSearch: [
threadPoolSearch: [
"<div>Queue: <span id='tp_search_queue'>n/a</span></div>",
"<div>Peak: <span id='tp_search_peak'>n/a</span></div>",
"<div>Peak: <span id='tp_search_peak'>n/a</span></div>",
"<div>Count: <span id='tp_search_count'>n/a</span></div>"
].join(""),
].join(""),

threadPoolIndex: [
threadPoolGet: [
"<div>Queue: <span id='tp_index_queue'>n/a</span></div>",
"<div>Peak: <span id='tp_index_peak'>n/a</span></div>",
"<div>Peak: <span id='tp_index_peak'>n/a</span></div>",
"<div>Count: <span id='tp_index_count'>n/a</span></div>"
].join(""),
].join(""),

threadPoolBulk: [
threadPoolWrite: [
"<div>Queue: <span id='tp_bulk_queue'>n/a</span></div>",
"<div>Peak: <span id='tp_bulk_peak'>n/a</span></div>",
"<div>Peak: <span id='tp_bulk_peak'>n/a</span></div>",
"<div>Count: <span id='tp_bulk_count'>n/a</span></div>"
].join(""),
].join(""),

threadPoolRefresh: [
threadPoolRefresh: [
"<div>Queue: <span id='tp_refresh_queue'>n/a</span></div>",
"<div>Peak: <span id='tp_refresh_peak'>n/a</span></div>",
"<div>Peak: <span id='tp_refresh_peak'>n/a</span></div>",
"<div>Count: <span id='tp_refresh_count'>n/a</span></div>"
].join(""),
].join(""),

osMem: [
"<div>Free: <span id='os_mem_free'>n/a</span></div>",
Expand Down Expand Up @@ -149,15 +149,15 @@ var templates = {
].join("<br>"),

indicesTemplate: [
"Store size: <span id='indices_store_size'>n/a</span>"+
"Store size: <span id='indices_store_size'>n/a</span>"+
"&nbsp;&nbsp;&nbsp;Docs count: <span id='indices_docs_count'>n/a</span>"+
"&nbsp;&nbsp;&nbsp;Docs deleted: <span id='indices_docs_deleted'>n/a</span>"+
"&nbsp;&nbsp;&nbsp;Flush: <span id='indices_flush_total'>n/a</span>"+
"&nbsp;&nbsp;&nbsp;Refresh: <span id='indices_refresh_total'>n/a</span>"
].join("<br>"),

indicesSegments: [
"Shards count: <span id='shards_count'>n/a</span>",
"Shards count: <span id='shards_count'>n/a</span>",
"Segments count: <span id='indices_segments_count'>n/a</span>"
].join("<br>"),

Expand Down
24 changes: 24 additions & 0 deletions _site/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"manifest_version": 2,
"name": "es-bigdesk",
"version": "7.6.1",
"background": {
"scripts": ["background.js"],
"persistent": false
},
"icons": {
"32": "images/favicon.png"
},
"content_security_policy": "script-src 'self' 'sha256-Rpn+rjJuXCjZBPOPhhVloRXuzAUBRnAas+6gKVDohs0=' 'unsafe-eval'; object-src 'self';",
"description": "Chrome Extension containing the excellent ElasticSearch Bigdesk application.",
"browser_action": {
"default_icon": "images/favicon.png" ,
"default_title": "es-bigdesk"
},
"content_scripts":[{
"all_frames": true,
"matches":["*://*/"],
"js":["background.js"],
"run_at": "document_end"
}]
}
Binary file added crx/es-bigdesk.crx
Binary file not shown.

0 comments on commit b5b10fa

Please sign in to comment.