diff --git a/observability/gatewayobs/gen_reporter.go b/observability/gatewayobs/gen_reporter.go index 006a38efa..68084852e 100644 --- a/observability/gatewayobs/gen_reporter.go +++ b/observability/gatewayobs/gen_reporter.go @@ -6,7 +6,7 @@ import ( "time" ) -const Version_OL9B4A8 = true +const Version_NI039G8 = true type KeyResolver interface { Resolve(string) @@ -24,9 +24,42 @@ type ProjectReporter interface { RegisterFunc(func(ts time.Time, tx ProjectTx) bool) Tx(func(tx ProjectTx)) TxAt(time.Time, func(tx ProjectTx)) + WithRequestedPriority(priority string) RequestedPriorityReporter + WithDeferredRequestedPriority() (RequestedPriorityReporter, KeyResolver) + ProjectTx +} + +type RequestedPriorityTx interface{} + +type RequestedPriorityReporter interface { + RegisterFunc(func(ts time.Time, tx RequestedPriorityTx) bool) + Tx(func(tx RequestedPriorityTx)) + TxAt(time.Time, func(tx RequestedPriorityTx)) + WithGrantedPriority(priority string) GrantedPriorityReporter + WithDeferredGrantedPriority() (GrantedPriorityReporter, KeyResolver) + RequestedPriorityTx +} + +type GrantedPriorityTx interface{} + +type GrantedPriorityReporter interface { + RegisterFunc(func(ts time.Time, tx GrantedPriorityTx) bool) + Tx(func(tx GrantedPriorityTx)) + TxAt(time.Time, func(tx GrantedPriorityTx)) + WithBillablePriority(priority string) BillablePriorityReporter + WithDeferredBillablePriority() (BillablePriorityReporter, KeyResolver) + GrantedPriorityTx +} + +type BillablePriorityTx interface{} + +type BillablePriorityReporter interface { + RegisterFunc(func(ts time.Time, tx BillablePriorityTx) bool) + Tx(func(tx BillablePriorityTx)) + TxAt(time.Time, func(tx BillablePriorityTx)) WithProvider(name string) ProviderReporter WithDeferredProvider() (ProviderReporter, KeyResolver) - ProjectTx + BillablePriorityTx } type ProviderTx interface{} diff --git a/observability/gatewayobs/gen_reporter_noop.go b/observability/gatewayobs/gen_reporter_noop.go index 6c7d9070b..328b69560 100644 --- a/observability/gatewayobs/gen_reporter_noop.go +++ b/observability/gatewayobs/gen_reporter_noop.go @@ -7,10 +7,13 @@ import ( ) var ( - _ Reporter = (*noopReporter)(nil) - _ ProjectReporter = (*noopProjectReporter)(nil) - _ ProviderReporter = (*noopProviderReporter)(nil) - _ ModelReporter = (*noopModelReporter)(nil) + _ Reporter = (*noopReporter)(nil) + _ ProjectReporter = (*noopProjectReporter)(nil) + _ RequestedPriorityReporter = (*noopRequestedPriorityReporter)(nil) + _ GrantedPriorityReporter = (*noopGrantedPriorityReporter)(nil) + _ BillablePriorityReporter = (*noopBillablePriorityReporter)(nil) + _ ProviderReporter = (*noopProviderReporter)(nil) + _ ModelReporter = (*noopModelReporter)(nil) ) type noopKeyResolver struct{} @@ -41,10 +44,60 @@ func NewNoopProjectReporter() ProjectReporter { func (r *noopProjectReporter) RegisterFunc(f func(ts time.Time, tx ProjectTx) bool) {} func (r *noopProjectReporter) Tx(f func(ProjectTx)) {} func (r *noopProjectReporter) TxAt(ts time.Time, f func(ProjectTx)) {} -func (r *noopProjectReporter) WithProvider(name string) ProviderReporter { +func (r *noopProjectReporter) WithRequestedPriority(priority string) RequestedPriorityReporter { + return &noopRequestedPriorityReporter{} +} +func (r *noopProjectReporter) WithDeferredRequestedPriority() (RequestedPriorityReporter, KeyResolver) { + return &noopRequestedPriorityReporter{}, noopKeyResolver{} +} + +type noopRequestedPriorityReporter struct{} + +func NewNoopRequestedPriorityReporter() RequestedPriorityReporter { + return &noopRequestedPriorityReporter{} +} + +func (r *noopRequestedPriorityReporter) RegisterFunc(f func(ts time.Time, tx RequestedPriorityTx) bool) { +} +func (r *noopRequestedPriorityReporter) Tx(f func(RequestedPriorityTx)) {} +func (r *noopRequestedPriorityReporter) TxAt(ts time.Time, f func(RequestedPriorityTx)) {} +func (r *noopRequestedPriorityReporter) WithGrantedPriority(priority string) GrantedPriorityReporter { + return &noopGrantedPriorityReporter{} +} +func (r *noopRequestedPriorityReporter) WithDeferredGrantedPriority() (GrantedPriorityReporter, KeyResolver) { + return &noopGrantedPriorityReporter{}, noopKeyResolver{} +} + +type noopGrantedPriorityReporter struct{} + +func NewNoopGrantedPriorityReporter() GrantedPriorityReporter { + return &noopGrantedPriorityReporter{} +} + +func (r *noopGrantedPriorityReporter) RegisterFunc(f func(ts time.Time, tx GrantedPriorityTx) bool) {} +func (r *noopGrantedPriorityReporter) Tx(f func(GrantedPriorityTx)) {} +func (r *noopGrantedPriorityReporter) TxAt(ts time.Time, f func(GrantedPriorityTx)) {} +func (r *noopGrantedPriorityReporter) WithBillablePriority(priority string) BillablePriorityReporter { + return &noopBillablePriorityReporter{} +} +func (r *noopGrantedPriorityReporter) WithDeferredBillablePriority() (BillablePriorityReporter, KeyResolver) { + return &noopBillablePriorityReporter{}, noopKeyResolver{} +} + +type noopBillablePriorityReporter struct{} + +func NewNoopBillablePriorityReporter() BillablePriorityReporter { + return &noopBillablePriorityReporter{} +} + +func (r *noopBillablePriorityReporter) RegisterFunc(f func(ts time.Time, tx BillablePriorityTx) bool) { +} +func (r *noopBillablePriorityReporter) Tx(f func(BillablePriorityTx)) {} +func (r *noopBillablePriorityReporter) TxAt(ts time.Time, f func(BillablePriorityTx)) {} +func (r *noopBillablePriorityReporter) WithProvider(name string) ProviderReporter { return &noopProviderReporter{} } -func (r *noopProjectReporter) WithDeferredProvider() (ProviderReporter, KeyResolver) { +func (r *noopBillablePriorityReporter) WithDeferredProvider() (ProviderReporter, KeyResolver) { return &noopProviderReporter{}, noopKeyResolver{} }