Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Sep 11, 2021
1 parent 4ae0511 commit a1c48fe
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/core/server/metrics/collectors/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { IntervalHistogram } from '../event_loop_delays';
import type { IntervalHistogram } from '../types';

/** Base interface for all metrics gatherers */
export interface MetricsCollector<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/
import moment from 'moment';
import type { IntervalHistogram } from 'kibana/server';
import type { EventLoopDelaysMonitor } from './event_loop_delays_monitor';
import type { IntervalHistogram } from '../types';

function createMockHistogram(overwrites: Partial<IntervalHistogram> = {}): IntervalHistogram {
const now = moment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,7 @@

import type { EventLoopDelayMonitor } from 'perf_hooks';
import { monitorEventLoopDelay } from 'perf_hooks';

/**
* an IntervalHistogram object that samples and reports the event loop delay over time.
* The delays will be reported in nanoseconds.
*/
export interface IntervalHistogram {
fromTimestamp: string;
lastUpdatedAt: string;
min: number;
max: number;
mean: number;
exceeds: number;
stddev: number;
percentiles: {
50: number;
75: number;
95: number;
99: number;
};
}
import type { IntervalHistogram } from '../types';

export class EventLoopDelaysMonitor {
private readonly loopMonitor: EventLoopDelayMonitor;
Expand Down
1 change: 0 additions & 1 deletion src/core/server/metrics/event_loop_delays/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
*/

export { EventLoopDelaysMonitor } from './event_loop_delays_monitor';
export type { IntervalHistogram } from './event_loop_delays_monitor';
2 changes: 1 addition & 1 deletion src/core/server/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export type {
MetricsServiceSetup,
MetricsServiceStart,
OpsMetrics,
IntervalHistogram,
} from './types';
export type { OpsProcessMetrics, OpsServerMetrics, OpsOsMetrics } from './collectors';
export { MetricsService } from './metrics_service';
export { opsConfig } from './ops_config';
export type { OpsConfigType } from './ops_config';
export { EventLoopDelaysMonitor } from './event_loop_delays';
export type { IntervalHistogram } from './event_loop_delays';
34 changes: 34 additions & 0 deletions src/core/server/metrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,37 @@ export interface OpsMetrics {
/** number of current concurrent connections to the server */
concurrent_connections: OpsServerMetrics['concurrent_connections'];
}

/**
* an IntervalHistogram object that samples and reports the event loop delay over time.
* The delays will be reported in nanoseconds.
*
* @public
*/
export interface IntervalHistogram {
// The first timestamp the interval timer kicked in for collecting data points.
fromTimestamp: string;
// Last timestamp the interval timer kicked in for collecting data points.
lastUpdatedAt: string;
// The minimum recorded event loop delay.
min: number;
// The maximum recorded event loop delay.
max: number;
// The mean of the recorded event loop delays.
mean: number;
// The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold.
exceeds: number;
// The standard deviation of the recorded event loop delays.
stddev: number;
// An object detailing the accumulated percentile distribution.
percentiles: {
// 50th percentile of delays of the collected data points.
50: number;
// 75th percentile of delays of the collected data points.
75: number;
// 95th percentile of delays of the collected data points.
95: number;
// 99th percentile of delays of the collected data points.
99: number;
};
}
2 changes: 0 additions & 2 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,6 @@ export interface IKibanaSocket {
}): Promise<void>;
}

// Warning: (ae-missing-release-tag) "IntervalHistogram" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export interface IntervalHistogram {
// (undocumented)
Expand Down

0 comments on commit a1c48fe

Please sign in to comment.