Skip to content

Commit

Permalink
Merge pull request #16 from film42/gt/replay
Browse files Browse the repository at this point in the history
User replay lag to measure byte lag
  • Loading branch information
film42 authored Nov 13, 2020
2 parents b5fb97e + 2df684a commit ec4cd17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ FROM
log.Fatalln("Error getting pg_current_wal_lsn:", err)
}

pgLastWalLsn, err := ds.getPgLastWalReceiveLsn()
pgLastWalLsn, err := ds.getPgLastWalReplayLsn()
if err != nil {
log.Fatalln("Error getting pg_last_wal_lsn:", err)
log.Fatalln("Error getting pg_last_wal_replay_lsn:", err)
}
// Skip the byte lag checks if the last wal lsn is empty
if pgLastWalLsn == "" {
Expand Down Expand Up @@ -304,9 +304,9 @@ func (ds *pgDataSource) getPgCurrentWalLsn(role string) (string, error) {
}
}

func (ds *pgDataSource) getPgLastWalReceiveLsn() (string, error) {
func (ds *pgDataSource) getPgLastWalReplayLsn() (string, error) {
pgLastWalLsn := null.String{}
err := ds.DB.Get(&pgLastWalLsn, "select pg_last_wal_receive_lsn()")
err := ds.DB.Get(&pgLastWalLsn, "select pg_last_wal_replay_lsn()")
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func main() {
flag.Parse()

if *versionPtr {
fmt.Println("1.1.2")
fmt.Println("1.2.0")
return
}

Expand Down

0 comments on commit ec4cd17

Please sign in to comment.