Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx "Requests Per Connection" chart #4

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
memoryCache,
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
rx,
tx,
hostCount,
Expand Down Expand Up @@ -67,6 +68,7 @@ export const hostLensFormulas = {
memoryCache,
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
rx,
tx,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { nginxActiveConnections, nginxRequestRate } from '../metric_charts/nginx';
import {
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
} from '../metric_charts/nginx';
import type { XYConfig } from '../metric_charts/types';

export const nginxStubstatusMetrics: XYConfig[] = [nginxActiveConnections, nginxRequestRate];
export const nginxStubstatusMetrics: XYConfig[] = [
nginxActiveConnections,
nginxRequestRate,
nginxRequestsPerConnection,
];

export const nginxAccessMetrics: XYConfig[] = []; // TODO
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,18 @@ export const nginxActiveConnections: XYConfig = {
axisLeft: XY_OVERRIDES.axisLeft,
},
};

export const nginxRequestsPerConnection: XYConfig = {
id: 'RequestsPerConnection',
title: i18n.translate('xpack.infra.assetDetails.metricsCharts.nginx.requestsPerConnection', {
defaultMessage: 'Requests Per Connection',
}),

layers: [
{
data: [hostLensFormulas.nginxRequestsPerConnection],
type: 'visualization',
},
],
dataViewOrigin: 'metrics',
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ export { memoryFreeExcludingCache } from './memory_free_excluding_cache';
export { memoryCache } from './memory_cache';
export { nginxRequestRate } from './nginx_request_rate';
export { nginxActiveConnections } from './nginx_active_connections';
export { nginxRequestsPerConnection } from './nginx_requests_per_connection';
export { rx } from './rx';
export { tx } from './tx';
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { FormulaValueConfig } from '@kbn/lens-embeddable-utils';

export const nginxRequestsPerConnection: FormulaValueConfig = {
label: 'Requests Per Connection',
value: 'max(nginx.stubstatus.requests) / max(nginx.stubstatus.handled)',
format: {
id: 'number',
params: {
decimals: 0,
},
},
};