From 44b861196b5f7f193738b7be9a9977866c3ffdab Mon Sep 17 00:00:00 2001 From: olehp Date: Wed, 28 Feb 2024 20:57:54 +0200 Subject: [PATCH 1/4] EndpointSlowdownSourceInsight --- src/components/Insights/typeGuards.ts | 7 +++++++ src/components/Insights/types.ts | 23 +++++++++++++++++++++++ src/types.ts | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/components/Insights/typeGuards.ts b/src/components/Insights/typeGuards.ts index 1aee64c14..7e7d093c0 100644 --- a/src/components/Insights/typeGuards.ts +++ b/src/components/Insights/typeGuards.ts @@ -12,6 +12,7 @@ import { EndpointLowUsageInsight, EndpointNormalUsageInsight, EndpointQueryOptimizationInsight, + EndpointSlowdownSourceInsight, EndpointSlowestSpansInsight, EndpointSuspectedNPlusOneInsight, InsightScope, @@ -107,6 +108,12 @@ export const isCodeObjectHotSpotInsight = ( insight: CodeObjectInsight ): insight is CodeObjectHotSpotInsight => insight.type === InsightType.HotSpot; +export const isEndpointSlowdownSourceInsight = ( + insight: CodeObjectInsight +): insight is EndpointSlowdownSourceInsight => + insight.type === InsightType.EndpointSlowdownSource; + +// obsolete export const isEndpointDurationSlowdownInsight = ( insight: CodeObjectInsight ): insight is EndpointDurationSlowdownInsight => diff --git a/src/components/Insights/types.ts b/src/components/Insights/types.ts index edbd71710..a9b5f0fd7 100644 --- a/src/components/Insights/types.ts +++ b/src/components/Insights/types.ts @@ -36,6 +36,7 @@ export type GenericCodeObjectInsight = | CodeObjectHotSpotInsight | CodeObjectErrorsInsight | EndpointDurationSlowdownInsight + | EndpointSlowdownSourceInsight | EndpointBreakdownInsight | SpanScalingWellInsight | SpanScalingInsufficientDataInsight @@ -579,6 +580,7 @@ export interface CodeObjectErrorsInsight extends CodeObjectInsight { }[]; } +// obsolete export interface DurationSlowdownSource { percentile: string; spanInfo: SpanInfo; @@ -589,6 +591,17 @@ export interface DurationSlowdownSource { changeVerified: boolean; } +export interface EndpointSlowdownSources { + percentile: string; + spanInfo: SpanInfo; + level: number; + previousDuration: Duration; + currentDuration: Duration; + changeTime: string; + changeVerified: boolean; +} + +// obsolete export interface EndpointDurationSlowdownInsight extends EndpointInsight { name: "Endpoint Duration Slowdown Source"; type: InsightType.EndpointDurationSlowdown; @@ -599,6 +612,16 @@ export interface EndpointDurationSlowdownInsight extends EndpointInsight { decorators: CodeObjectDecorator[]; } +export interface EndpointSlowdownSourceInsight extends EndpointInsight { + name: "Endpoint Duration Slowdown Source"; + type: InsightType.EndpointSlowdownSource; + category: InsightCategory.Performance; + specifity: InsightSpecificity.OwnInsight; + importance: InsightImportance.Critical; + endpointSlowdownSources: EndpointSlowdownSources[]; + decorators: CodeObjectDecorator[]; +} + export enum ComponentType { Internal = "Internal", DbQueries = "DB Queries", diff --git a/src/types.ts b/src/types.ts index d0ad271a9..f48813513 100644 --- a/src/types.ts +++ b/src/types.ts @@ -33,7 +33,8 @@ export enum InsightType { EndpointHighNumberOfQueries = "EndpointHighNumberOfQueries", SpanNexus = "SpanNexus", SpanQueryOptimization = "SpanQueryOptimization", - EndpointQueryOptimization = "EndpointQueryOptimization" + EndpointQueryOptimization = "EndpointQueryOptimization", + EndpointSlowdownSource = "EndpointSlowdownSource" } export type PercentileKey = "p50" | "p95"; From d2f41407f5cb55d0b9d695cb967bcb4dfca7252c Mon Sep 17 00:00:00 2001 From: olehp Date: Wed, 28 Feb 2024 21:06:17 +0200 Subject: [PATCH 2/4] change name --- src/components/Insights/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Insights/types.ts b/src/components/Insights/types.ts index a9b5f0fd7..21c93ee38 100644 --- a/src/components/Insights/types.ts +++ b/src/components/Insights/types.ts @@ -613,7 +613,7 @@ export interface EndpointDurationSlowdownInsight extends EndpointInsight { } export interface EndpointSlowdownSourceInsight extends EndpointInsight { - name: "Endpoint Duration Slowdown Source"; + name: "Endpoint Slowdown Source"; type: InsightType.EndpointSlowdownSource; category: InsightCategory.Performance; specifity: InsightSpecificity.OwnInsight; From 41495111751c399f24f4bb2f10b96dde4e4c0341 Mon Sep 17 00:00:00 2001 From: olehp Date: Wed, 28 Feb 2024 21:12:26 +0200 Subject: [PATCH 3/4] Added Endpoint Bottleneck --- src/components/Insights/typeGuards.ts | 7 +++++++ src/components/Insights/types.ts | 30 +++++++++++++++++++++++++++ src/types.ts | 1 + 3 files changed, 38 insertions(+) diff --git a/src/components/Insights/typeGuards.ts b/src/components/Insights/typeGuards.ts index 7e7d093c0..a5450eef8 100644 --- a/src/components/Insights/typeGuards.ts +++ b/src/components/Insights/typeGuards.ts @@ -4,6 +4,7 @@ import { CodeObjectErrorsInsight, CodeObjectHotSpotInsight, CodeObjectInsight, + EndpointBottleneckInsight, EndpointBreakdownInsight, EndpointDurationSlowdownInsight, EndpointHighNumberOfQueriesInsight, @@ -72,11 +73,17 @@ export const isEndpointHighUsageInsight = ( ): insight is EndpointHighUsageInsight => insight.type === InsightType.HighUsage; +// obsolete export const isEndpointSlowestSpansInsight = ( insight: CodeObjectInsight ): insight is EndpointSlowestSpansInsight => insight.type === InsightType.SlowestSpans; +export const isEndpointBottleneckInsight = ( + insight: CodeObjectInsight +): insight is EndpointBottleneckInsight => + insight.type === InsightType.EndpointBottleneck; + export const isSlowEndpointInsight = ( insight: CodeObjectInsight ): insight is SlowEndpointInsight => insight.type === InsightType.SlowEndpoint; diff --git a/src/components/Insights/types.ts b/src/components/Insights/types.ts index 21c93ee38..0062e312d 100644 --- a/src/components/Insights/types.ts +++ b/src/components/Insights/types.ts @@ -392,6 +392,7 @@ export interface EndpointHighUsageInsight extends EndpointInsight { maxCallsIn1Min: number; } +// obsolete export interface EndpointSlowestSpansInsight extends EndpointInsight { name: "Bottleneck Detected"; type: InsightType.SlowestSpans; @@ -421,6 +422,35 @@ export interface EndpointSlowestSpansInsight extends EndpointInsight { }[]; } +export interface EndpointBottleneckInsight extends EndpointInsight { + name: "Bottleneck Detected"; + type: InsightType.EndpointBottleneck; + category: InsightCategory.Performance; + specifity: InsightSpecificity.TargetFound; + importance: InsightImportance.Critical; + isRecalculateEnabled: true; + spans: { + spanInfo: SpanInfo; + probabilityOfBeingBottleneck: number; + avgDurationWhenBeingBottleneck: Duration; + criticality: number; + ticketLink: string | null; + + /** + * @deprecated + */ + p50: Percentile; + /** + * @deprecated + */ + p95: Percentile; + /** + * @deprecated + */ + p99: Percentile; + }; +} + export interface SlowEndpointInsight extends EndpointInsight { name: "Slow Endpoint"; type: InsightType.SlowEndpoint; diff --git a/src/types.ts b/src/types.ts index f48813513..fb46284bd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,6 +17,7 @@ export enum InsightType { NormalUsage = "NormalUsage", HighUsage = "HighUsage", SlowestSpans = "SlowestSpans", + EndpointBottleneck = "EndpointBottleneck", EndpointSpanNPlusOne = "EndpointSpaNPlusOne", SpanUsages = "SpanUsages", SpanNPlusOne = "SpaNPlusOne", From 94bc447717cc97c8d6384eb7c192eed85c2fac4a Mon Sep 17 00:00:00 2001 From: olehp Date: Wed, 28 Feb 2024 21:21:29 +0200 Subject: [PATCH 4/4] EndpointSpanNPlusOne --- src/components/Insights/typeGuards.ts | 7 +++++++ src/components/Insights/types.ts | 21 +++++++++++++++++++++ src/types.ts | 1 + 3 files changed, 29 insertions(+) diff --git a/src/components/Insights/typeGuards.ts b/src/components/Insights/typeGuards.ts index a5450eef8..78c28f495 100644 --- a/src/components/Insights/typeGuards.ts +++ b/src/components/Insights/typeGuards.ts @@ -15,6 +15,7 @@ import { EndpointQueryOptimizationInsight, EndpointSlowdownSourceInsight, EndpointSlowestSpansInsight, + EndpointSpanNPlusOneInsight, EndpointSuspectedNPlusOneInsight, InsightScope, QueryOptimizationInsight, @@ -92,11 +93,17 @@ export const isSpanNPlusOneInsight = ( insight: CodeObjectInsight ): insight is SpanNPlusOneInsight => insight.type === InsightType.SpanNPlusOne; +// obsolete export const isEndpointSuspectedNPlusOneInsight = ( insight: CodeObjectInsight ): insight is EndpointSuspectedNPlusOneInsight => insight.type === InsightType.EndpointSpanNPlusOne; +export const isEndpointSpanNPlusOneInsight = ( + insight: CodeObjectInsight +): insight is EndpointSpanNPlusOneInsight => + insight.type === InsightType.EndpointSpanNPlusOneV2; + export const isEndpointQueryOptimizationInsight = ( insight: CodeObjectInsight ): insight is EndpointQueryOptimizationInsight => diff --git a/src/components/Insights/types.ts b/src/components/Insights/types.ts index 0062e312d..0fd58e8dd 100644 --- a/src/components/Insights/types.ts +++ b/src/components/Insights/types.ts @@ -581,6 +581,27 @@ export interface EndpointSuspectedNPlusOneInsight extends EndpointInsight { }[]; } +export interface EndpointSpanNPlusOneInsight extends EndpointInsight { + name: "Suspected N+1 Query"; + type: InsightType.EndpointSpanNPlusOneV2; + category: InsightCategory.Performance; + specifity: InsightSpecificity.TargetAndReasonFound; + importance: InsightImportance.HighlyImportant; + isRecalculateEnabled: true; + spans: { + occurrences: number; + internalSpan: SpanInfo | null; + clientSpan: SpanInfo; + traceId: string; + duration: Duration; + fraction: number; + criticality: number; + impact: number; + severity: number; + ticketLink: string | null; + }; +} + export interface CodeObjectHotSpotInsight extends CodeObjectInsight { name: "Errors Hotspot"; type: InsightType.HotSpot; diff --git a/src/types.ts b/src/types.ts index fb46284bd..3fb02276e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,6 +19,7 @@ export enum InsightType { SlowestSpans = "SlowestSpans", EndpointBottleneck = "EndpointBottleneck", EndpointSpanNPlusOne = "EndpointSpaNPlusOne", + EndpointSpanNPlusOneV2 = "EndpointSpanNPlusOne", SpanUsages = "SpanUsages", SpanNPlusOne = "SpaNPlusOne", SpanEndpointBottleneck = "SpanEndpointBottleneck",