Skip to content

Instantly share code, notes, and snippets.

jasonc@trask:~$ ruby libxml_sax.rb
Thread ID: 70237214132660
Total Time: 0.14
%total %self total self wait child calls Name
--------------------------------------------------------------------------------
100.00% 0.00% 0.14 0.00 0.00 0.14 1 Global#[No method] (libxml_sax.rb:64} libxml_sax.rb:64
0.14 0.11 0.00 0.03 1/1 LibXML::XML::SaxParser#parse
0.00 0.00 0.00 0.00 1/2 Class#new
0.00 0.00 0.00 0.00 1/1 <Class::LibXML::XML::SaxParser>#file
require 'rubygems'
require 'xml/libxml'
Gmeta
include XML::SaxParser::Callbacks
def initialize
@ganglia = {}
@grid = nil
@cluster = nil
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Net::Stomp;
use Data::Dumper;
while(1) {
eval {
def ganglia_interface(host)
if host[:ganglia] && host[:ganglia][:cluster] && host[:ganglia][:cluster][:interface]
interface = host[:ganglia_cluster][:interface]
else
interface = host[:network][:default_interface]
end
end
def ganglia_ip(host)
[Mon, 26 Oct 2009 21:57:11 +0000] INFO: Starting Chef Run
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: Loading plugin os
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: Loading plugin ruby
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: Loading plugin languages
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: Loading plugin kernel
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: ---- Begin uname -s STDOUT ----
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: Linux
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: ---- End uname -s STDOUT ----
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG: ---- Begin uname -s STDERR ----
[Mon, 26 Oct 2009 21:57:11 +0000] DEBUG:
[Wed, 07 Oct 2009 17:52:06 +0000] ERROR: service[openntpd] (/var/chef/cache/cookbooks/ntp/recipes/default.rb line 28) had an error:
closed stream
/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/provider/service/simple.rb:60:in `close'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/provider/service/simple.rb:60:in `load_current_resource'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/mixin/command.rb:371:in `[]'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/mixin/command.rb:371:in `popen4'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/provider/service/simple.rb:59:in `load_current_resource'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/provider/service/debian.rb:28:in `load_current_resource'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/runner.rb:55:in `build_provider'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/runner.rb:60:in `run_action'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/runner.rb:111:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.12/lib/chef/runner.rb:110:in `each'/usr/lib/r
#!/usr/bin/perl
use warnings;
use strict;
use threads;
my $minthreads = 5;
my $maxthreads = 50;
my $queue_size = 1001;
my @workers;
my @zombies;
#!/us/bin/perl
use warnings;
use strict;
use Working::Daemon;
use IO::Socket;
use JSON::DWIW;
use LWP::UserAgent;
use threads;
use threads::shared;
init_workers();
while(1) {
if ($apache_load > 100 ) {
remove_worker();
} elsif ( $queue_size > 10000 ) {
add_worker();
}
sleep 5;
}
#!/usr/bin/perl
use warnings;
use strict;
use Working::Daemon;
use IO::Socket;
use threads;
use threads::shared;
use Data::Dumper;