Hello community,

here is the log from the commit of package perl-Minion for openSUSE:Factory 
checked in at 2018-04-19 15:33:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Minion (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Minion.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Minion"

Thu Apr 19 15:33:07 2018 rev:42 rq:598446 version:9.02

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Minion/perl-Minion.changes  2018-04-16 
12:52:42.404998235 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Minion.new/perl-Minion.changes     
2018-04-19 15:33:09.402011098 +0200
@@ -1,0 +2,6 @@
+Thu Apr 19 05:35:16 UTC 2018 - [email protected]
+
+- updated to 9.02
+   see /usr/share/doc/packages/perl-Minion/Changes
+
+-------------------------------------------------------------------

Old:
----
  Minion-9.0.tar.gz

New:
----
  Minion-9.02.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Minion.spec ++++++
--- /var/tmp/diff_new_pack.MP6npX/_old  2018-04-19 15:33:10.005986191 +0200
+++ /var/tmp/diff_new_pack.MP6npX/_new  2018-04-19 15:33:10.009986026 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Minion
-Version:        9.0
+Version:        9.02
 Release:        0
 %define cpan_name Minion
 Summary:        Job queue

++++++ Minion-9.0.tar.gz -> Minion-9.02.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/Changes new/Minion-9.02/Changes
--- old/Minion-9.0/Changes      2018-04-15 23:02:18.000000000 +0200
+++ new/Minion-9.02/Changes     2018-04-18 10:45:59.000000000 +0200
@@ -1,4 +1,14 @@
 
+9.02  2018-04-18
+  - Changed 24 hour history graph on Mojolicious::Plugin::Minion::Admin
+    dashboard to refresh in 10 minute intervals.
+  - Changed daily history data to include an epoch value instead of a day.
+  - Fixed a few ordering bugs in history methods.
+
+9.01  2018-04-17
+  - Improved 24 hour history graph to refresh automatically every 5 minutes in
+    Mojolicious::Plugin::Minion::Admin. (s1037989)
+
 9.0  2018-04-15
   - Replaced queue, state and task options of list_jobs method in
     Minion::Backend::Pg with queues, states and tasks options.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/META.json new/Minion-9.02/META.json
--- old/Minion-9.0/META.json    2018-04-15 23:43:15.000000000 +0200
+++ new/Minion-9.02/META.json   2018-04-18 10:52:27.000000000 +0200
@@ -54,6 +54,6 @@
       },
       "x_IRC" : "irc://irc.perl.org/#mojo"
    },
-   "version" : "9.0",
+   "version" : "9.02",
    "x_serialization_backend" : "JSON::PP version 2.97001"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/META.yml new/Minion-9.02/META.yml
--- old/Minion-9.0/META.yml     2018-04-15 23:43:15.000000000 +0200
+++ new/Minion-9.02/META.yml    2018-04-18 10:52:27.000000000 +0200
@@ -27,5 +27,5 @@
   homepage: http://mojolicious.org
   license: http://www.opensource.org/licenses/artistic-license-2.0
   repository: https://github.com/kraih/minion.git
-version: '9.0'
+version: '9.02'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/lib/Minion/Backend/Pg.pm 
new/Minion-9.02/lib/Minion/Backend/Pg.pm
--- old/Minion-9.0/lib/Minion/Backend/Pg.pm     2018-04-15 22:57:46.000000000 
+0200
+++ new/Minion-9.02/lib/Minion/Backend/Pg.pm    2018-04-18 10:39:39.000000000 
+0200
@@ -54,14 +54,14 @@
   my $self = shift;
 
   my $daily = $self->pg->db->query(
-    "select extract(day from ts) as day, extract(hour from ts) as hour,
+    "select extract(epoch from ts) as epoch, extract(hour from ts) as hour,
        coalesce(failed_jobs, 0) as failed_jobs,
        coalesce(finished_jobs, 0) as finished_jobs
      from (
        select extract (day from finished) as day,
          extract(hour from finished) as hour,
-         count(case when state = 'failed' then 1 end) as failed_jobs,
-         count(case when state = 'finished' then 1 end) as finished_jobs
+         count(*) filter (where state = 'failed') as failed_jobs,
+         count(*) filter (where state = 'finished') as finished_jobs
        from minion_jobs
        where finished > now() - interval '23 hours'
        group by day, hour
@@ -69,7 +69,7 @@
        select *
        from generate_series(now() - interval '23 hour', now(), '1 hour') as ts
      ) as s on extract(hour from ts) = j.hour and extract(day from ts) = j.day
-     order by day, hour asc"
+     order by epoch asc"
   )->hashes->to_array;
 
   return {daily => $daily};
@@ -502,7 +502,8 @@
 
 =item daily
 
-  daily => [{day => 12, hour => 20, finished_jobs => 95, failed_jobs => 2}, 
...]
+  daily =>
+    [{epoch => 12345, hour => 20, finished_jobs => 95, failed_jobs => 2}, ...]
 
 Hourly counts for processed jobs from the past day.
 
@@ -680,7 +681,7 @@
 
   names => ['foo', 'bar']
 
-List only locks with this name.
+List only locks with these names.
 
 =back
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/lib/Minion/Backend.pm 
new/Minion-9.02/lib/Minion/Backend.pm
--- old/Minion-9.0/lib/Minion/Backend.pm        2018-04-15 22:17:32.000000000 
+0200
+++ new/Minion-9.02/lib/Minion/Backend.pm       2018-04-18 10:40:06.000000000 
+0200
@@ -12,7 +12,7 @@
 sub finish_job { croak 'Method "finish_job" not implemented by subclass' }
 
 # TODO: This method will croak after the experimentation period
-sub history { {day => []} }
+sub history { {daily => []} }
 
 sub list_jobs    { croak 'Method "list_jobs" not implemented by subclass' }
 sub list_locks   { croak 'Method "list_locks" not implemented by subclass' }
@@ -243,7 +243,8 @@
 
 =item daily
 
-  daily => [{day => 12, hour => 20, finished_jobs => 95, failed_jobs => 2}, 
...]
+  daily =>
+    [{epoch => 12345, hour => 20, finished_jobs => 95, failed_jobs => 2}, ...]
 
 Hourly counts for processed jobs from the past day.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/lib/Minion.pm 
new/Minion-9.02/lib/Minion.pm
--- old/Minion-9.0/lib/Minion.pm        2018-04-15 22:17:23.000000000 +0200
+++ new/Minion-9.02/lib/Minion.pm       2018-04-18 10:40:27.000000000 +0200
@@ -18,7 +18,7 @@
 has remove_after  => 172800;
 has tasks         => sub { {} };
 
-our $VERSION = '9.0';
+our $VERSION = '9.02';
 
 sub add_task { ($_[0]->tasks->{$_[1]} = $_[2]) and return $_[0] }
 
@@ -524,7 +524,8 @@
 
 =item daily
 
-  daily => [{day => 12, hour => 20, finished_jobs => 95, failed_jobs => 2}, 
...]
+  daily =>
+    [{epoch => 12345, hour => 20, finished_jobs => 95, failed_jobs => 2}, ...]
 
 Hourly counts for processed jobs from the past day.
 
@@ -870,6 +871,8 @@
 
 Paul Williams
 
+Stefan Adams
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/lib/Mojolicious/Plugin/Minion/Admin.pm 
new/Minion-9.02/lib/Mojolicious/Plugin/Minion/Admin.pm
--- old/Minion-9.0/lib/Mojolicious/Plugin/Minion/Admin.pm       2018-04-14 
03:08:35.000000000 +0200
+++ new/Minion-9.02/lib/Mojolicious/Plugin/Minion/Admin.pm      2018-04-18 
01:07:04.000000000 +0200
@@ -18,9 +18,10 @@
   push @{$app->renderer->paths}, $resources->child('templates')->to_string;
 
   # Routes
-  $prefix->get('/'      => \&_dashboard)->name('minion_dashboard');
-  $prefix->get('/stats' => \&_stats)->name('minion_stats');
-  $prefix->get('/jobs'  => \&_list_jobs)->name('minion_jobs');
+  $prefix->get('/'        => \&_dashboard)->name('minion_dashboard');
+  $prefix->get('/stats'   => \&_stats)->name('minion_stats');
+  $prefix->get('/history' => \&_history)->name('minion_history');
+  $prefix->get('/jobs'    => \&_list_jobs)->name('minion_jobs');
   $prefix->patch('/jobs' => \&_manage_jobs)->name('minion_manage_jobs');
   $prefix->get('/locks' => \&_list_locks)->name('minion_locks');
   $prefix->delete('/locks' => \&_unlock)->name('minion_unlock');
@@ -28,11 +29,16 @@
 }
 
 sub _dashboard {
-  my $c = shift;
+  my $c       = shift;
   my $history = $c->minion->backend->history;
   $c->render('minion/dashboard', history => $history);
 }
 
+sub _history {
+  my $c = shift;
+  $c->render(json => $c->minion->history);
+}
+
 sub _list_jobs {
   my $c = shift;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Minion-9.0/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
 
new/Minion-9.02/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
--- 
old/Minion-9.0/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
   2018-04-15 22:19:49.000000000 +0200
+++ 
new/Minion-9.02/lib/Mojolicious/Plugin/Minion/resources/templates/minion/dashboard.html.ep
  2018-04-18 10:45:00.000000000 +0200
@@ -3,6 +3,7 @@
 % content_for head => begin
   <script>
     var chart;
+    var historychart;
     var backlog = 0;
     function pageStats(data) {
       $('.minion-stats-uptime').text(Math.round(data.uptime / 86400));
@@ -32,22 +33,35 @@
       }
       setTimeout(updateBacklogChart, 1000);
     }
+    function updateHistoryChart() {
+      $.get('<%= url_for 'minion_history' %>').done(function (data) {
+        var hour;
+        var historylog = [];
+        for (hour = 0; hour < data.daily.length; hour++) { 
+          historylog.push({
+            x: data.daily[hour].hour,
+            y: data.daily[hour].finished_jobs + data.daily[hour].failed_jobs
+          });
+        }
+        if (historychart == null) {
+          historychart = $('#history-chart').epoch({
+            type: 'bar',
+            tickFormats: {
+              bottom: function (d) { return ('0' + d).slice(-2) + ':00' }
+            },
+            data: [{
+              label: 'processed',
+              values: historylog
+            }]
+          });
+        }
+        else { historychart.update([{label: 'processed', values: historylog}]) 
}
+        setTimeout(updateHistoryChart, 1000 * 60 * 10);
+      }).fail(function () { setTimeout(updateHistoryChart, 1000 * 60) });
+    }
     $(function () {
       updateBacklogChart();
-      $('#history-chart').epoch({
-        type: 'bar',
-        data: [{
-          label: 'processed',
-          values: [
-            % for my $hour (@{$history->{daily}}) {
-              {
-                x: '<%= sprintf '%02d:00', $hour->{hour} %>',
-                y: <%= $hour->{finished_jobs} + $hour->{failed_jobs} %>
-              },
-            % }
-          ]
-        }]
-      });
+      updateHistoryChart();
     });
   </script>
 % end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Minion-9.0/t/pg.t new/Minion-9.02/t/pg.t
--- old/Minion-9.0/t/pg.t       2018-04-15 23:05:09.000000000 +0200
+++ new/Minion-9.02/t/pg.t      2018-04-18 10:44:42.000000000 +0200
@@ -290,20 +290,20 @@
 $worker->unregister;
 my $history = $minion->history;
 is $#{$history->{daily}}, 23, 'data for 24 hours';
-is $history->{daily}[-1]{finished_jobs}, 3, 'one failed job in the last hour';
-is $history->{daily}[-1]{failed_jobs}, 1,
+is $history->{daily}[-1]{finished_jobs} + $history->{daily}[-2]{finished_jobs},
+  3, 'one failed job in the last hour';
+is $history->{daily}[-1]{failed_jobs} + $history->{daily}[-2]{failed_jobs}, 1,
   'three finished jobs in the last hour';
 is $history->{daily}[0]{finished_jobs}, 0, 'no finished jobs 24 hours ago';
 is $history->{daily}[0]{failed_jobs},   0, 'no failed jobs 24 hours ago';
-ok defined $history->{daily}[0]{day},   'has day value';
-ok defined $history->{daily}[0]{hour},  'has hour value';
-ok defined $history->{daily}[1]{day},   'has day value';
-ok defined $history->{daily}[1]{hour},  'has hour value';
-ok defined $history->{daily}[12]{day},  'has day value';
-ok defined $history->{daily}[12]{hour}, 'has hour value';
-ok defined $history->{daily}[-1]{day},  'has day value';
-ok defined $history->{daily}[-1]{hour}, 'has hour value';
-isnt $history->{daily}[0]{hour}, $history->{daily}[1]{hours}, 'different hour';
+ok defined $history->{daily}[0]{epoch},  'has epoch value';
+ok defined $history->{daily}[0]{hour},   'has hour value';
+ok defined $history->{daily}[1]{epoch},  'has epoch value';
+ok defined $history->{daily}[1]{hour},   'has hour value';
+ok defined $history->{daily}[12]{epoch}, 'has epoch value';
+ok defined $history->{daily}[12]{hour},  'has hour value';
+ok defined $history->{daily}[-1]{epoch}, 'has epoch value';
+ok defined $history->{daily}[-1]{hour},  'has hour value';
 $job->remove;
 
 # List jobs
@@ -632,7 +632,7 @@
 $job->perform;
 is $job->info->{state}, 'finished', 'right state';
 ok $job->note(yada => ['works']), 'added metadata';
-ok !$minion->backend->note(-1, yada => ['failed']), 'not added metadata';
+ok !$minion->backend->note(-1, {yada => ['failed']}), 'not added metadata';
 my $notes = {
   foo  => [4, 5, 6],
   bar  => {baz => [1, 2, 3]},


Reply via email to