1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

minor fixes

This commit is contained in:
Mike Perham 2022-07-29 14:25:03 -07:00
parent c74cf00f9b
commit dcdfde820d
3 changed files with 38 additions and 28 deletions

View file

@ -104,7 +104,7 @@ module Sidekiq
initial.map do |(ms, p, f)|
tm = Time.utc(time.year, time.month, time.mday, time.hour, time.min, 0)
{
time: tm.rfc3339,
time: tm.iso8601,
epoch: tm.to_i,
ms: ms.to_i, p: p.to_i, f: f.to_i, hist: hist.fetch(conn, time)
}.tap { |x|

View file

@ -89,7 +89,7 @@ module Sidekiq
xa.expire(stats, ttl)
end
end
logger.info "Flushed #{count} elements"
logger.info "Flushed #{count} metrics"
count
end
end

View file

@ -18,14 +18,7 @@
<th><%= t('Histogram') %></th>
</tr>
<% data.each do |hash| %>
<tr>
<td><%= hash[:time] %></td>
<td><%= hash[:p] %></td>
<td><%= hash[:ms] %></td>
<td><%= hash[:f] %></td>
<td><%= hash[:mark] %></td>
<td><%= hash[:hist] %></td>
</tr>
<tr><td><%= hash[:time] %></td><td><%= hash[:p] %></td><td><%= hash[:ms] %></td><td><%= hash[:f] %></td><td><%= hash[:mark] %></td><td><%= hash[:hist] %></td></tr>
<% end %>
</tbody>
</table>
@ -37,29 +30,36 @@ Data from <%= @resultset[:starts_at] %> to <%= @resultset[:ends_at] %>
<% atad = data.reverse %>
<script type="text/javascript" src="<%= root_path %>javascripts/graph.js"></script>
<%# <script type="text/javascript" src="<%= root_path %>javascripts/metrics.js"></script> %>
<script>
var palette = new Rickshaw.Color.Palette();
var data = [ {
name: "Processed",
color: palette.color(),
data: [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, y: <%= hash[:p] %> },
<% end %> ]
}, {
name: "Failed",
color: palette.color(),
data: [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, y: <%= hash[:f] %> },
<% end %> ]
}, {
name: "Execution Time",
color: palette.color(),
data: [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, y: <%= hash[:ms] %> },
<% end %> ]
name: "Processed",
color: palette.color(),
data: [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, y: <%= hash[:p] %> },
<% end %> ]
}, {
name: "Failed",
color: palette.color(),
data: [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, y: <%= hash[:f] %> },
<% end %>
]
}, {
name: "Execution Time",
color: palette.color(),
data: [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, y: <%= hash[:ms] %> },
<% end %>
]
} ];
// TODO What to do with this? Minutely hover detail with a histogram bar chart?
var histogramData = [ <% atad.each do |hash| %>
{ x: <%= hash[:epoch] %>, hist: <%= hash[:hist] %> },
<% end %> ]
var histogramLabels = <%= Sidekiq::Metrics::Histogram::LABELS.inspect %>;
var timeInterval = 60000;
var graphElement = document.getElementById("realtime");
@ -79,4 +79,14 @@ var y_axis = new Rickshaw.Graph.Axis.Y( {
});
graph.render();
var hoverDetail = new Rickshaw.Graph.HoverDetail( {
graph: graph,
// formatter: function(series, x, y) {
// var date = '<span class="date">' + new Date(x * 1000).toUTCString() + '</span>';
// var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>';
// var content = swatch + series.name + ": " + parseInt(y) + '<br>' + date;
// return content;
// }
} );
</script>