performance

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

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

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

func NewService(cloudWatch cloudWatchAPI, environment string, logger *zap.Logger) *Service

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL