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

[Metrics UI] Add inventory view timeline #77804

Merged
merged 23 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b664fa6
Add inventory timeline bottom drawer
Zacqary Sep 8, 2020
067bf74
Remove 'for the selected time'
Zacqary Sep 8, 2020
ba3ae8e
Merge remote-tracking branch 'upstream/master' into 73962-inventory-t…
Zacqary Sep 9, 2020
f3c8899
Add link styling to saved view selector
Zacqary Sep 9, 2020
46085f3
Merge remote-tracking branch 'upstream/master' into 73962-inventory-t…
Zacqary Sep 15, 2020
da4f789
Get timeline chart displaying
Zacqary Sep 16, 2020
ea053a6
Merge remote-tracking branch 'upstream/master' into 73962-inventory-t…
Zacqary Sep 16, 2020
d78d760
Add timeline title and layout resizing
Zacqary Sep 16, 2020
7007df3
Merge remote-tracking branch 'upstream/master' into 73962-inventory-t…
Zacqary Sep 17, 2020
59b3dc0
Add grid lines, prevent loading history when closed
Zacqary Sep 17, 2020
be2136c
Add click-to-jump
Zacqary Sep 17, 2020
4a8991d
Make timeline smaller
Zacqary Sep 17, 2020
e371aeb
i18n fix
Zacqary Sep 17, 2020
b2e9c4c
Shorten error message
Zacqary Sep 17, 2020
82a7ede
Fix typo
Zacqary Sep 17, 2020
01753c3
Remove second timeline route
Zacqary Sep 17, 2020
229716e
i18n dedupe
Zacqary Sep 17, 2020
2582007
Remove unused i18n
Zacqary Sep 17, 2020
ddf25a2
Add telemetry to opening the timeline drawer
Zacqary Sep 18, 2020
5246129
Remove unused i18n
Zacqary Sep 18, 2020
a128904
Merge branch 'master' into 73962-inventory-timeline
elasticmachine Sep 21, 2020
9ae6406
Use ignoreLookback in timeline request
Zacqary Sep 22, 2020
17dde1f
Merge branch '73962-inventory-timeline' of github.com:Zacqary/kibana …
Zacqary Sep 22, 2020
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
2 changes: 1 addition & 1 deletion x-pack/plugins/infra/common/http_api/snapshot_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const SnapshotRequestRT = rt.intersection([
rt.type({
timerange: InfraTimerangeInputRT,
metrics: rt.array(SnapshotMetricInputRT),
groupBy: SnapshotGroupByRT,
groupBy: rt.union([SnapshotGroupByRT, rt.null]),
nodeType: ItemTypeRT,
sourceId: rt.string,
}),
Expand Down
115 changes: 8 additions & 107 deletions x-pack/plugins/infra/common/inventory_models/intl_strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,8 @@
*/

import { i18n } from '@kbn/i18n';
import { SnapshotMetricType } from './types';
export const CPUUsage = i18n.translate('xpack.infra.waffle.metricOptions.cpuUsageText', {
defaultMessage: 'CPU usage',
});

export const MemoryUsage = i18n.translate('xpack.infra.waffle.metricOptions.memoryUsageText', {
defaultMessage: 'Memory usage',
});

export const InboundTraffic = i18n.translate(
'xpack.infra.waffle.metricOptions.inboundTrafficText',
{
defaultMessage: 'Inbound traffic',
}
);

export const OutboundTraffic = i18n.translate(
'xpack.infra.waffle.metricOptions.outboundTrafficText',
{
defaultMessage: 'Outbound traffic',
}
);

export const LogRate = i18n.translate('xpack.infra.waffle.metricOptions.hostLogRateText', {
defaultMessage: 'Log rate',
});

export const Load = i18n.translate('xpack.infra.waffle.metricOptions.loadText', {
defaultMessage: 'Load',
});
import { toMetricOpt } from '../snapshot_metric_i18n';
import { SnapshotMetricType, SnapshotMetricTypeKeys } from './types';

interface Lookup {
[id: string]: string;
Expand Down Expand Up @@ -70,80 +42,9 @@ export const fieldToName = (field: string) => {
return LOOKUP[field] || field;
};

export const SNAPSHOT_METRIC_TRANSLATIONS = {
cpu: i18n.translate('xpack.infra.waffle.metricOptions.cpuUsageText', {
defaultMessage: 'CPU usage',
}),

memory: i18n.translate('xpack.infra.waffle.metricOptions.memoryUsageText', {
defaultMessage: 'Memory usage',
}),

rx: i18n.translate('xpack.infra.waffle.metricOptions.inboundTrafficText', {
defaultMessage: 'Inbound traffic',
}),

tx: i18n.translate('xpack.infra.waffle.metricOptions.outboundTrafficText', {
defaultMessage: 'Outbound traffic',
}),

logRate: i18n.translate('xpack.infra.waffle.metricOptions.hostLogRateText', {
defaultMessage: 'Log rate',
}),

load: i18n.translate('xpack.infra.waffle.metricOptions.loadText', {
defaultMessage: 'Load',
}),

count: i18n.translate('xpack.infra.waffle.metricOptions.countText', {
defaultMessage: 'Count',
}),
diskIOReadBytes: i18n.translate('xpack.infra.waffle.metricOptions.diskIOReadBytes', {
defaultMessage: 'Disk Reads',
}),
diskIOWriteBytes: i18n.translate('xpack.infra.waffle.metricOptions.diskIOWriteBytes', {
defaultMessage: 'Disk Writes',
}),
s3BucketSize: i18n.translate('xpack.infra.waffle.metricOptions.s3BucketSize', {
defaultMessage: 'Bucket Size',
}),
s3TotalRequests: i18n.translate('xpack.infra.waffle.metricOptions.s3TotalRequests', {
defaultMessage: 'Total Requests',
}),
s3NumberOfObjects: i18n.translate('xpack.infra.waffle.metricOptions.s3NumberOfObjects', {
defaultMessage: 'Number of Objects',
}),
s3DownloadBytes: i18n.translate('xpack.infra.waffle.metricOptions.s3DownloadBytes', {
defaultMessage: 'Downloads (Bytes)',
}),
s3UploadBytes: i18n.translate('xpack.infra.waffle.metricOptions.s3UploadBytes', {
defaultMessage: 'Uploads (Bytes)',
}),
rdsConnections: i18n.translate('xpack.infra.waffle.metricOptions.rdsConnections', {
defaultMessage: 'Connections',
}),
rdsQueriesExecuted: i18n.translate('xpack.infra.waffle.metricOptions.rdsQueriesExecuted', {
defaultMessage: 'Queries Executed',
}),
rdsActiveTransactions: i18n.translate('xpack.infra.waffle.metricOptions.rdsActiveTransactions', {
defaultMessage: 'Active Transactions',
}),
rdsLatency: i18n.translate('xpack.infra.waffle.metricOptions.rdsLatency', {
defaultMessage: 'Latency',
}),
sqsMessagesVisible: i18n.translate('xpack.infra.waffle.metricOptions.sqsMessagesVisible', {
defaultMessage: 'Messages Available',
}),
sqsMessagesDelayed: i18n.translate('xpack.infra.waffle.metricOptions.sqsMessagesDelayed', {
defaultMessage: 'Messages Delayed',
}),
sqsMessagesSent: i18n.translate('xpack.infra.waffle.metricOptions.sqsMessagesSent', {
defaultMessage: 'Messages Added',
}),
sqsMessagesEmpty: i18n.translate('xpack.infra.waffle.metricOptions.sqsMessagesEmpty', {
defaultMessage: 'Messages Returned Empty',
}),
sqsOldestMessage: i18n.translate('xpack.infra.waffle.metricOptions.sqsOldestMessage', {
defaultMessage: 'Oldest Message',
}),
} as Record<SnapshotMetricType, string>;
const snapshotTypeKeys = Object.keys(SnapshotMetricTypeKeys) as SnapshotMetricType[];
export const SNAPSHOT_METRIC_TRANSLATIONS = snapshotTypeKeys.reduce((result, metric) => {
const text = toMetricOpt(metric)?.text;
if (text) return { ...result, [metric]: text };
return result;
}, {}) as Record<SnapshotMetricType, string>;
5 changes: 3 additions & 2 deletions x-pack/plugins/infra/common/inventory_models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export const ESAggregationRT = rt.union([
export const MetricsUIAggregationRT = rt.record(rt.string, ESAggregationRT);
export type MetricsUIAggregation = rt.TypeOf<typeof MetricsUIAggregationRT>;

export const SnapshotMetricTypeRT = rt.keyof({
export const SnapshotMetricTypeKeys = {
count: null,
cpu: null,
load: null,
Expand All @@ -339,7 +339,8 @@ export const SnapshotMetricTypeRT = rt.keyof({
sqsMessagesEmpty: null,
sqsOldestMessage: null,
custom: null,
});
};
export const SnapshotMetricTypeRT = rt.keyof(SnapshotMetricTypeKeys);

export type SnapshotMetricType = rt.TypeOf<typeof SnapshotMetricTypeRT>;

Expand Down
Loading