Pick better perf metrics
This commit is contained in:
@@ -24,20 +24,9 @@ defmodule MusicLibraryWeb.Telemetry do
|
||||
def metrics do
|
||||
[
|
||||
# Phoenix Metrics
|
||||
summary("phoenix.endpoint.start.system_time",
|
||||
unit: {:native, :millisecond}
|
||||
),
|
||||
summary("phoenix.endpoint.stop.duration",
|
||||
unit: {:native, :millisecond}
|
||||
),
|
||||
summary("phoenix.router_dispatch.start.system_time",
|
||||
tags: [:route],
|
||||
unit: {:native, :millisecond}
|
||||
),
|
||||
summary("phoenix.router_dispatch.exception.duration",
|
||||
tags: [:route],
|
||||
unit: {:native, :millisecond}
|
||||
),
|
||||
summary("phoenix.router_dispatch.stop.duration",
|
||||
tags: [:route],
|
||||
unit: {:native, :millisecond}
|
||||
@@ -53,6 +42,36 @@ defmodule MusicLibraryWeb.Telemetry do
|
||||
unit: {:native, :millisecond}
|
||||
),
|
||||
|
||||
# LiveView Metrics
|
||||
summary("phoenix.live_view.mount.stop.duration",
|
||||
unit: {:native, :millisecond},
|
||||
tags: [:view]
|
||||
),
|
||||
summary("phoenix.live_view.handle_params.stop.duration",
|
||||
unit: {:native, :millisecond},
|
||||
tags: [:view]
|
||||
),
|
||||
summary("phoenix.live_view.handle_event.stop.duration",
|
||||
unit: {:native, :millisecond},
|
||||
tags: [:view, :event]
|
||||
),
|
||||
summary("phoenix.live_view.render.stop.duration",
|
||||
unit: {:native, :millisecond},
|
||||
tags: [:view]
|
||||
),
|
||||
|
||||
# LiveComponent Metrics
|
||||
summary("phoenix.live_component.update.stop.duration",
|
||||
unit: {:native, :millisecond},
|
||||
tags: [:component],
|
||||
drop: &drop_live_dashboard_events/1
|
||||
),
|
||||
summary("phoenix.live_component.handle_event.stop.duration",
|
||||
unit: {:native, :millisecond},
|
||||
tags: [:component, :event],
|
||||
drop: &drop_live_dashboard_events/1
|
||||
),
|
||||
|
||||
# Database Metrics
|
||||
summary("music_library.repo.query.total_time",
|
||||
unit: {:native, :millisecond},
|
||||
@@ -124,4 +143,11 @@ defmodule MusicLibraryWeb.Telemetry do
|
||||
defp drop_archive_requests(metadata) do
|
||||
metadata.request.host =~ "archive.org"
|
||||
end
|
||||
|
||||
defp drop_live_dashboard_events(metadata) do
|
||||
case Module.split(metadata.component) do
|
||||
["Phoenix" | _rest] -> true
|
||||
_ -> false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user