--- loncom/debugging_tools/memcached_dump.pl 2016/02/21 17:29:33 1.1 +++ loncom/debugging_tools/memcached_dump.pl 2017/05/07 12:58:12 1.2 @@ -1,11 +1,11 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # # The LearningOnline Network # # memcached_dump.pl - dump key => values from Memcached to standard output, # unescaping keys if asked to do so. # -# $Id: memcached_dump.pl,v 1.1 2016/02/21 17:29:33 raeburn Exp $ +# $Id: memcached_dump.pl,v 1.2 2017/05/07 12:58:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,8 @@ use Data::Dumper; use Getopt::Long; use lib '/home/httpd/lib/perl/'; use LONCAPA; +use Apache::lonnet; + $SIG{'__WARN__'} = sub { warn $_[0] unless (caller eq "Cache::Memcached"); }; @@ -94,6 +96,9 @@ foreach my $line (split(/\r\n/,$items)) } my $count = 0; +my @possdoms = &Apache::lonnet::current_machine_domains(); +my %machinedoms = (); +map { $machinedoms{$_} = 1; } @possdoms; foreach my $container (sort(keys(%containers))) { my $result = $memd->stats("cachedump $container 0"); my $contents = $result->{hosts}->{$instance}->{"cachedump $container 0"}; @@ -114,6 +119,12 @@ foreach my $container (sort(keys(%contai } next unless($match); } + if ($name =~ /^ltitools/) { + my ($dom) = (&unescape($escname) =~/:([^:]+)$/); + if (($dom eq '') || (!$machinedoms{$dom})) { + next; + } + } my $val = $memd->get($escname); $count ++; if ($showsize) {