ElixirDashboard.PerformanceMonitor (ElixirDashboard v0.2.0)
View SourceMain module for the Performance Monitor functionality.
Quick Start
Add to your application's supervision tree:
children = [
# ... your other children
ElixirDashboard.PerformanceMonitor.Supervisor
]Then attach the telemetry handlers (typically in development only):
if Mix.env() == :dev do
ElixirDashboard.PerformanceMonitor.TelemetryHandler.attach()
endConfiguration
Configure in your config/dev.exs:
config :elixir_dashboard,
# Maximum number of items to keep in memory
max_items: 100,
# Endpoint duration threshold in milliseconds
endpoint_threshold_ms: 100,
# Query duration threshold in milliseconds
query_threshold_ms: 50,
# List of Ecto repo telemetry prefixes to monitor
repo_prefixes: [[:my_app, :repo]]Accessing Data
# Get slow endpoints
ElixirDashboard.PerformanceMonitor.Store.get_slow_endpoints()
# Get slow queries
ElixirDashboard.PerformanceMonitor.Store.get_slow_queries()
# Clear all data
ElixirDashboard.PerformanceMonitor.Store.clear_all()
Summary
Functions
Attaches telemetry handlers to start monitoring.
Returns the child spec for adding to a supervision tree.
Detaches telemetry handlers to stop monitoring.
Functions
Attaches telemetry handlers to start monitoring.
Returns the child spec for adding to a supervision tree.
Detaches telemetry handlers to stop monitoring.
See ElixirDashboard.PerformanceMonitor.Store.get_slow_endpoints/0.
See ElixirDashboard.PerformanceMonitor.Store.get_slow_queries/0.