Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/Munin/Master/Update.pm
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ sub _db_stats {
$self->{runid} = time() unless $self->{runid};
my $runid = $self->{runid};
my $dbh = $self->{dbh} || get_dbh(); # Reuse any existing connection, or open a temporary one
my $sth_i = $dbh->prepare_cached("INSERT INTO stats (runid, tstp, type, name, duration) VALUES (?, ?, ?, ?, ?);");
$sth_i->execute($runid, time(), $type, $name, $duration);
my $sth_i = $dbh->prepare_cached("INSERT INTO stats (runid, tstp, type, name, duration) VALUES (?, CURRENT_TIMESTAMP, ?, ?, ?);");
$sth_i->execute($runid, $type, $name, $duration);
}


Expand Down Expand Up @@ -275,7 +275,7 @@ sub _db_init {
$dbh->do("CREATE UNIQUE INDEX IF NOT EXISTS pk_state ON state (type, id)");

# Munin stats
$dbh->do("CREATE TABLE IF NOT EXISTS stats (runid VARCHAR NOT NULL, tstp DATETIME, type VARCHAR, name VARCHAR, duration NUMERIC)");
$dbh->do("CREATE TABLE IF NOT EXISTS stats (runid VARCHAR NOT NULL, tstp TIMESTAMPTZ, type VARCHAR, name VARCHAR, duration NUMERIC)");

# Initialise the grp _root_ node if not present
unless ($dbh->selectrow_array("SELECT count(1) FROM grp WHERE id = 0")) {
Expand Down Expand Up @@ -342,4 +342,3 @@ Constructor.
This is where all the work gets done.

=back