Skip to content

⚑ Performance Benchmark Module #64

@mijinummi

Description

@mijinummi

πŸ“Œ Overview

Monitoring API performance is crucial for ensuring reliability and user satisfaction. Without proper benchmarks, latency issues may go unnoticed, impacting dApps and merchants relying on GasGuard.

This task introduces a Performance Benchmark Module to measure API latency and track key performance indicators like P95 response time.


🎯 Objective

Build a system that:

  • Measures and logs API response times
  • Calculates performance metrics, including P95 latency
  • Provides historical and real-time performance insights
  • Enables developers and operators to monitor and optimize API responsiveness

πŸ›  Scope of Work

1️⃣ Latency Measurement

  • Capture request start and end timestamps for all API endpoints
  • Measure response times in milliseconds
  • Calculate:
    • Average (mean) latency
    • Median (P50) latency
    • 95th percentile (P95) latency
    • Maximum and minimum latency

2️⃣ Data Aggregation & Storage

  • Store benchmark data in a structured format:

    • Endpoint name / path
    • Timestamp
    • Response time metrics
    • Status codes (success / failure)
  • Support historical data retention for trend analysis

  • Optional: store in PostgreSQL or time-series database (e.g., InfluxDB)


3️⃣ API & Dashboard Exposure

  • Expose performance metrics via API:
    GET /metrics/performance?endpoint=&period=<daily|weekly|monthly>
    GET /metrics/performance/:endpoint

  • Optional: integrate with dashboards for visualization

  • Support filtering by endpoint, period, and status code

Example JSON response:

{
  "endpoint": "/analytics/gas-volatility",
  "period": "2026-02",
  "p50": 120,
  "p95": 250,
  "max": 340,
  "min": 90,
  "totalRequests": 1500
}

Metadata

Metadata

Assignees

Labels

Nest.jsStellar WaveIssues in the Stellar wave programbackendNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions