Skip to content

Commit 0cdf5a5

Browse files
committed
use human formats
1 parent f5dc9d1 commit 0cdf5a5

8 files changed

Lines changed: 32 additions & 11 deletions

File tree

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/field_formats.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
LCP_FIELD,
1313
TBT_FIELD,
1414
TRANSACTION_DURATION,
15+
TRANSACTION_TIME_TO_FIRST_BYTE,
1516
} from '../constants/elasticsearch_fieldnames';
1617

1718
export const rumFieldFormats: FieldFormat[] = [
@@ -24,6 +25,7 @@ export const rumFieldFormats: FieldFormat[] = [
2425
outputFormat: 'asSeconds',
2526
showSuffix: true,
2627
outputPrecision: 1,
28+
useShortSuffix: true,
2729
},
2830
},
2931
},
@@ -33,8 +35,9 @@ export const rumFieldFormats: FieldFormat[] = [
3335
id: 'duration',
3436
params: {
3537
inputFormat: 'milliseconds',
36-
outputFormat: 'asSeconds',
38+
outputFormat: 'humanizePrecise',
3739
showSuffix: true,
40+
useShortSuffix: true,
3841
},
3942
},
4043
},
@@ -44,8 +47,9 @@ export const rumFieldFormats: FieldFormat[] = [
4447
id: 'duration',
4548
params: {
4649
inputFormat: 'milliseconds',
47-
outputFormat: 'asSeconds',
50+
outputFormat: 'humanizePrecise',
4851
showSuffix: true,
52+
useShortSuffix: true,
4953
},
5054
},
5155
},
@@ -55,8 +59,9 @@ export const rumFieldFormats: FieldFormat[] = [
5559
id: 'duration',
5660
params: {
5761
inputFormat: 'milliseconds',
58-
outputFormat: 'asSeconds',
62+
outputFormat: 'humanizePrecise',
5963
showSuffix: true,
64+
useShortSuffix: true,
6065
},
6166
},
6267
},
@@ -66,8 +71,21 @@ export const rumFieldFormats: FieldFormat[] = [
6671
id: 'duration',
6772
params: {
6873
inputFormat: 'milliseconds',
69-
outputFormat: 'asSeconds',
74+
outputFormat: 'humanizePrecise',
75+
showSuffix: true,
76+
useShortSuffix: true,
77+
},
78+
},
79+
},
80+
{
81+
field: TRANSACTION_TIME_TO_FIRST_BYTE,
82+
format: {
83+
id: 'duration',
84+
params: {
85+
inputFormat: 'milliseconds',
86+
outputFormat: 'humanizePrecise',
7087
showSuffix: true,
88+
useShortSuffix: true,
7189
},
7290
},
7391
},

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/kpi_trends_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function getKPITrendsLensConfig({ seriesId, indexPattern }: ConfigProps):
4444
id: seriesId,
4545
defaultSeriesType: 'bar_stacked',
4646
reportType: 'kpi-trends',
47-
seriesTypes: ['bar', 'bar_stacked'],
47+
seriesTypes: [],
4848
xAxisColumn: {
4949
sourceField: '@timestamp',
5050
},

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/performance_dist_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function getPerformanceDistLensConfig({ seriesId, indexPattern }: ConfigP
4444
id: seriesId ?? 'unique-key',
4545
reportType: 'page-load-dist',
4646
defaultSeriesType: 'line',
47-
seriesTypes: ['line', 'bar'],
47+
seriesTypes: [],
4848
xAxisColumn: {
4949
sourceField: 'performance.metric',
5050
},

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/field_formats.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ export const syntheticsFieldFormats: FieldFormat[] = [
1414
id: 'duration',
1515
params: {
1616
inputFormat: 'microseconds',
17-
outputFormat: 'asMilliseconds',
18-
outputPrecision: 0,
17+
outputFormat: 'humanizePrecise',
18+
outputPrecision: 1,
1919
showSuffix: true,
20+
useShortSuffix: true,
2021
},
2122
},
2223
},

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/monitor_duration_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function getMonitorDurationConfig({ seriesId, indexPattern }: ConfigProps
1515
id: seriesId,
1616
reportType: 'uptime-duration',
1717
defaultSeriesType: 'line',
18-
seriesTypes: ['line', 'bar_stacked'],
18+
seriesTypes: [],
1919
xAxisColumn: {
2020
sourceField: '@timestamp',
2121
},

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/synthetics/monitor_pings_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function getMonitorPingsConfig({ seriesId, indexPattern }: ConfigProps):
1515
id: seriesId,
1616
reportType: 'uptime-pings',
1717
defaultSeriesType: 'bar_stacked',
18-
seriesTypes: ['bar_stacked', 'bar'],
18+
seriesTypes: [],
1919
xAxisColumn: {
2020
sourceField: '@timestamp',
2121
},

x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,14 @@ export type AppDataType = 'synthetics' | 'ux' | 'infra_logs' | 'infra_metrics' |
108108

109109
type FormatType = 'duration' | 'number';
110110
type InputFormat = 'microseconds' | 'milliseconds' | 'seconds';
111-
type OutputFormat = 'asSeconds' | 'asMilliseconds' | 'humanize';
111+
type OutputFormat = 'asSeconds' | 'asMilliseconds' | 'humanize' | 'humanizePrecise';
112112

113113
export interface FieldFormatParams {
114114
inputFormat: InputFormat;
115115
outputFormat: OutputFormat;
116116
outputPrecision?: number;
117117
showSuffix?: boolean;
118+
useShortSuffix?: boolean;
118119
}
119120

120121
export interface FieldFormat {

x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function isParamsSame(param1: IFieldFormat['_params'], param2: FieldForma
6060
const isSame =
6161
param1?.inputFormat === param2?.inputFormat &&
6262
param1?.outputFormat === param2?.outputFormat &&
63+
param1?.useShortSuffix === param2?.useShortSuffix &&
6364
param1?.showSuffix === param2?.showSuffix;
6465

6566
if (param2.outputPrecision !== undefined) {

0 commit comments

Comments
 (0)