Skip to content

[APM] Transaction duration chart always shows duration in ms #42002

@sorenlouv

Description

@sorenlouv

The transaction duration chart used to convert the duration to the appropriate unit (microsecond, millisecond, second) depending on the value. That no longer happens, so the chart is very hard to read for very high and very small values

Very high value which should be converted to minutes

Screen Shot 2019-07-25 at 17.58.33.png

Very small value that should be converted to microseconds

Screen Shot 2019-07-25 at 18.02.40.png

One way to fix this (and there may well be other better ways)

getResponseTimeTickFormatter is hardcoded to use asMillis:

public getResponseTimeTickFormatter = (t: number) => {
return asMillis(t);
};

Instead it should use a dynamic time formatter. This time formatted can be retrieved with getTimeFormatter:

export const getTimeFormatter: TimeFormatter = memoize((max: number) => {

On the surface the following seems like the easiest solution:

  // ❗don't do this
  public getResponseTimeTickFormatter = (t: number) => {
    // This will get a new formatter for each tick. So the tick marks could change units from tick to tick. We want the same unit for all ticks. 
    return asTime(t);
  };

A better solution is therefore:

  const maxY = getMaxY(this.props.responseTimeSeries);
  const formatter  = getTimeFormatter(maxY);
  ...

  public getResponseTimeTickFormatter = (t: number) => {
    return formatter(t);
  };

Note #41640 is adding support for displaying high durations in minutes or hours but did not cause this neither is fixing it.

Metadata

Metadata

Labels

Team:APM - DEPRECATEDUse Team:obs-ux-infra_services.bugFixes for quality problems that affect the customer experiencegood first issuelow hanging fruit

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions