kibana/packages/kbn-ci-stats-reporter
Tiago Costa e41569b4a6
fix(NA): wrongly spread stripInternal and rootDir configs across packages (#144463)
* chore(NA): remove overrides for rootDir on packages

* chore(NA): replace './target_types' with 'target_types' on packages

* chore(NA): removes stripInternal false configs

* chore(NA): remove unused strip internals
2022-11-03 01:04:55 +00:00
..
src [API Docs] Add @track-adoption (#138366) 2022-09-07 17:39:31 +02:00
BUILD.bazel [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
index.ts chore(NA): remove src folder requirement from packages (part 2) (#138476) 2022-08-30 15:57:35 +01:00
kibana.jsonc add kibana.jsonc files to existing packages (#138965) 2022-09-08 13:31:57 -07:00
package.json [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
README.md break out parts of @kbn/dev-utils (#130509) 2022-04-19 12:24:58 -05:00
tsconfig.json fix(NA): wrongly spread stripInternal and rootDir configs across packages (#144463) 2022-11-03 01:04:55 +00:00

Kibana CI Stats reporter

We're working on building a new service, the Kibana CI Stats service, which will collect information about CI runs and metrics produced while testing Kibana, and then provide tools for reporting on those metrics in specific PRs and overall as a way to spot trends.

CiStatsReporter

This class integrates with the ciStats.trackBuild {} Jenkins Pipeline function, consuming the KIBANA_CI_STATS_CONFIG variable produced by that wrapper, and then allowing test code to report stats to the service.

To create an instance of the reporter, import the class and call CiStatsReporter.fromEnv(log) (passing it a tooling log).

CiStatsReporter#metrics(metrics: Metric[])

Use this method to record metrics in the Kibana CI Stats service.

interface Metric {
  group: string,
  id: string,
  value: number,
  // optional limit, values which exceed the limit will fail PRs
  limit?: number
  // optional path, relative to the root of the repo, where config values
  // are defined. Will be linked to in PRs which have overages.
  limitConfigPath?: string
}

Example:

import { CiStatsReporter, ToolingLog } from '@kbn/dev-utils';

const log = new ToolingLog(...);
const reporter = CiStatsReporter.fromEnv(log)
reporter.metrics([
  {
    group: 'Build size',
    id: specificBuildName,
    value: sizeOfBuild
  }
])