Skip to content
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
@@ -1,3 +1,4 @@
import { convertToDuration } from "../../../../../../../utils/convertToDuration";
import { getDurationString } from "../../../../../../../utils/getDurationString";
import { roundTo } from "../../../../../../../utils/roundTo";
import { Tag } from "../../../../../../common/v3/Tag";
Expand All @@ -21,7 +22,9 @@ export const SlowEndpointInsightCard = ({
const diff =
(insight.median.raw / insight.endpointsMedianOfMedians.raw - 1) * 100;

const durationString = getDurationString(insight.median);
const slowerByDurationString = getDurationString(
convertToDuration(insight.median.raw - insight.endpointsMedianOfMedians.raw)
);

return (
<InsightCard
Expand All @@ -34,7 +37,10 @@ export const SlowEndpointInsightCard = ({
{roundTo(diff, 2)}%
</s.DescriptionColumn>
<KeyValue label={"Slower by"}>
<Tag content={durationString} title={durationString} />
<Tag
content={slowerByDurationString}
title={slowerByDurationString}
/>
</KeyValue>
</ColumnsContainer>
</s.ContentContainer>
Expand All @@ -45,8 +51,8 @@ export const SlowEndpointInsightCard = ({
isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled}
viewMode={viewMode}
mainMetric={
<Tooltip title={durationString}>
<span>{durationString}</span>
<Tooltip title={slowerByDurationString}>
<span>{slowerByDurationString}</span>
</Tooltip>
}
onDismissalChange={onDismissalChange}
Expand Down
26 changes: 26 additions & 0 deletions src/components/common/icons/16px/SoundWaveIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { useIconProps } from "../hooks";
import type { IconProps } from "../types";

const SoundWaveIconComponent = (props: IconProps) => {
const { size, color } = useIconProps(props);

return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
fill="none"
viewBox="0 0 16 16"
>
<path
stroke={color}
strokeLinecap="round"
strokeLinejoin="round"
d="M1 6.67v2M3.8 4v7.33M6.6 2v12m2.8-8.67V10m2.8-6.67V12M15 6.67v2"
/>
</svg>
);
};

export const SoundWaveIcon = React.memo(SoundWaveIconComponent);
26 changes: 0 additions & 26 deletions src/components/common/icons/16px/TwoHorizontalEndpointsIcon.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/utils/getInsightTypeInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { MemoExoticComponent } from "react";
import * as descriptionProvider from "../components/common/InsightsDescription";
import { PulseIcon } from "../components/common/icons/16px/PulseIcon";
import { TwoHorizontalEndpointsIcon } from "../components/common/icons/16px/TwoHorizontalEndpointsIcon";
import { SoundWaveIcon } from "../components/common/icons/16px/SoundWaveIcon";
import { AlarmClockIcon } from "../components/common/icons/AlarmClockIcon";
import { BottleneckIcon } from "../components/common/icons/BottleneckIcon";
import { ClockWithTicksIcon } from "../components/common/icons/ClockWithTicksIcon";
Expand Down Expand Up @@ -153,7 +153,7 @@ export const getInsightTypeInfo = (
documentationLink: SESSION_IN_VIEW_DOCUMENTATION_URL
},
[InsightType.EndpointChattyApiV2]: {
icon: TwoHorizontalEndpointsIcon,
icon: SoundWaveIcon,
label: "Excessive API Calls Detected",
description: descriptionProvider.ChattyApiDescription,
documentationLink: CHATTY_API_ISSUE_DOCUMENTATION_URL
Expand Down
Loading