[Exploratory View] Use human readable formats (#101520)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9bcae4d9cb
commit
724ca2d896
|
@ -12,6 +12,7 @@ import {
|
|||
LCP_FIELD,
|
||||
TBT_FIELD,
|
||||
TRANSACTION_DURATION,
|
||||
TRANSACTION_TIME_TO_FIRST_BYTE,
|
||||
} from '../constants/elasticsearch_fieldnames';
|
||||
|
||||
export const rumFieldFormats: FieldFormat[] = [
|
||||
|
@ -24,6 +25,7 @@ export const rumFieldFormats: FieldFormat[] = [
|
|||
outputFormat: 'asSeconds',
|
||||
showSuffix: true,
|
||||
outputPrecision: 1,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -33,8 +35,9 @@ export const rumFieldFormats: FieldFormat[] = [
|
|||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'asSeconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -44,8 +47,9 @@ export const rumFieldFormats: FieldFormat[] = [
|
|||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'asSeconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -55,8 +59,9 @@ export const rumFieldFormats: FieldFormat[] = [
|
|||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'asSeconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -66,8 +71,21 @@ export const rumFieldFormats: FieldFormat[] = [
|
|||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'asSeconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: TRANSACTION_TIME_TO_FIRST_BYTE,
|
||||
format: {
|
||||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -44,7 +44,7 @@ export function getKPITrendsLensConfig({ seriesId, indexPattern }: ConfigProps):
|
|||
id: seriesId,
|
||||
defaultSeriesType: 'bar_stacked',
|
||||
reportType: 'kpi-trends',
|
||||
seriesTypes: ['bar', 'bar_stacked'],
|
||||
seriesTypes: [],
|
||||
xAxisColumn: {
|
||||
sourceField: '@timestamp',
|
||||
},
|
||||
|
|
|
@ -44,7 +44,7 @@ export function getPerformanceDistLensConfig({ seriesId, indexPattern }: ConfigP
|
|||
id: seriesId ?? 'unique-key',
|
||||
reportType: 'page-load-dist',
|
||||
defaultSeriesType: 'line',
|
||||
seriesTypes: ['line', 'bar'],
|
||||
seriesTypes: [],
|
||||
xAxisColumn: {
|
||||
sourceField: 'performance.metric',
|
||||
},
|
||||
|
|
|
@ -14,9 +14,10 @@ export const syntheticsFieldFormats: FieldFormat[] = [
|
|||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'microseconds',
|
||||
outputFormat: 'asMilliseconds',
|
||||
outputPrecision: 0,
|
||||
outputFormat: 'humanizePrecise',
|
||||
outputPrecision: 1,
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@ export function getMonitorDurationConfig({ seriesId, indexPattern }: ConfigProps
|
|||
id: seriesId,
|
||||
reportType: 'uptime-duration',
|
||||
defaultSeriesType: 'line',
|
||||
seriesTypes: ['line', 'bar_stacked'],
|
||||
seriesTypes: [],
|
||||
xAxisColumn: {
|
||||
sourceField: '@timestamp',
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@ export function getMonitorPingsConfig({ seriesId, indexPattern }: ConfigProps):
|
|||
id: seriesId,
|
||||
reportType: 'uptime-pings',
|
||||
defaultSeriesType: 'bar_stacked',
|
||||
seriesTypes: ['bar_stacked', 'bar'],
|
||||
seriesTypes: [],
|
||||
xAxisColumn: {
|
||||
sourceField: '@timestamp',
|
||||
},
|
||||
|
|
|
@ -108,13 +108,14 @@ export type AppDataType = 'synthetics' | 'ux' | 'infra_logs' | 'infra_metrics' |
|
|||
|
||||
type FormatType = 'duration' | 'number';
|
||||
type InputFormat = 'microseconds' | 'milliseconds' | 'seconds';
|
||||
type OutputFormat = 'asSeconds' | 'asMilliseconds' | 'humanize';
|
||||
type OutputFormat = 'asSeconds' | 'asMilliseconds' | 'humanize' | 'humanizePrecise';
|
||||
|
||||
export interface FieldFormatParams {
|
||||
inputFormat: InputFormat;
|
||||
outputFormat: OutputFormat;
|
||||
outputPrecision?: number;
|
||||
showSuffix?: boolean;
|
||||
useShortSuffix?: boolean;
|
||||
}
|
||||
|
||||
export interface FieldFormat {
|
||||
|
|
|
@ -17,23 +17,53 @@ const fieldFormats = {
|
|||
outputFormat: 'asSeconds',
|
||||
outputPrecision: 1,
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
'transaction.experience.fid': {
|
||||
id: 'duration',
|
||||
params: { inputFormat: 'milliseconds', outputFormat: 'asSeconds', showSuffix: true },
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
'transaction.experience.tbt': {
|
||||
id: 'duration',
|
||||
params: { inputFormat: 'milliseconds', outputFormat: 'asSeconds', showSuffix: true },
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
'transaction.marks.agent.firstContentfulPaint': {
|
||||
id: 'duration',
|
||||
params: { inputFormat: 'milliseconds', outputFormat: 'asSeconds', showSuffix: true },
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
'transaction.marks.agent.largestContentfulPaint': {
|
||||
id: 'duration',
|
||||
params: { inputFormat: 'milliseconds', outputFormat: 'asSeconds', showSuffix: true },
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
'transaction.marks.agent.timeToFirstByte': {
|
||||
id: 'duration',
|
||||
params: {
|
||||
inputFormat: 'milliseconds',
|
||||
outputFormat: 'humanizePrecise',
|
||||
showSuffix: true,
|
||||
useShortSuffix: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ export function isParamsSame(param1: IFieldFormat['_params'], param2: FieldForma
|
|||
const isSame =
|
||||
param1?.inputFormat === param2?.inputFormat &&
|
||||
param1?.outputFormat === param2?.outputFormat &&
|
||||
param1?.useShortSuffix === param2?.useShortSuffix &&
|
||||
param1?.showSuffix === param2?.showSuffix;
|
||||
|
||||
if (param2.outputPrecision !== undefined) {
|
||||
|
|
Loading…
Reference in a new issue