@@ -492,6 +492,86 @@ export const DataPathwayDeliveryErrorListSchema: TObject<{
492492} )
493493export type DataPathwayDeliveryErrorList = Static < typeof DataPathwayDeliveryErrorListSchema >
494494
495+ // ── Pathway Metrics ──
496+
497+ type TThroughputRecentResult = TObject < {
498+ status : TNumber
499+ durationMs : TNumber
500+ success : TBoolean
501+ ageMs : TNumber
502+ } >
503+ const ThroughputRecentResultSchema : TThroughputRecentResult = Type . Object ( {
504+ status : Type . Number ( ) ,
505+ durationMs : Type . Number ( ) ,
506+ success : Type . Boolean ( ) ,
507+ ageMs : Type . Number ( ) ,
508+ } )
509+
510+ type TThroughputFlowType = TObject < {
511+ eventsPerSecond : TNumber
512+ successRate : TNumber
513+ avgDurationMs : TNumber
514+ recentResults : TArray < TThroughputRecentResult >
515+ } >
516+ const ThroughputFlowTypeSchema : TThroughputFlowType = Type . Object ( {
517+ eventsPerSecond : Type . Number ( ) ,
518+ successRate : Type . Number ( ) ,
519+ avgDurationMs : Type . Number ( ) ,
520+ recentResults : Type . Array ( ThroughputRecentResultSchema ) ,
521+ } )
522+
523+ type TThroughputEndpoint = TObject < {
524+ eventsPerSecond : TNumber
525+ successRate : TNumber
526+ flowTypes : TRecord < TString , TThroughputFlowType >
527+ } >
528+ const ThroughputEndpointSchema : TThroughputEndpoint = Type . Object ( {
529+ eventsPerSecond : Type . Number ( ) ,
530+ successRate : Type . Number ( ) ,
531+ flowTypes : Type . Record ( Type . String ( ) , ThroughputFlowTypeSchema ) ,
532+ } )
533+
534+ type TThroughputGlobal = TObject < {
535+ eventsPerSecond : TNumber
536+ totalRecorded : TNumber
537+ windowSeconds : TNumber
538+ } >
539+
540+ type TThroughputSnapshot = TObject < {
541+ global : TThroughputGlobal
542+ endpoints : TRecord < TString , TThroughputEndpoint >
543+ } >
544+ const ThroughputSnapshotSchema : TThroughputSnapshot = Type . Object ( {
545+ global : Type . Object ( {
546+ eventsPerSecond : Type . Number ( ) ,
547+ totalRecorded : Type . Number ( ) ,
548+ windowSeconds : Type . Number ( ) ,
549+ } ) ,
550+ endpoints : Type . Record ( Type . String ( ) , ThroughputEndpointSchema ) ,
551+ } )
552+
553+ type TMetricsAssignmentEntry = TObject < {
554+ assignmentId : TString
555+ status : TString
556+ throughput : TUnion < [ TThroughputSnapshot , TNull ] >
557+ updatedAt : TString
558+ } >
559+ const MetricsAssignmentEntrySchema : TMetricsAssignmentEntry = Type . Object ( {
560+ assignmentId : Type . String ( ) ,
561+ status : Type . String ( ) ,
562+ throughput : Type . Union ( [ ThroughputSnapshotSchema , Type . Null ( ) ] ) ,
563+ updatedAt : Type . String ( ) ,
564+ } )
565+
566+ export const DataPathwayMetricsSchema : TObject < {
567+ pathwayId : TString
568+ assignments : TArray < TMetricsAssignmentEntry >
569+ } > = Type . Object ( {
570+ pathwayId : Type . String ( ) ,
571+ assignments : Type . Array ( MetricsAssignmentEntrySchema ) ,
572+ } )
573+ export type DataPathwayMetrics = Static < typeof DataPathwayMetricsSchema >
574+
495575// ── Health ──
496576
497577export const DataPathwayHealthSchema : TObject < {
0 commit comments