Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 75 lines (61 sloc) 1.81 kb
#!/usr/bin/perl
use strict;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
use FindBin;
eval { require "$FindBin::Bin/kohalib.pl" };
}
use C4::Context;
use XML::Simple;
use Getopt::Long;
use Data::Dumper;
$| = 1;
# command-line parameters
my $server = 'biblioserver';
my $want_help = 0;
my $result = GetOptions(
'server:s' => \$server,
'h|help' => \$want_help
);
$want_help = 1 if($server ne 'biblioserver' && $server ne 'authorityserver');
if ($want_help) {
print_usage();
exit 0;
}
eval {
my $zcon = C4::Context->Zconn( $server , 1, 1, 0, 'xml',1);
if ($zcon->errcode() != 0) {
die("somthing went wrong: " . $zcon->errmsg())
}
my $rs = $zcon->search_pqf('@attr exp1 1=1 databaseinfo');
my $result_xml;
my $explain;
if($rs){
$result_xml = $rs->record(0)->render();
$explain = XMLin($result_xml);
}
my $indexed = $explain->{databaseInfo}->{recordCount}->{recordCountActual} ;
print "Database: " . $explain->{databaseInfo}->{name} . "\n";
print "Indexed record count: $indexed \n";
my $sth = C4::Context->dbh->prepare('select count(*) from biblio');
$sth->execute;
my ($bibcount) = $sth->fetchrow;
my $sthz = C4::Context->dbh->prepare('select count(*) from zebraqueue where done=0');
$sthz->execute;
my ($zq) = $sthz->fetchrow;
print "Total record count: $bibcount \n";
print sprintf("Unindexed records: %d \n", $bibcount - $indexed) ;
print "Zebraqueue : $zq \n";
};
if ($@) {
warn "Error: $@ \n";
}
sub print_usage {
print <<_USAGE_;
$0: Get information about the Zebra database.
Parameters:
--server either biblioserver(default) or authorityserver
--help or -h show this message.
_USAGE_
}
Jump to Line
Something went wrong with that request. Please try again.