Documentation

User Guide

Epochly User Guide: Performance Monitoring

Monitor Epochly's optimization decisions, speedup metrics, and resource usage with built-in telemetry and epochly.stats().

Monitor Epochly's impact on your application.

Metrics API

from epochly import get_metrics
metrics = get_metrics()
print(f"Total speedup: {metrics.total_speedup}x")
print(f"Functions optimized: {metrics.optimized_count}")
print(f"Current level: {metrics.current_level}")

Function-Level Stats

import epochly
stats = epochly.stats()
print(stats) # Shows function-level optimization statistics

Prometheus Export

from epochly.monitoring import PrometheusExporter
exporter = PrometheusExporter(port=9090)
exporter.start()

Metrics available:

  • epochly_function_duration_seconds{function="name"}
  • epochly_enhancement_level{function="name"}
  • epochly_speedup_ratio{function="name"}
  • epochly_memory_pool_bytes
  • epochly_jit_compilation_time_seconds

Grafana Dashboard

Configure Grafana to scrape the Prometheus metrics endpoint above, then import a dashboard using the exported metrics.

Logging

Enable detailed logging:

import logging
logging.getLogger('epochly').setLevel(logging.DEBUG)

Or via environment:

export EPOCHLY_LOG_LEVEL=DEBUG