Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #448 from CPAN-API/mi/es2
Elasticsearch 2.x
- Loading branch information
Showing
226 changed files
with
7,132 additions
and
5,898 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
use strict; | ||
use warnings; | ||
use JSON; | ||
use Cpanel::JSON::XS; | ||
use File::Find; | ||
|
||
my @files; | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
# Munin runs this as metacpan user, but with root's env | ||
# it's only for production so path is hard coded | ||
|
||
my $config_mode = 0; | ||
$config_mode = 1 if $ARGV[0] && $ARGV[0] eq 'config'; | ||
|
||
if($config_mode) { | ||
|
||
# Dump this (though we supported dynamic below) so it's faster | ||
print <<'EOF'; | ||
graph_title Minion Queue stats | ||
graph_vlabel count | ||
graph_category metacpan_api | ||
graph_info What's happening in the Minion queue | ||
workers_inactive.label Inactive workers | ||
workers_active.label Active workers | ||
jobs_inactive.label Inactive jobs | ||
jobs_active.label Active jobs | ||
jobs_failed.label Failed jobs | ||
jobs_finished.label Finished jobs | ||
EOF | ||
|
||
exit; | ||
} | ||
|
||
# Get the stats | ||
my $stats_report = `/home/metacpan/bin/metacpan-api-carton-exec bin/queue.pl minion job -s`; | ||
|
||
my @lines = split("\n", $stats_report); | ||
|
||
for my $line (@lines) { | ||
my ($label, $num) = split ':', $line; | ||
|
||
$num =~ s/\D//g; | ||
|
||
my $key = lc($label); # Was 'Inactive jobs' | ||
|
||
# Swap type and status around so idle_jobs becomes jobs_idle | ||
$key =~ s/(\w+)\s+(\w+)/$2_$1/g; | ||
|
||
if( $config_mode ) { | ||
# config | ||
print "${key}.label $label\n"; | ||
|
||
} else { | ||
# results | ||
print "${key}.value $num\n" if $num; | ||
} | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#!/bin/sh | ||
|
||
`dirname "$0"`/run prove -lv "$@" | ||
export EMAIL_SENDER_TRANSPORT=Test | ||
export ES=localhost:9900 | ||
export METACPAN_SERVER_CONFIG_LOCAL_SUFFIX=testing | ||
|
||
`dirname "$0"`/run prove -It/lib -lvr "$@" |
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
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
Oops, something went wrong.