mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-20 21:40:46 +01:00
Added enriched metrics (#2432)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { PhaseTimings, WebVitals } from "Metrics/Constants";
|
||||
import MetricScenario from "./MetricEvents";
|
||||
|
||||
// Common phases shared across all scenarios
|
||||
@@ -15,25 +16,12 @@ export enum ApplicationMetricPhase {
|
||||
// Combined type for all metric phases
|
||||
export type MetricPhase = CommonMetricPhase | ApplicationMetricPhase;
|
||||
|
||||
export interface WebVitals {
|
||||
lcp?: number; // Largest Contentful Paint
|
||||
inp?: number; // Interaction to Next Paint
|
||||
cls?: number; // Cumulative Layout Shift
|
||||
fcp?: number; // First Contentful Paint
|
||||
ttfb?: number; // Time to First Byte
|
||||
}
|
||||
|
||||
export interface ScenarioConfig<TPhase extends string = MetricPhase> {
|
||||
requiredPhases: TPhase[];
|
||||
timeoutMs: number;
|
||||
validate?: (ctx: ScenarioContextSnapshot<TPhase>) => boolean; // Optional custom validation
|
||||
}
|
||||
|
||||
export interface PhaseTimings {
|
||||
endTimeISO: string; // When the phase completed
|
||||
durationMs: number; // Duration from scenario start to phase completion
|
||||
}
|
||||
|
||||
export interface ScenarioContextSnapshot<TPhase extends string = MetricPhase> {
|
||||
scenario: MetricScenario;
|
||||
startTimeISO: string; // Human-readable ISO timestamp
|
||||
|
||||
Reference in New Issue
Block a user