Skip to content

Commit

Permalink
Merge branch 'master' into unskip-fix-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Mar 11, 2021
2 parents 984e38f + 054da62 commit 0bbbb6b
Show file tree
Hide file tree
Showing 40 changed files with 6,939 additions and 3,109 deletions.
18 changes: 0 additions & 18 deletions api_docs/case.mdx

This file was deleted.

6 changes: 3 additions & 3 deletions api_docs/cases.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "case",
"id": "cases",
"client": {
"classes": [],
"functions": [],
Expand Down Expand Up @@ -34,7 +34,7 @@
{
"pluginId": "cases",
"scope": "server",
"docId": "kibCasePluginApi",
"docId": "kibCasesPluginApi",
"section": "def-server.CasesClient",
"text": "CasesClient"
}
Expand All @@ -60,4 +60,4 @@
"misc": [],
"objects": []
}
}
}
18 changes: 18 additions & 0 deletions api_docs/cases.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: kibCasesPluginApi
slug: /kibana-dev-docs/casesPluginApi
title: cases
image: https://source.unsplash.com/400x175/?github
summary: API docs for the cases plugin
date: 2020-11-16
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---

import casesObj from './cases.json';

## Server

### Interfaces
<DocDefinitionList data={casesObj.server.interfaces}/>

35 changes: 31 additions & 4 deletions api_docs/data_search.json
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,15 @@
"section": "def-server.SearchUsage",
"text": "SearchUsage"
},
" | undefined) => { next(response: ",
" | undefined, { isRestore }: ",
{
"pluginId": "data",
"scope": "common",
"docId": "kibDataSearchPluginApi",
"section": "def-common.ISearchOptions",
"text": "ISearchOptions"
},
") => { next(response: ",
{
"pluginId": "data",
"scope": "common",
Expand All @@ -1459,7 +1467,7 @@
"description": [],
"source": {
"path": "src/plugins/data/server/search/collectors/usage.ts",
"lineNumber": 64
"lineNumber": 83
}
},
{
Expand All @@ -1479,15 +1487,34 @@
"description": [],
"source": {
"path": "src/plugins/data/server/search/collectors/usage.ts",
"lineNumber": 64
"lineNumber": 84
}
},
{
"type": "Object",
"label": "{ isRestore }",
"isRequired": true,
"signature": [
{
"pluginId": "data",
"scope": "common",
"docId": "kibDataSearchPluginApi",
"section": "def-common.ISearchOptions",
"text": "ISearchOptions"
}
],
"description": [],
"source": {
"path": "src/plugins/data/server/search/collectors/usage.ts",
"lineNumber": 85
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "src/plugins/data/server/search/collectors/usage.ts",
"lineNumber": 64
"lineNumber": 82
},
"initialIsOpen": false
},
Expand Down
16 changes: 16 additions & 0 deletions api_docs/lists.json
Original file line number Diff line number Diff line change
Expand Up @@ -4489,6 +4489,22 @@
],
"initialIsOpen": false
},
{
"tags": [],
"id": "def-common.osType",
"type": "Object",
"label": "osType",
"description": [],
"source": {
"path": "x-pack/plugins/lists/common/schemas/common/schemas.ts",
"lineNumber": 317
},
"signature": [
"KeyofC",
"<{ linux: null; macos: null; windows: null; }>"
],
"initialIsOpen": false
},
{
"tags": [],
"id": "def-common.osTypeArray",
Expand Down
8 changes: 4 additions & 4 deletions api_docs/security_solution.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@
"description": [],
"source": {
"path": "x-pack/plugins/security_solution/server/plugin.ts",
"lineNumber": 336
"lineNumber": 337
}
},
{
Expand All @@ -626,15 +626,15 @@
"description": [],
"source": {
"path": "x-pack/plugins/security_solution/server/plugin.ts",
"lineNumber": 336
"lineNumber": 337
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/security_solution/server/plugin.ts",
"lineNumber": 336
"lineNumber": 337
}
},
{
Expand All @@ -650,7 +650,7 @@
"returnComment": [],
"source": {
"path": "x-pack/plugins/security_solution/server/plugin.ts",
"lineNumber": 397
"lineNumber": 398
}
}
],
Expand Down
3 changes: 3 additions & 0 deletions docs/developer/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ running in no time. If you have any problems, file an issue in the https://githu
* <<kibana-architecture>>
* <<advanced>>
* <<plugin-list>>
* <<development-telemetry>>

--

Expand All @@ -29,3 +30,5 @@ include::advanced/index.asciidoc[]

include::plugin-list.asciidoc[]

include::telemetry.asciidoc[]

18 changes: 18 additions & 0 deletions docs/developer/telemetry.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[development-telemetry]]
== Development Telemetry

To help us provide a good developer experience, we track some straightforward metrics when running certain tasks locally and ship them to a service that we run. To disable this functionality, specify `CI_STATS_DISABLED=true` in your environment.

The operations we current report timing data for:

* Total execution time of `yarn kbn bootstrap`

Along with the execution time of each execution, we ship the following information about your machine to the service:

* The `branch` property from the package.json file
* The value of the `data/uuid` file
* https://nodejs.org/docs/latest/api/os.html#os_os_platform[Operating system platform]
* https://nodejs.org/docs/latest/api/os.html#os_os_release[Operating system release]
* https://nodejs.org/docs/latest/api/os.html#os_os_cpus[Count, model, and speed of the CPUs]
* https://nodejs.org/docs/latest/api/os.html#os_os_arch[CPU architecture]
* https://nodejs.org/docs/latest/api/os.html#os_os_totalmem[Total memory] and https://nodejs.org/docs/latest/api/os.html#os_os_freemem[Free memory]
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
| [getTime(indexPattern, timeRange, options)](./kibana-plugin-plugins-data-server.gettime.md) | |
| [parseInterval(interval)](./kibana-plugin-plugins-data-server.parseinterval.md) | |
| [plugin(initializerContext)](./kibana-plugin-plugins-data-server.plugin.md) | Static code to be shared externally |
| [searchUsageObserver(logger, usage)](./kibana-plugin-plugins-data-server.searchusageobserver.md) | Rxjs observer for easily doing <code>tap(searchUsageObserver(logger, usage))</code> in an rxjs chain. |
| [searchUsageObserver(logger, usage, { isRestore })](./kibana-plugin-plugins-data-server.searchusageobserver.md) | Rxjs observer for easily doing <code>tap(searchUsageObserver(logger, usage))</code> in an rxjs chain. |
| [shouldReadFieldFromDocValues(aggregatable, esType)](./kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md) | |
| [usageProvider(core)](./kibana-plugin-plugins-data-server.usageprovider.md) | |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Rxjs observer for easily doing `tap(searchUsageObserver(logger, usage))` in an r
<b>Signature:</b>

```typescript
export declare function searchUsageObserver(logger: Logger, usage?: SearchUsage): {
export declare function searchUsageObserver(logger: Logger, usage?: SearchUsage, { isRestore }?: ISearchOptions): {
next(response: IEsSearchResponse): void;
error(): void;
};
Expand All @@ -21,6 +21,7 @@ export declare function searchUsageObserver(logger: Logger, usage?: SearchUsage)
| --- | --- | --- |
| logger | <code>Logger</code> | |
| usage | <code>SearchUsage</code> | |
| { isRestore } | <code>ISearchOptions</code> | |

<b>Returns:</b>

Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-dev-utils/ci_stats_reporter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "../target/ci_stats_reporter/ci_stats_reporter"
}
52 changes: 52 additions & 0 deletions packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import type { ToolingLog } from '../tooling_log';

export interface Config {
apiToken: string;
buildId: string;
}

function validateConfig(log: ToolingLog, config: { [k in keyof Config]: unknown }) {
const validApiToken = typeof config.apiToken === 'string' && config.apiToken.length !== 0;
if (!validApiToken) {
log.warning('KIBANA_CI_STATS_CONFIG is missing a valid api token, stats will not be reported');
return;
}

const validId = typeof config.buildId === 'string' && config.buildId.length !== 0;
if (!validId) {
log.warning('KIBANA_CI_STATS_CONFIG is missing a valid build id, stats will not be reported');
return;
}

return config as Config;
}

export function parseConfig(log: ToolingLog) {
const configJson = process.env.KIBANA_CI_STATS_CONFIG;
if (!configJson) {
log.debug('KIBANA_CI_STATS_CONFIG environment variable not found, disabling CiStatsReporter');
return;
}

let config: unknown;
try {
config = JSON.parse(configJson);
} catch (_) {
// handled below
}

if (typeof config === 'object' && config !== null) {
return validateConfig(log, config as { [k in keyof Config]: unknown });
}

log.warning('KIBANA_CI_STATS_CONFIG is invalid, stats will not be reported');
return;
}
Loading

0 comments on commit 0bbbb6b

Please sign in to comment.