Clean start with 2000 jobs
Enqueued 2000 jobs in 23.1921298503876 seconds (86.236/s)
8900 will finish 200 jobs
8900 finished 200 jobs in 20.0055611133575 seconds (9.997/s)
8901 will finish 200 jobs
8901 finished 200 jobs in 20.0034348964691 seconds (9.998/s)
8895 has started 2 workers
2 workers finished 200 jobs each in 20.1112771034241 seconds (19.889/s)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MMojo::Base=strict -Mojo -MMojar::Config -E'$a = Mojar::Config->load(q{matrix.conf})->{matrix}; my $width = @{$$a[0]}; my $height = @$a; n { my @cols = map { [map undef, 1 .. $height] } 1 .. $width; for (my $j = 0; $j < $height; ++$j) { for (my $i = 0; $i < $width; ++$i) { $cols[$i][$j] = $$a[$j][$i] } } } 1000' | |
# 18.3393 wallclock secs (18.31 usr + 0.01 sys = 18.32 CPU) @ 54.59/s (n=1000) | |
perl -MMojo::Base=strict -Mojo -MMojar::Config -E'$a = Mojar::Config->load(q{matrix.conf})->{matrix}; my $width = @{$$a[0]}; my $height = @$a; n { my @cols; push @cols, [] for 1 .. $width; for (my $i = 0; $i < $width; ++$i) { for (my $j = 0; $j < $height; ++$j) { push @{$cols[$i]}, $$a[$j][$i] } } } 1000' | |
# 17.6024 wallclock secs (17.58 usr + 0.00 sys = 17.58 CPU) @ 56.88/s (n=1000) | |
perl -MMojo::Base=strict -Mojo -MMojar::Config -E'$a = Mojar::Config->load(q{matrix.conf})->{matrix}; my $width = @{$$a[0]}; my $height = @$a; n { my @cols = map { my $i = $_; [ map $$a[$_][$i], 0 .. $height - 1] } 0 .. $width - 1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @day = CURDATE(); | |
SELECT FLOOR(DATEDIFF(DATE_SUB(@day, INTERVAL DAYOFWEEK(@day) DAY), '1970-01-01') / 28) AS FWP | |
-- 1970-01-04 is the start of FWP 0 | |
SELECT FLOOR((TO_DAYS(@day) - TO_DAYS('1970-01-04') + 0.01) / 28) AS FWP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MMojo::Base=strict -MMojo::Util=spurt | |
-MMojar::Mysql::Connector=cnf,/home/me/.mysql/super_production-02.cnf | |
-E'my $d = Mojar::Mysql::Connector->new->connection; | |
$d->do(q{FLUSH LOGS}); | |
my $unquiesce = $d->quiesce; | |
spurt $$ => q{/tmp/quiesced}; | |
say q{Quiesced!}; | |
while (-f q{/tmp/quiesced} and $d->ping) { | |
say join q{ | }, $d->selectrow_array(q{SHOW MASTER STATUS}); | |
sleep 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Omits most clutter, but you still need to omit pp first and last | |
@media print { | |
ul.nav-list, ul.nav, div.col-md-4, div.footer, div.hidden-phone { | |
display: none; | |
} | |
div.content { | |
margin-left: 0; | |
padding-left: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Steal bits, but don't take at face value | |
# Originally stolen from https://gist.github.com/nicwolff/1484073 | |
sub _decode { | |
my ($self, $in) = @_; | |
my $log = $self->app->log; | |
my $out = ''; | |
use bytes; # Who said C was dead? | |
my ($i, $length) = (0, length $in); | |
while ($i < $length) { | |
my $b = substr $in, $i, 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use 5.10.1; | |
# http://www.cpan.org/modules/02packages.details.txt.gz | |
my $module_list_filename = '02packages.details.txt'; | |
my @modules; | |
open my $fh, '<', $module_list_filename or die "Failed to open module list: $!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
app->config(hypnotoad => { | |
accepts => 1, | |
clients => 1, | |
listen => ['http://*:8818'], | |
requests => 1, | |
workers => 1 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Mojo::IOLoop; | |
get '/' => sub { | |
my $c = shift; | |
my $log = $c->app->log; | |
Mojo::IOLoop->timer(1 => sub { $log->debug('one') }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: rebus-minion | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Provides Minion Workers for rebus:list jobs | |
# Description: This script with start/stop minion worker |