Documentation
¶
Overview ¶
Package performance provides performance monitoring and metrics aggregation services. It integrates with AWS CloudWatch to collect Lambda, DynamoDB, and service metrics, providing comprehensive performance insights for operational dashboards and alerting.
Index ¶
- type QueryTracker
- func (qt *QueryTracker) Cleanup(maxAge time.Duration)
- func (qt *QueryTracker) GetAllQueries() []*model.QueryPerformance
- func (qt *QueryTracker) GetSlowQueries(_ context.Context, threshold model.Duration) ([]*model.QueryPerformance, error)
- func (qt *QueryTracker) RecordQuery(_ context.Context, queryName string, duration time.Duration, hasError bool)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryTracker ¶
type QueryTracker struct {
// contains filtered or unexported fields
}
QueryTracker tracks GraphQL query performance for identifying slow operations
func NewQueryTracker ¶
func NewQueryTracker(logger *zap.Logger) *QueryTracker
NewQueryTracker creates a new query performance tracker
func (*QueryTracker) Cleanup ¶
func (qt *QueryTracker) Cleanup(maxAge time.Duration)
Cleanup removes old query statistics to prevent memory leaks
func (*QueryTracker) GetAllQueries ¶
func (qt *QueryTracker) GetAllQueries() []*model.QueryPerformance
GetAllQueries returns all tracked queries (for debugging/monitoring)
func (*QueryTracker) GetSlowQueries ¶
func (qt *QueryTracker) GetSlowQueries(_ context.Context, threshold model.Duration) ([]*model.QueryPerformance, error)
GetSlowQueries retrieves queries that exceed the specified threshold
func (*QueryTracker) RecordQuery ¶
func (qt *QueryTracker) RecordQuery(_ context.Context, queryName string, duration time.Duration, hasError bool)
RecordQuery records a query execution with its duration
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides performance monitoring functionality
func NewService ¶
NewService creates a new performance monitoring service
func (*Service) GetPerformanceMetrics ¶
func (s *Service) GetPerformanceMetrics(ctx context.Context, serviceCategory model.ServiceCategory, period model.TimePeriod) (*model.PerformanceReport, error)
GetPerformanceMetrics retrieves comprehensive performance metrics for a service category