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
5 changes: 5 additions & 0 deletions src/components/Insights/BottleneckInsight/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "../types";

export const mockedBottleneckInsight: SpanEndpointBottleneckInsight = {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-1cce7979ac6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -48,6 +49,10 @@ export const mockedBottleneckInsight: SpanEndpointBottleneckInsight = {
unit: "sec",
raw: 3887134558.2822084
},
impact: 0.14877828054298645,
severity: 0.2877828054298645,
criticality: 0.5687782805429865,
requestPercentage: 35,
p50: {
fraction: 0,
maxDuration: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ac6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Story = StoryObj<typeof meta>;
export const WithAverage: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -136,6 +137,7 @@ export const WithAverage: Story = {
export const WithChange: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: null,
lastDetected: null,
Expand Down Expand Up @@ -242,6 +244,7 @@ export const WithChange: Story = {
export const WithEvaluatingChange: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: null,
lastDetected: null,
Expand Down Expand Up @@ -348,6 +351,7 @@ export const WithEvaluatingChange: Story = {
export const HistogramWithManyBars: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: null,
lastDetected: null,
Expand Down Expand Up @@ -4872,6 +4876,7 @@ export const HistogramWithManyBars: Story = {
export const HistogramWithGaps: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: null,
lastDetected: null,
Expand Down Expand Up @@ -5126,6 +5131,7 @@ export const HistogramWithGaps: Story = {
export const HistogramWithAFewBars: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: null,
lastDetected: null,
Expand Down Expand Up @@ -5280,6 +5286,7 @@ export const HistogramWithAFewBars: Story = {
export const EmptyStateBug: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad6d",
name: "Performance Stats",
type: InsightType.SpanDurations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Story = StoryObj<typeof meta>;
export const WithEvaluatingChange: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cde7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "../types";

export const mockedEndpointNPlusOneInsight: EndpointSuspectedNPlusOneInsight = {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7919ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {

export const mockedEndpointQueryOptimizationInsight: EndpointQueryOptimizationInsight =
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7989ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-3cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9688-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {

export const mockedHighNumberOfQueriesInsight: EndpointHighNumberOfQueriesInsight =
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9623-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand All @@ -24,12 +25,6 @@ export const mockedHighNumberOfQueriesInsight: EndpointHighNumberOfQueriesInsigh
importance: 3,
queriesCount: 250,
typicalCount: 4,
medianDuration: {
value: 150,
unit: "ms",
raw: 150000000.0
},
requestFraction: 0.3,
traceId: "00D37A4E7208E0F6E89AA7E2E37446A6",
scope: InsightScope.EntrySpan,
endpointSpan: "HTTP POST /owners/{ownerId}/pets/new",
Expand Down
11 changes: 8 additions & 3 deletions src/components/Insights/InsightCard/InsightCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { Meta, StoryObj } from "@storybook/react";
import { InsightCard } from ".";
import { InsightType } from "../../../types";
import { Button } from "../../common/Button";
import { InsightCategory, InsightScope } from "../types";
import {
EndpointSuspectedNPlusOneInsight,
InsightCategory,
InsightScope
} from "../types";

// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
const meta: Meta<typeof InsightCard> = {
Expand All @@ -21,6 +25,7 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
data: {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9638-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -93,12 +98,12 @@ export const Default: Story = {
],
environment: "SAMPLE_ENV",
severity: 0,
isRecalculateEnabled: false,
isRecalculateEnabled: true,
prefixedCodeObjectId:
"method:org.springframework.samples.petclinic.sample.SampleInsightsController$_$genNPlusOneWithoutInternalSpan",
customStartTime: null,
actualStartTime: "2023-06-16T10:30:33.027Z"
},
} as EndpointSuspectedNPlusOneInsight,
stats: "Some stats",
isAsync: true,
content: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default meta;
type Story = StoryObj<typeof meta>;

const insight = {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4d5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
13 changes: 12 additions & 1 deletion src/components/Insights/Insights.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
InsightCategory,
InsightScope,
InsightsStatus,
SpanNPlusOneInsight,
ViewMode
} from "./types";

Expand Down Expand Up @@ -53,6 +54,7 @@ export const Default: Story = {
// needsObservabilityFix: false,
insights: [
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8362-4c5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -158,8 +160,9 @@ export const Default: Story = {
"method:org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner",
customStartTime: null,
actualStartTime: "2023-07-27T08:23:56.500827Z"
},
} as SpanNPlusOneInsight,
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "62b55792-8262-4c5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -232,6 +235,7 @@ export const Default: Story = {
actualStartTime: "2023-06-26T00:00:00.000Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-3262-4c5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -287,6 +291,7 @@ export const Default: Story = {
actualStartTime: "2023-06-26T13:53:53.645Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-4262-4c5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -328,6 +333,7 @@ export const Default: Story = {
actualStartTime: "2023-06-26T13:53:57.956Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8252-4c5d-9628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -385,6 +391,7 @@ export const Default: Story = {
actualStartTime: "2023-06-12T13:48:59.404Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-5628-7cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -481,6 +488,7 @@ export const Default: Story = {
actualStartTime: "2023-06-12T13:49:08.186Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-6cce7979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -557,6 +565,7 @@ export const Default: Story = {
actualStartTime: "2023-06-12T13:49:03.486Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce8979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -653,6 +662,7 @@ export const Default: Story = {
actualStartTime: "2023-06-13T00:00:00.000Z"
},
{
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce9979ad6d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down Expand Up @@ -806,6 +816,7 @@ export const NoObservability: Story = {
};

const errorsInsight: CodeObjectErrorsInsight = {
sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId",
id: "60b55792-8262-4c5d-9628-7cce7979ad1d",
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
Expand Down
Loading