Skip to content

Commit

Permalink
Merge pull request #15 from mackerelio/remove-unpurged_txns
Browse files Browse the repository at this point in the history
Remove unnecessary value "unpurged_txns"
  • Loading branch information
inommm authored May 24, 2023
2 parents d4dbcb7 + 3a57381 commit 1436346
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
9 changes: 0 additions & 9 deletions lib/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,15 +896,6 @@ func parseInnodbStatus(str string, p map[string]float64) {
isTransaction = true
continue
}
if strings.HasPrefix(line, "Purge done for trx") {
if record[7] == "undo" {
record[7] = ""
}
val := makeBigint(record[6], record[7])
trx := p["innodb_transactions"] - float64(val)
increaseMap(p, "unpurged_txns", fmt.Sprintf("%.f", trx))
continue
}
if strings.HasPrefix(line, "History list length") {
increaseMap(p, "history_list", record[3])
continue
Expand Down
3 changes: 0 additions & 3 deletions lib/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ END OF INNODB MONITOR OUTPUT
assert.EqualValues(t, stat["innodb_sem_wait_time_ms"], 0) // empty
// Innodb Transactions
assert.EqualValues(t, stat["innodb_transactions"], 49154)
assert.EqualValues(t, stat["unpurged_txns"], 4479)
assert.EqualValues(t, stat["history_list"], 775)
assert.EqualValues(t, stat["current_transactions"], 1)
assert.EqualValues(t, stat["active_transactions"], 0)
Expand Down Expand Up @@ -408,7 +407,6 @@ END OF INNODB MONITOR OUTPUT
assert.EqualValues(t, stat["innodb_sem_wait_time_ms"], 0) // empty
// Innodb Transactions
assert.EqualValues(t, stat["innodb_transactions"], 37950123) // empty
assert.EqualValues(t, stat["unpurged_txns"], 14)
assert.EqualValues(t, stat["history_list"], 0)
assert.EqualValues(t, stat["current_transactions"], 5)
assert.EqualValues(t, stat["active_transactions"], 0)
Expand Down Expand Up @@ -598,7 +596,6 @@ END OF INNODB MONITOR OUTPUT
assert.EqualValues(t, stat["innodb_sem_wait_time_ms"], 0) // empty
// Innodb Transactions
assert.EqualValues(t, stat["innodb_transactions"], 507)
assert.EqualValues(t, stat["unpurged_txns"], 2)
assert.EqualValues(t, stat["history_list"], 1)
assert.EqualValues(t, stat["current_transactions"], 3)
assert.EqualValues(t, stat["active_transactions"], 2)
Expand Down

0 comments on commit 1436346

Please sign in to comment.