View Source Electric.Plug.LabelProcessPlug (electric v0.9.5)

A plug that assists debugging by labelling processes that handle requests with details about the request.

The plug should be places right after the match plug in the router:

plug :match plug Electric.Plug.LabelProcessPlug

Summary

Functions

Returns a description of the HTTP request to be used as the lable for the request process.

Functions

Returns a description of the HTTP request to be used as the lable for the request process.

Examples

iex> process_label(%{
...>   method: "GET",
...>   request_path: "/v1/shape",
...>   query_string: "table=users&offset=-1",
...>   assigns: %{plug_request_id: "F-jPUudNHxbD8lIAABQG"}
...> })
"Request F-jPUudNHxbD8lIAABQG - GET /v1/shape?table=users&offset=-1"

iex> process_label(%{
...>   method: "GET",
...>   request_path: "/v1/shape",
...>   query_string: "table=users",
...>   assigns: %{plug_request_id: "F-jPUudNHxbD8lIAABQG"}
...> })
"Request F-jPUudNHxbD8lIAABQG - GET /v1/shape?table=users"