Performance Monitoring
Monitor Epochly's impact on your application.
Metrics API
from epochly import get_metricsmetrics = 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
from epochly import get_function_statsstats = get_function_stats(my_function)print(f"Calls: {stats.call_count}")print(f"Avg speedup: {stats.avg_speedup}x")print(f"Level history: {stats.level_history}")
Prometheus Export
from epochly.monitoring import PrometheusExporterexporter = 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_bytesepochly_jit_compilation_time_seconds
Grafana Dashboard
Import our pre-built dashboard:
epochly monitoring dashboard --export grafana.json
Logging
Enable detailed logging:
import logginglogging.getLogger('epochly').setLevel(logging.DEBUG)
Or via environment:
export EPOCHLY_LOG_LEVEL=DEBUG