ObserverWeb.Crashdump.Server (Observer Web v0.2.8)
View SourceOwns the interaction with OTP's :crashdump_viewer parser (a globally named gen_server):
starts it on demand, serializes dump loads, receives the parser's progress reports and
broadcasts them, and decodes its records into maps for the Crashdump page.
Progress: while loading, this server registers itself under the name the parser reports to
(:cdv_progress_handler, a no-op destination when unregistered) and receives
{:progress, {:ok, phase | percent | :done}} / {:progress, {:error, reason}} messages,
re-broadcast on the "crashdump" PubSub topic.
Decoding: #general_info{}/#proc{} records are converted by zipping their documented field
order over the tuple - a dump/record from a different OTP release with more or fewer fields
degrades to the fields both sides know instead of crashing.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec general_info() :: {:ok, map()} | {:error, :no_dump_loaded}
@spec processes() :: {:ok, [map()]} | {:error, :no_dump_loaded}
@spec status() :: :idle | {:loading, String.t(), non_neg_integer()} | {:loaded, String.t()}