Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ library is part of the [DeployEx][dye] project.

## Check out some of the available features

### Quick look
![Quick Look](./guides/static/quick_look.gif)

A short tour of the interactions: instant client-side selection and dropdowns, the animated bottom details panel, and live countdown timers on Tracing/Profiling sessions.

### Distributed tracing safe to use in production
![Tracing Dashboard](./guides/static/tracing_dash.png)

### Function profiling with Count, Duration, Call Sequence and Flame Graph tools
![Profiling Dashboard](./guides/static/profiling_dash.png)
![Profiling Count Example](./guides/static/profiling_count.png)

### Busiest processes ranked by reductions, memory or message queue (etop style)
![Processes Dashboard](./guides/static/processes_dash.png)
Expand Down
Binary file modified guides/static/applications_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/crashdump_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/ets_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/liveview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/metrics_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/network_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/port.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/process_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/processes_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/static/profiling_count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/profiling_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/static/quick_look.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/system_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified guides/static/tracing_dash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/web/components/layouts/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</script>
</head>

<body class="min-h-screen antialiased bg-gray-200 dark:bg-gray-950 text-gray-900 dark:text-gray-100 transition duration-200 ease-out">
<body class="min-h-screen antialiased bg-base-200 text-base-content transition duration-200 ease-out">
{@inner_content}
</body>
</html>
52 changes: 47 additions & 5 deletions lib/web/pages/network/page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ defmodule Observer.Web.Network.Page do
label="Refresh"
options={[{"Paused", "0"}, {"2s", "2"}, {"5s", "5"}, {"10s", "10"}]}
/>

<Core.input field={@form[:search]} type="text" label="Search" phx-debounce="300" />
</.form>

<button
Expand All @@ -77,8 +79,11 @@ defmodule Observer.Web.Network.Page do
</div>

<div :if={@rows != nil} class="bg-base-100 w-full shadow-lg rounded mb-4">
<h2 class="px-4 pt-2 text-sm font-semibold text-base-content">
<h2 class="px-4 pt-2 flex items-center gap-2 text-sm font-semibold text-base-content">
Inet Ports
<span :if={search_active?(@form)} class={Core.badge_class(:neutral)}>
Showing: {length(@rows)}
</span>
</h2>
<div :if={@rows == []} class="p-4 text-xs text-muted">
No inet ports on this service.
Expand Down Expand Up @@ -108,8 +113,11 @@ defmodule Observer.Web.Network.Page do
</div>

<div :if={@sockets != nil} class="bg-base-100 w-full shadow-lg rounded">
<h2 class="px-4 pt-2 text-sm font-semibold text-base-content">
<h2 class="px-4 pt-2 flex items-center gap-2 text-sm font-semibold text-base-content">
Sockets (NIF)
<span :if={search_active?(@form)} class={Core.badge_class(:neutral)}>
Showing: {length(@sockets)}
</span>
</h2>
<div :if={@sockets == []} class="p-4 text-xs text-muted">
No `socket` module sockets on this service.
Expand Down Expand Up @@ -306,8 +314,12 @@ defmodule Observer.Web.Network.Page do
%{form: form, previous_counters: previous_counters, details: details} = socket.assigns

sort_by = sort_by_atom(form.params["sort_by"])
search = String.downcase(form.params["search"] || "")

rows = Network.rank_ports(ports, sort_by, 250, previous_counters)
rows =
ports
|> filter_ports(search)
|> Network.rank_ports(sort_by, 250, previous_counters)

details =
if details do
Expand All @@ -316,12 +328,39 @@ defmodule Observer.Web.Network.Page do

socket
|> assign(:rows, rows)
|> assign(:sockets, Enum.sort_by(sockets, &(&1.read_bytes + &1.write_bytes), :desc))
|> assign(
:sockets,
sockets |> filter_sockets(search) |> Enum.sort_by(&(&1.read_bytes + &1.write_bytes), :desc)
)
|> assign(:previous_counters, Network.counters_by_port(ports))
|> assign(:details, details)
|> assign(:sample_error, nil)
end

defp filter_ports(ports, ""), do: ports

defp filter_ports(ports, search) do
Enum.filter(ports, fn row ->
String.contains?(String.downcase(row.name), search) or
String.contains?(String.downcase(row.owner_label), search) or
String.contains?(String.downcase(row.local), search) or
String.contains?(String.downcase(row.remote), search) or
String.contains?(String.downcase(inspect(row.port)), search)
end)
end

defp filter_sockets(sockets, ""), do: sockets

defp filter_sockets(sockets, search) do
Enum.filter(sockets, fn row ->
String.contains?(String.downcase(row.id_str), search) or
String.contains?(String.downcase(inspect(row.kind)), search) or
String.contains?(String.downcase(inspect(row.domain)), search) or
String.contains?(String.downcase(inspect(row.type)), search) or
String.contains?(String.downcase(inspect(row.protocol)), search)
end)
end

defp details_rows(details) do
[
{"owner", details.owner_label},
Expand Down Expand Up @@ -363,10 +402,13 @@ defmodule Observer.Web.Network.Page do
%{
"service" => to_string(Node.self()),
"sort_by" => "total",
"refresh_seconds" => "5"
"refresh_seconds" => "5",
"search" => ""
}
end

defp search_active?(form), do: (form.params["search"] || "") != ""

defp format_bytes(bytes) when bytes >= 1_073_741_824,
do: "#{Float.round(bytes / 1_073_741_824, 1)} GB"

Expand Down
25 changes: 23 additions & 2 deletions lib/web/pages/processes/page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ defmodule Observer.Web.Processes.Page do
label="Refresh"
options={[{"Paused", "0"}, {"2s", "2"}, {"5s", "5"}, {"10s", "10"}]}
/>

<Core.input field={@form[:search]} type="text" label="Search" phx-debounce="300" />
</.form>

<button
Expand Down Expand Up @@ -100,6 +102,9 @@ defmodule Observer.Web.Processes.Page do
>
{key}: {format_bytes(Map.get(@summary.memory, key, 0))}
</span>
<span :if={search_active?(@form)} class={Core.badge_class(:neutral)}>
Showing: {length(@rows)}
</span>
</div>

<div :if={@rows != []} class="bg-base-100 w-full shadow-lg rounded">
Expand Down Expand Up @@ -314,8 +319,11 @@ defmodule Observer.Web.Processes.Page do

sort_by = sort_by_atom(form.params["sort_by"])
limit = positive_int(form.params["limit"], 50)
search = String.downcase(form.params["search"] || "")

rows = Processes.rank(sample, sort_by, limit, previous_reductions)
filtered_sample = %{sample | processes: filter_processes(sample.processes, search)}

rows = Processes.rank(filtered_sample, sort_by, limit, previous_reductions)

details =
if details do
Expand Down Expand Up @@ -353,6 +361,16 @@ defmodule Observer.Web.Processes.Page do
|> Enum.find(Node.self(), &(to_string(&1) == service))
end

defp filter_processes(processes, ""), do: processes

defp filter_processes(processes, search) do
Enum.filter(processes, fn row ->
String.contains?(String.downcase(row.name), search) or
String.contains?(String.downcase(inspect(row.pid)), search) or
String.contains?(String.downcase(row.current_function), search)
end)
end

defp sort_by_atom("memory"), do: :memory
defp sort_by_atom("message_queue_len"), do: :message_queue_len
defp sort_by_atom(_reductions), do: :reductions
Expand All @@ -369,10 +387,13 @@ defmodule Observer.Web.Processes.Page do
"service" => to_string(Node.self()),
"sort_by" => "reductions",
"limit" => "50",
"refresh_seconds" => "5"
"refresh_seconds" => "5",
"search" => ""
}
end

defp search_active?(form), do: (form.params["search"] || "") != ""

defp reductions_label("reductions"), do: "REDUCTIONS (Δ)"
defp reductions_label(_other), do: "REDUCTIONS"

Expand Down
Loading