/[cricket]/parse_pg_stat.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /parse_pg_stat.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Fri Sep 13 16:26:53 2002 UTC revision 1.2 by dpavlin, Fri Aug 8 10:49:52 2003 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use DBI;  use DBI;
5    
 my $user = "dpavlin";  
6  my $host = shift @ARGV || '';  my $host = shift @ARGV || '';
7  $host = ";host=$host" if ($host);  $host = ";host=$host" if ($host);
8    my $user = shift @ARGV || "dpavlin";
9    my $pass = shift @ARGV || "";
10    
11  my $sql = "select sum(numbackends),sum(xact_commit),sum(xact_rollback),sum(blks_read),sum(blks_hit) from pg_stat_database";  my $sql = "select sum(numbackends),sum(xact_commit),sum(xact_rollback),sum(blks_read),sum(blks_hit) from pg_stat_database";
12    
13  my $dbh = DBI->connect("DBI:Pg:dbname=template1$host",$user,"") || die $DBI::errstr;  my $dbh = DBI->connect("DBI:Pg:dbname=template1$host",$user,$pass) || die $DBI::errstr;
14  my $sth=$dbh->prepare($sql);  my $sth=$dbh->prepare($sql);
15    
16  if ($sth->execute()) {  if ($sth->execute()) {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26