Skip to content

Commit 3a50be4

Browse files
author
Rashid Khan
committed
Merge pull request #752 from rashidkpc/master
Speed up loading by skipping mapping parsing
2 parents 0efdd46 + f4cc564 commit 3a50be4

File tree

9 files changed

+23
-62
lines changed

9 files changed

+23
-62
lines changed

src/app/dashboards/blank.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"index": {
2727
"interval": "none",
2828
"pattern": "[logstash-]YYYY.MM.DD",
29-
"default": "_all"
29+
"default": "_all",
30+
"warm_fields": false
3031
}
3132
}

src/app/dashboards/default.json

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -64,61 +64,14 @@
6464
"index": {
6565
"interval": "none",
6666
"pattern": "[logstash-]YYYY.MM.DD",
67-
"default": "_all"
67+
"default": "_all",
68+
"warm_fields": false
6869
},
6970
"style": "dark",
7071
"failover": false,
7172
"panel_hints": true,
72-
"pulldowns": [
73-
{
74-
"type": "query",
75-
"collapse": true,
76-
"notice": false,
77-
"query": "*",
78-
"pinned": true,
79-
"history": [],
80-
"remember": 10
81-
},
82-
{
83-
"type": "filtering",
84-
"collapse": true,
85-
"notice": false
86-
}
87-
],
88-
"nav": [
89-
{
90-
"type": "timepicker",
91-
"collapse": false,
92-
"notice": false,
93-
"status": "Stable",
94-
"time_options": [
95-
"5m",
96-
"15m",
97-
"1h",
98-
"6h",
99-
"12h",
100-
"24h",
101-
"2d",
102-
"7d",
103-
"30d"
104-
],
105-
"refresh_intervals": [
106-
"5s",
107-
"10s",
108-
"30s",
109-
"1m",
110-
"5m",
111-
"15m",
112-
"30m",
113-
"1h",
114-
"2h",
115-
"1d"
116-
],
117-
"timefield": "@timestamp",
118-
"now": true,
119-
"filter_id": 0
120-
}
121-
],
73+
"pulldowns": [],
74+
"nav": [],
12275
"loader": {
12376
"save_gist": false,
12477
"save_elasticsearch": true,

src/app/dashboards/guided.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@
200200
"index": {
201201
"interval": "none",
202202
"pattern": "[logstash-]YYYY.MM.DD",
203-
"default": "_all"
203+
"default": "_all",
204+
"warm_fields": false
204205
},
205206
"style": "dark",
206207
"failover": false,

src/app/dashboards/noted.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
"index": {
9090
"interval": "none",
9191
"pattern": "[logstash-]YYYY.MM.DD",
92-
"default": "_all"
92+
"default": "_all",
93+
"warm_fields": false
9394
},
9495
"style": "dark",
9596
"failover": false,

src/app/panels/table/module.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<div class="row-fluid">
1111
<div bindonce ng-class="{'span3':panel.field_list}" ng-if="panel.field_list">
1212
<div class="sidebar-nav">
13-
<strong>Fields <i class=" icon-chevron-sign-left pointer " ng-click="panel.field_list = !panel.field_list" bs-tooltip="'Hide field list'" ng-show="panel.field_list"></i></strong><p>
13+
<strong>Fields <i class=" icon-chevron-sign-left pointer " ng-click="panel.field_list = !panel.field_list" bs-tooltip="'Hide field list'"></i></strong><p>
1414
<div class="small">
15-
<span class="link" ng-click="panel.all_fields = true;" ng-class="{strong:panel.all_fields}">
16-
All ({{fields.list.length}})</span><br>
17-
<span class="link" ng-click="panel.all_fields = false;" ng-class="{strong:!panel.all_fields}">
15+
<span class="link small" ng-click="panel.all_fields = true;" ng-if="fields.list.length" ng-class="{strong:panel.all_fields}">
16+
All ({{fields.list.length}})</span> /
17+
<span class="link small" ng-click="panel.all_fields = false;" ng-class="{strong:!panel.all_fields}">
1818
Current ({{current_fields.length || 0}})</span>
1919

2020
</div>

src/app/panels/timepicker/module.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ul class="nav nav-pills timepicker-dropdown">
1616
<li class="dropdown">
1717

18-
<a class="dropdown-toggle timepicker-dropdown" data-toggle="dropdown" href="" bs-tooltip="(time.from.date | date:'yyyy-MM-dd HH:mm:ss.sss') + ' <br>to<br>' +(time.to.date | date:'yyyy-MM-dd HH:mm:ss.sss')" data-placement="bottom" ng-click="dismiss();">
18+
<a class="dropdown-toggle timepicker-dropdown" data-toggle="dropdown" href="" bs-tooltip="time.from.date ? (time.from.date | date:'yyyy-MM-dd HH:mm:ss.sss') + ' <br>to<br>' +(time.to.date | date:'yyyy-MM-dd HH:mm:ss.sss') : 'Click to set a time filter'" data-placement="bottom" ng-click="dismiss();">
1919

2020
<span ng-show="filterSrv.idsByType('time').length">
2121
<span class="pointer" ng-hide="panel.now">{{time.from.date | date:'MMM d, y HH:mm:ss'}}</span>
@@ -24,7 +24,7 @@
2424
<span class="pointer" ng-hide="panel.now" >{{time.to.date | date:'MMM d, y HH:mm:ss'}}</span>
2525
<span class="pointer" ng-show="panel.now">{{time.to.date | moment:'ago'}}</span>
2626
</span>
27-
<span ng-hide="filterSrv.idsByType('time').length">Set a time filter</span>
27+
<span ng-hide="filterSrv.idsByType('time').length">Time filter</span>
2828
<span ng-show="dashboard.current.refresh" class="text-warning">refreshed every {{dashboard.current.refresh}} </span>
2929
<i class="icon-caret-down"></i>
3030
</a>

src/app/partials/dasheditor.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ <h6>Failover <i class="icon-question-sign" bs-tooltip="'If no indices match the
6262
<h6>Default Index <small ng-show="dashboard.current.index.interval != 'none'">If index not found</small></h6>
6363
<input type="text" class="input-medium" ng-model="dashboard.current.index.default">
6464
</div>
65+
<div class="span2">
66+
<h6>Preload Fields <i class="icon-question-sign" bs-tooltip="'Preload available fields for the purpose of autocomplete. Turn this off if you have many fields'"></i></h6>
67+
<input type="checkbox" ng-model="dashboard.current.index.warm_fields" ng-checked="dashboard.current.index.warm_fields" />
68+
</div>
6569
</div>
6670
</div>
6771

src/app/services/dashboard.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
5757
index: {
5858
interval: 'none',
5959
pattern: '_all',
60-
default: 'INDEX_MISSING'
60+
default: 'INDEX_MISSING',
61+
warm_fields: true
6162
},
6263
refresh: false
6364
};

src/app/services/fields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function (angular, _, config) {
1717
this.fullMapping = {};
1818

1919
$rootScope.$watch(function(){return dashboard.indices;},function(n) {
20-
if(!_.isUndefined(n) && n.length) {
20+
if(!_.isUndefined(n) && n.length && dashboard.current.index.warm_fields) {
2121
// Only get the mapping for indices we don't know it for
2222
var indices = _.difference(n,_.keys(self.fullMapping));
2323
// Only get the mapping if there are new indices

0 commit comments

Comments
 (0)