Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into implement/bet…
Browse files Browse the repository at this point in the history
…terWarningForUrlLength
  • Loading branch information
spalger committed Apr 27, 2016
2 parents b333c51 + 929fe36 commit 133d7e5
Show file tree
Hide file tree
Showing 19 changed files with 113 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/bl

- Elasticsearch master
- Kibana binary package
- 512 MB of available RAM

## Installation

Expand All @@ -14,7 +15,6 @@ Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/bl
* Run `bin/kibana` on unix, or `bin\kibana.bat` on Windows.
* Visit [http://localhost:5601](http://localhost:5601)


## Upgrade from previous version

* Move any custom configurations in your old kibana.yml to your new one
Expand Down
5 changes: 5 additions & 0 deletions bin/kibana
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ if [ ! -x "$NODE" ]; then
exit 1
fi

# sets V8 defaults while still allowing them to be overridden
if echo "${@}" | grep -qv "\-\-dev"; then
NODE_OPTIONS="--max-old-space-size=256 $NODE_OPTIONS"
fi

exec "${NODE}" $NODE_OPTIONS "${DIR}/src/cli" ${@}
4 changes: 3 additions & 1 deletion bin/kibana.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ If Not Exist "%NODE%" (
)
)

echo.%* | findstr /V /C:"--dev" && set NODE_OPTIONS=--max-old-space-size=256 %NODE_OPTIONS%

TITLE Kibana Server
"%NODE%" %NODE_OPTIONS% "%DIR%\src\cli" %*
call "%NODE%" %NODE_OPTIONS% "%DIR%\src\cli" %*

:finally

Expand Down
8 changes: 8 additions & 0 deletions docs/production.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* <<enabling-ssl, Enabling SSL>>
* <<controlling-access, Controlling Access>>
* <<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>
* <<memory-management, Memory management>>

How you deploy Kibana largely depends on your use case. If you are the only user,
you can run Kibana on your local machine and configure it to point to whatever
Expand Down Expand Up @@ -132,3 +133,10 @@ cluster.name: "my_cluster"
# The Elasticsearch instance to use for all your queries.
elasticsearch_url: "http://localhost:9200"
--------

[float]
[[memory-management]]

=== Memory management

Kibana is built on Node.js which doesn't tune its heap size based on the amount of memory available. To combat this, we set defaults based on the requirements of Kibana needs, while allowing overhead for additional plugins. These defaults can be overridden at runtime, for example `NODE_OPTIONS="--max-old-space-size=512" bin/kibana`.
1 change: 1 addition & 0 deletions docs/setup.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All you need is:

* Elasticsearch {esversion}
* A modern web browser - http://www.elastic.co/subscriptions/matrix#matrix_browsers[Supported Browsers].
* 512 MB of available RAM
* Information about your Elasticsearch installation:
** URL of the Elasticsearch instance you want to connect to.
** Which Elasticsearch indices you want to search.
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/dashboard/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ dashboard-grid {
.panel-content {
display: flex;
flex: 1 1 100%;
height: auto;
height: 100%;
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/plugins/tests_bundle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ export default (kibana) => {
let config = kibana.config;

const testGlobs = ['src/ui/public/**/*.js'];
const testingPluginId = config.get('tests_bundle.pluginId');
const testingPluginIds = config.get('tests_bundle.pluginId');

if (testingPluginId) {
const plugin = plugins.byId[testingPluginId];
if (!plugin) throw new Error('Invalid testingPluginId :: unknown plugin ' + testingPluginId);
if (testingPluginIds) {
testGlobs.push('!src/ui/public/**/__tests__/**/*');
testingPluginIds.split(',').forEach((pluginId) => {
const plugin = plugins.byId[pluginId];
if (!plugin) throw new Error('Invalid testingPluginId :: unknown plugin ' + pluginId);

// add the modules from all of this plugins apps
for (let app of plugin.apps) {
modules = union(modules, app.getModules());
}
// add the modules from all of this plugins apps
for (let app of plugin.apps) {
modules = union(modules, app.getModules());
}

testGlobs.push(
'!src/ui/public/**/__tests__/**/*',
`${plugin.publicDir}/**/__tests__/**/*.js`
);
testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`);
});
} else {

// add the modules from all of the apps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ body { overflow-x: hidden; }
&.hidden-chrome { left: 0; }
&-panel {
.flex-parent(@shrink: 0);
height: 100%;
box-shadow: -4px 0px 3px rgba(0,0,0,0.2);
}

Expand Down
5 changes: 3 additions & 2 deletions src/ui/public/kbn_top_nav/kbn_top_nav_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ export default function ($compile) {
}

const $childScope = $scope.$new();
const $el = $compile(templateToRender)($childScope);
$element.find('#template_wrapper').html($el);
const $el = $element.find('#template_wrapper').html(templateToRender).contents();
$compile($el)($childScope);

this.rendered = { $childScope, $el, key: currentKey };
}
};
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/styles/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ ul.navbar-inline li {
.flex-parent(@shrink: 0);
position: relative;
z-index: 0;
max-height: 100%;
background-color: @white;
}

Expand Down
1 change: 1 addition & 0 deletions src/ui/public/visualize/visualize.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ visualize {
overflow: auto;
-webkit-transition: opacity 0.01s;
transition: opacity 0.01s;
max-height: 100%;

&.spy-only {
display: none;
Expand Down
19 changes: 14 additions & 5 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ module.exports = function (grunt) {
return flags;
}, []);

const devEnv = Object.assign(process.env, {
NODE_OPTIONS: '--max-old-space-size=1024'
});

return {
testServer: {
options: {
wait: false,
ready: /Server running/,
quiet: false,
failOnError: false
failOnError: false,
env: devEnv
},
cmd: binScript,
args: [
Expand All @@ -46,7 +51,8 @@ module.exports = function (grunt) {
wait: false,
ready: /Server running/,
quiet: false,
failOnError: false
failOnError: false,
env: devEnv
},
cmd: binScript,
args: [
Expand All @@ -64,7 +70,8 @@ module.exports = function (grunt) {
wait: false,
ready: /Server running/,
quiet: false,
failOnError: false
failOnError: false,
env: devEnv
},
cmd: binScript,
args: [
Expand All @@ -80,7 +87,8 @@ module.exports = function (grunt) {
wait: false,
ready: /Server running/,
quiet: false,
failOnError: false
failOnError: false,
env: devEnv
},
cmd: binScript,
args: [
Expand Down Expand Up @@ -148,7 +156,8 @@ module.exports = function (grunt) {
options: {
wait: false,
ready: /Optimization .+ complete/,
quiet: true
quiet: false,
env: devEnv
},
cmd: './build/kibana/bin/kibana',
args: [
Expand Down
4 changes: 2 additions & 2 deletions test/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ define(function (require) {
}
},
timeouts: {
// this is how long a test can run before timing out
default: 90000
default: 90000, // this is how long a test can run before timing out
findTimeout: 10000 // this is how long we try to find elements on page
},
}, serverConfig);
});
20 changes: 19 additions & 1 deletion test/support/pages/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ define(function (require) {
var parse = require('intern/dojo/node!url').parse;
var format = require('intern/dojo/node!url').format;
var path = require('intern/dojo/node!path');
var ShieldPage = require('../../support/pages/shield_page');

var shieldPage;

function injectTimestampQuery(func, url) {
var formatted = modifyQueryString(url, function (parsed) {
Expand Down Expand Up @@ -43,10 +46,11 @@ define(function (require) {
remote.get.wrapper = injectTimestampQuery;
this.remote.getCurrentUrl = _.wrap(this.remote.getCurrentUrl, removeTimestampQuery);
}
shieldPage = new ShieldPage(this.remote);
}


var defaultTimeout = config.timeouts.default;
var defaultTimeout = config.timeouts.findTimeout;

Common.prototype = {
constructor: Common,
Expand Down Expand Up @@ -90,6 +94,20 @@ define(function (require) {
.then(function () {
return self.remote.getCurrentUrl();
})
.then(function (currentUrl) {
var loginPage = new RegExp('login').test(currentUrl);
if (loginPage) {
self.debug('Found loginPage = ' + loginPage + ', username = '
+ config.servers.kibana.shield.username);
return shieldPage.login(config.servers.kibana.shield.username,
config.servers.kibana.shield.password)
.then(function () {
return self.remote.getCurrentUrl();
});
} else {
return currentUrl;
}
})
.then(function (currentUrl) {
currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//');
var navSuccessful = new RegExp(appUrl).test(currentUrl);
Expand Down
2 changes: 1 addition & 1 deletion test/support/pages/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define(function (require) {
var config = require('intern').config;
var Common = require('./common');

var defaultTimeout = config.timeouts.default;
var defaultTimeout = config.timeouts.findTimeout;
var common;
var thisTime;

Expand Down
2 changes: 1 addition & 1 deletion test/support/pages/header_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ define(function (require) {
common = new Common(this.remote);
}

var defaultTimeout = config.timeouts.default;
var defaultTimeout = config.timeouts.findTimeout;

HeaderPage.prototype = {
constructor: HeaderPage,
Expand Down
5 changes: 3 additions & 2 deletions test/support/pages/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function (require) {
var Promise = require('bluebird');
var Common = require('./common');

var defaultTimeout = config.timeouts.default;
var defaultTimeout = config.timeouts.findTimeout;
var common;

function settingsPage(remote) {
Expand Down Expand Up @@ -40,7 +40,8 @@ define(function (require) {
return common.sleep(1000);
})
.then(function setAdvancedSettingsClickPropertyValue(selectList) {
return self.remote.findByCssSelector('option[label="' + propertyValue + '"]')
return self.remote.setFindTimeout(defaultTimeout)
.findByCssSelector('option[label="' + propertyValue + '"]')
.click();
})
.then(function setAdvancedSettingsClickSaveButton() {
Expand Down
35 changes: 35 additions & 0 deletions test/support/pages/shield_page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// in test/support/pages/shield_page.js
define(function (require) {
var config = require('intern').config;
var defaultTimeout = config.timeouts.findTimeout;

// the page object is created as a constructor
// so we can provide the remote Command object
// at runtime
function ShieldPage(remote) {
this.remote = remote;
}

ShieldPage.prototype = {
constructor: ShieldPage,

login: function login(user, pwd) {
var remote = this.remote;
return remote.setFindTimeout(defaultTimeout)
.findById('username')
.type(user)
.then(function () {
return remote.findById('password')
.type(pwd);
})
.then(function () {
return remote.findByCssSelector('.btn')
.click();
});
}


};

return ShieldPage;
});
2 changes: 1 addition & 1 deletion test/support/pages/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function (require) {
var registerSuite = require('intern!object');
var Common = require('./common');

var defaultTimeout = config.timeouts.default;
var defaultTimeout = config.timeouts.findTimeout;
var common;

function VisualizePage(remote) {
Expand Down

0 comments on commit 133d7e5

Please sign in to comment.