[LON-CAPA-cvs] cvs: loncom /debugging_tools memcached_dump.pl

raeburn raeburn at source.lon-capa.org
Sun May 7 08:58:12 EDT 2017


raeburn		Sun May  7 12:58:12 2017 EDT

  Modified files:              
    /loncom/debugging_tools	memcached_dump.pl 
  Log:
  - cached data for ltitools:domain key only displayed for machine's domains.
  
  
Index: loncom/debugging_tools/memcached_dump.pl
diff -u loncom/debugging_tools/memcached_dump.pl:1.1 loncom/debugging_tools/memcached_dump.pl:1.2
--- loncom/debugging_tools/memcached_dump.pl:1.1	Sun Feb 21 17:29:33 2016
+++ loncom/debugging_tools/memcached_dump.pl	Sun May  7 12:58:12 2017
@@ -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 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 @@
 }
 
 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 @@
               } 
               next unless($match); 
           }
+          if ($name =~ /^ltitools/) {
+              my ($dom) = (&unescape($escname) =~/:([^:]+)$/);
+              if (($dom eq '') || (!$machinedoms{$dom})) {
+                  next;
+              }
+          }
           my $val = $memd->get($escname);
           $count ++;
           if ($showsize) {




More information about the LON-CAPA-cvs mailing list