Skip to content

Commit

Permalink
Per review feedback, ignore just timing, not all I/O stats
Browse files Browse the repository at this point in the history
  • Loading branch information
msakrejda committed Jan 4, 2021
1 parent 921349c commit 2e935fa
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions input/postgres/statements.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,7 @@ func GetStatements(server *state.Server, logger *util.Logger, db *sql.DB, global

statements[key] = stmt
}
if ignoreIOStats(postgresVersion, receivedQuery) {
stats.SharedBlksHit = 0
stats.SharedBlksRead = 0
stats.SharedBlksDirtied = 0
stats.SharedBlksWritten = 0

stats.LocalBlksHit = 0
stats.LocalBlksRead = 0
stats.LocalBlksDirtied = 0
stats.LocalBlksWritten = 0

stats.TempBlksRead = 0
stats.TempBlksWritten = 0

if ignoreIOTiming(postgresVersion, receivedQuery) {
stats.BlkReadTime = 0
stats.BlkWriteTime = 0
}
Expand All @@ -242,9 +229,9 @@ func GetStatements(server *state.Server, logger *util.Logger, db *sql.DB, global
return statements, statementTexts, statementStats, nil
}

func ignoreIOStats(postgresVersion state.PostgresVersion, receivedQuery null.String) bool {
func ignoreIOTiming(postgresVersion state.PostgresVersion, receivedQuery null.String) bool {
// Currently, Aurora gives wildly incorrect blk_read_time and blk_write_time values
// for utility statements; ignore I/O stats for these altogether.
// for utility statements; ignore I/O timing in this situation.
if !postgresVersion.IsAwsAurora || !receivedQuery.Valid {
return false
}
Expand Down

0 comments on commit 2e935fa

Please sign in to comment.