Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up loading by skipping mapping parsing #752

Merged
merged 2 commits into from
Dec 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/dashboards/blank.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"index": {
"interval": "none",
"pattern": "[logstash-]YYYY.MM.DD",
"default": "_all"
"default": "_all",
"warm_fields": false
}
}
55 changes: 4 additions & 51 deletions src/app/dashboards/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,61 +64,14 @@
"index": {
"interval": "none",
"pattern": "[logstash-]YYYY.MM.DD",
"default": "_all"
"default": "_all",
"warm_fields": false
},
"style": "dark",
"failover": false,
"panel_hints": true,
"pulldowns": [
{
"type": "query",
"collapse": true,
"notice": false,
"query": "*",
"pinned": true,
"history": [],
"remember": 10
},
{
"type": "filtering",
"collapse": true,
"notice": false
}
],
"nav": [
{
"type": "timepicker",
"collapse": false,
"notice": false,
"status": "Stable",
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
],
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"timefield": "@timestamp",
"now": true,
"filter_id": 0
}
],
"pulldowns": [],
"nav": [],
"loader": {
"save_gist": false,
"save_elasticsearch": true,
Expand Down
3 changes: 2 additions & 1 deletion src/app/dashboards/guided.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
"index": {
"interval": "none",
"pattern": "[logstash-]YYYY.MM.DD",
"default": "_all"
"default": "_all",
"warm_fields": false
},
"style": "dark",
"failover": false,
Expand Down
3 changes: 2 additions & 1 deletion src/app/dashboards/noted.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"index": {
"interval": "none",
"pattern": "[logstash-]YYYY.MM.DD",
"default": "_all"
"default": "_all",
"warm_fields": false
},
"style": "dark",
"failover": false,
Expand Down
8 changes: 4 additions & 4 deletions src/app/panels/table/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<div class="row-fluid">
<div bindonce ng-class="{'span3':panel.field_list}" ng-if="panel.field_list">
<div class="sidebar-nav">
<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>
<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>
<div class="small">
<span class="link" ng-click="panel.all_fields = true;" ng-class="{strong:panel.all_fields}">
All ({{fields.list.length}})</span><br>
<span class="link" ng-click="panel.all_fields = false;" ng-class="{strong:!panel.all_fields}">
<span class="link small" ng-click="panel.all_fields = true;" ng-if="fields.list.length" ng-class="{strong:panel.all_fields}">
All ({{fields.list.length}})</span> /
<span class="link small" ng-click="panel.all_fields = false;" ng-class="{strong:!panel.all_fields}">
Current ({{current_fields.length || 0}})</span>

</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/panels/timepicker/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ul class="nav nav-pills timepicker-dropdown">
<li class="dropdown">

<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();">
<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();">

<span ng-show="filterSrv.idsByType('time').length">
<span class="pointer" ng-hide="panel.now">{{time.from.date | date:'MMM d, y HH:mm:ss'}}</span>
Expand All @@ -24,7 +24,7 @@
<span class="pointer" ng-hide="panel.now" >{{time.to.date | date:'MMM d, y HH:mm:ss'}}</span>
<span class="pointer" ng-show="panel.now">{{time.to.date | moment:'ago'}}</span>
</span>
<span ng-hide="filterSrv.idsByType('time').length">Set a time filter</span>
<span ng-hide="filterSrv.idsByType('time').length">Time filter</span>
<span ng-show="dashboard.current.refresh" class="text-warning">refreshed every {{dashboard.current.refresh}} </span>
<i class="icon-caret-down"></i>
</a>
Expand Down
4 changes: 4 additions & 0 deletions src/app/partials/dasheditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ <h6>Failover <i class="icon-question-sign" bs-tooltip="'If no indices match the
<h6>Default Index <small ng-show="dashboard.current.index.interval != 'none'">If index not found</small></h6>
<input type="text" class="input-medium" ng-model="dashboard.current.index.default">
</div>
<div class="span2">
<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>
<input type="checkbox" ng-model="dashboard.current.index.warm_fields" ng-checked="dashboard.current.index.warm_fields" />
</div>
</div>
</div>

Expand Down
3 changes: 2 additions & 1 deletion src/app/services/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
index: {
interval: 'none',
pattern: '_all',
default: 'INDEX_MISSING'
default: 'INDEX_MISSING',
warm_fields: true
},
refresh: false
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function (angular, _, config) {
this.fullMapping = {};

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