From 3a573812c015b6b43f0d5fd3b43011cfa962a962 Mon Sep 17 00:00:00 2001 From: inommm Date: Wed, 24 May 2023 14:40:36 +0900 Subject: [PATCH] Remove unnecessary value "unpurged_txns" --- lib/mysql.go | 9 --------- lib/mysql_test.go | 3 --- 2 files changed, 12 deletions(-) diff --git a/lib/mysql.go b/lib/mysql.go index dd0d500..f88db9a 100644 --- a/lib/mysql.go +++ b/lib/mysql.go @@ -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 diff --git a/lib/mysql_test.go b/lib/mysql_test.go index dae8fe8..b4b48af 100644 --- a/lib/mysql_test.go +++ b/lib/mysql_test.go @@ -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) @@ -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) @@ -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)