Skip to content

Commit

Permalink
enhancements for 7.14
Browse files Browse the repository at this point in the history
- added 7.14 as the top-level version
- changed running alerts at 1m interval, to 3s interval; similar
change to decrease the number of rules we actually create;
thinking is, we can simulate more alerts by running them at a
smaller interval
- increased wait for deployments to finish creation from 5 minutes to 10
- changed how kibana config is set (change to ecctl data shape)
  • Loading branch information
pmuellr committed Aug 9, 2021
2 parents b098672 + 5ee7c19 commit d7b92d4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async function run({ config, minutes, percentFiring }, [ suiteId ]) {
])
}, logger)

logger.log(`TBD ... creating input indices`)
// logger.log(`TBD ... creating input indices`)

logger.log(`creating alerts and actions`)
const queues = deployments.map(async deployment => {
Expand Down
4 changes: 3 additions & 1 deletion lib/deployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const ecCommands = require('./ec-commands')
const { splitX, delay } = require('./utils')

const DeploymentPrefix = '💪KAL-'
const DeployWaitMinutes = 10
const DeployWaitMillis = DeployWaitMinutes * 60 * 1000

module.exports = {
createDeployment,
Expand Down Expand Up @@ -82,7 +84,7 @@ class DeploymentImpl {
}

/** @type { (config: string, id: string, name: string, wait: number, interval: number) => Promise<GetDeploymentResult> } */
async function waitForHealthyDeployment(config, id, name, wait = 1000 * 60 * 5, interval = 10000) {
async function waitForHealthyDeployment(config, id, name, wait = DeployWaitMillis, interval = 10000) {
if (wait <= 0) throw new Error(`timeout waiting for ${name} to become healthy`)

const info = await ecCommands.getDeployment({ config, name, id })
Expand Down
11 changes: 5 additions & 6 deletions lib/ec-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,13 @@ async function fixDeploymentCreatePayload(payload, config, { esSize, kbSize, tmM
// Kibana fix ups
for (const kibana of payload.resources.kibana) {
// set Kibana config overrides
/** @type { Record<string, any> } */
const configOverridesJSON = {}
if (tmMaxWorkers !== 10) configOverridesJSON['xpack.task_manager.max_workers'] = tmMaxWorkers
if (tmPollInterval !== 3000) configOverridesJSON['xpack.task_manager.poll_interval'] = tmPollInterval
let configOverridesYaml = ''
if (tmMaxWorkers !== 10) configOverridesYaml += `\nxpack.task_manager.max_workers: ${tmMaxWorkers}`
if (tmPollInterval !== 3000) configOverridesYaml += `\nxpack.task_manager.poll_interval: ${tmPollInterval}`

if (Object.keys(configOverridesJSON).length !== 0) {
if (configOverridesYaml.length > 0) {
payload.resources.kibana.forEach(kibana => {
kibana.plan.kibana.user_settings_override_json = configOverridesJSON
kibana.plan.kibana.user_settings_yaml = configOverridesYaml
})
}

Expand Down
2 changes: 1 addition & 1 deletion lib/kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function createAlert(kbUrl, name, inputIndex, firing = false, actions = []
name,
alertTypeId,
consumer: 'alerts',
schedule: { interval: '1m' },
schedule: { interval: '3s' },
actions,
params: {
index: '.kibana-event-log*',
Expand Down
2 changes: 1 addition & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ interface DeploymentCreatePlan {
id: string
}
kibana?: {
user_settings_override_json?: Record<string, number>
user_settings_yaml?: string
}
}

Expand Down
16 changes: 9 additions & 7 deletions suites.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
/** @typedef { import('./lib/types').Suite } Suite */
/** @typedef { import('./lib/types').Scenario } Scenario */

const AlertInterval = '5s'

const Versions = [
// '7.14.0',
'7.14.0',
'7.13.3',
'7.12.1',
'7.11.2',
Expand All @@ -14,7 +16,7 @@ const Versions = [
]
const Version = Versions[0]

const AlertsList = [100, 500, 1000, 2000, 4000]
const AlertsList = [10, 50, 100, 200, 400]

/** @type { Suite[] } */
const suites = module.exports = []
Expand All @@ -41,7 +43,7 @@ function suiteKibanaSizes(alerts) {

const scenarios = sizes.map((size, index) => ({
name: `kb: ${size.kbSpec}; es: ${size.esSpec}`,
alertInterval: '1m',
alertInterval: AlertInterval,
alerts,
esSpec: size.esSpec,
kbSpec: size.kbSpec,
Expand All @@ -64,7 +66,7 @@ function suiteTmMaxWorkers(alerts) {
const scenarios = tmMaxWorkersList.map((tmMaxWorkers, index) => {
return {
name: `tm max workers: ${tmMaxWorkers}`,
alertInterval: '1m',
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
Expand All @@ -88,7 +90,7 @@ function suiteTmPollInterval(alerts) {
const scenarios = tmPollIntervalList.map((tmPollInterval, index) => {
return {
name: `tm poll interval: ${tmPollInterval}`,
alertInterval: '1m',
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
Expand All @@ -110,7 +112,7 @@ function suiteVersions(alerts) {
const scenarios = Versions.map((version, index) => {
return {
name: `stack version: ${version}`,
alertInterval: '1m',
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
Expand All @@ -132,7 +134,7 @@ function suiteAlerts() {
const scenarios = AlertsList.slice(0, 4).map((alerts, index) => {
return {
name: `alerts: ${alerts}`,
alertInterval: '1m',
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
Expand Down

0 comments on commit d7b92d4

Please sign in to comment.