% view_title 'Dashboard' %>
<%
# Generates a nice set of semi-random data that does not change more often than once every
# 24 hours not to make OSS users angry
rand = Random.new(Date.today.to_time.to_i)
baseline = Date.today.strftime('%m').to_i + 2
set = ->(modifier = 0, range = (-2..2)) do
Array.new(60) { |i| [i, baseline + rand.rand(range) + modifier] }
end
%>
<%== partial 'dashboard/counters' %>
<% if @aggregated.sufficient? %>
<%== partial 'dashboard/ranges_selector' %>
Processing Metrics
<%== partial 'shared/tab_nav', locals: { title: 'Consumed', id: 'consumed', active: true } %>
<%== partial 'shared/tab_nav', locals: { title: 'Batches', id: 'batches' } %>
<%== partial 'shared/tab_nav', locals: { title: 'Lags', id: 'lags', disabled: true } %>
<%== partial 'shared/tab_nav', locals: { title: 'Max LSO', id: 'max-lso' } %>
<%== partial 'shared/tab_nav', locals: { title: 'Pace', id: 'pace' } %>
<% data = @aggregated_charts.with(:messages, :errors) %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'consumed' } %>
<% data = @aggregated_charts.with(:batches, :errors, :dead, :retries) %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'batches' } %>
<%== partial 'dashboard/feature_pro' %>
<% data = { enqueued: set.call, busy: set.call }.to_json %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'lags', blurred: true } %>
<%== partial 'shared/charts/line', locals: { data: @topics_charts.max_lso, id: 'max-lso' } %>
<%== partial 'shared/charts/line', locals: { data: @topics_charts.pace, id: 'pace' } %>
Utilization Metrics
<%== partial 'shared/tab_nav', locals: { title: 'Utilization', id: 'utilization', active: true } %>
<%== partial 'shared/tab_nav', locals: { title: 'RSS', id: 'rss', disabled: true } %>
<%== partial 'shared/tab_nav', locals: { title: 'Concurrency', id: 'concurrency' } %>
<%== partial 'shared/tab_nav', locals: { title: 'Data transfers', id: 'data-transfers', disabled: true } %>
<% data = @aggregated_charts.with(:utilization) %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'utilization', label_type_y: 'percentage' } %>
<% data = @aggregated_charts.with(:processes, :workers, :active_listeners, :standby_listeners) %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'concurrency' } %>
<%== partial 'dashboard/feature_pro' %>
<% data = { bytes_received: set.call(4, 10..15), bytes_sent: set.call(2, 0..5) }.to_json %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'data-transfers', blurred: true } %>
<% else %>
<%== partial 'dashboard/not_enough_data' %>
<% end %>
<% if false && @aggregated.sufficient? %>
<%== partial 'dashboard/ranges_selector' %>
<% data = @aggregated_charts.with(:utilization) %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'utilization', label_type_y: 'percentage' } %>
<% data = @aggregated_charts.with(:processes, :workers, :active_listeners, :standby_listeners) %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'concurrency' } %>
<%== partial 'dashboard/feature_pro' %>
<% data = { bytes_received: set.call(4, 10..15), bytes_sent: set.call(2, 0..5) }.to_json %>
<%== partial 'shared/charts/line', locals: { data: data, id: 'data-transfers', blurred: true } %>
<% end %>