Current section

Files

Jump to
step_flow lib step_flow view statistics_durations_view.ex
Raw

lib/step_flow/view/statistics_durations_view.ex

defmodule StepFlow.StatisticsDurationsView do
use StepFlow, :view
alias StepFlow.StatisticsDurationsView
def render("index.json", %{statistics_durations: %{data: durations, total: _total}}) do
%{data: render_many(durations, StatisticsDurationsView, "statistics_durations.json")}
end
def render("show.json", %{statistics_durations: durations}) do
%{data: render_one(durations, StatisticsDurationsView, "statistics_durations.json")}
end
def render("statistics_durations.json", %{statistics_durations: durations}) do
%{
workflow_id: Map.get(durations, :workflow_id),
job_id: Map.get(durations, :job_id),
order_pending: durations.order_pending,
processing: durations.processing,
response_pending: durations.response_pending,
total: durations.total
}
end
end