more cleanups
[pstop.git] / state / state.go
index 33a86ea..c7168ed 100644 (file)
@@ -9,7 +9,7 @@ import (
        "strings"
        "time"
 
-       "github.com/sjmudd/pstop/i_s"
+       "github.com/sjmudd/pstop/i_s/processlist"
        "github.com/sjmudd/pstop/lib"
        ewsgben "github.com/sjmudd/pstop/p_s/events_waits_summary_global_by_event_name"
        essgben "github.com/sjmudd/pstop/p_s/events_stages_summary_global_by_event_name"
@@ -43,11 +43,11 @@ type State struct {
        help                bool
        hostname            string
        fsbi                ps_table.Tabler // ufsbi.File_summary_by_instance
-       tiwsbt              tiwsbt.Table_io_waits_summary_by_table
+       tiwsbt              tiwsbt.Object
        tlwsbt              ps_table.Tabler // tlwsbt.Table_lock_waits_summary_by_table
        ewsgben             ps_table.Tabler // ewsgben.Events_waits_summary_global_by_event_name
        essgben             ps_table.Tabler // essgben.Events_stages_summary_global_by_event_name
-       users               i_s.Processlist
+       users               processlist.Object
        screen              screen.TermboxScreen
        show                Show
        mysql_version       string
@@ -63,11 +63,13 @@ func (state *State) Setup(dbh *sql.DB) {
        state.screen.Initialise()
 
        state.setup_instruments.EnableMutexMonitoring(dbh)
+       state.setup_instruments.EnableStageMonitoring(dbh)
+
        _, variables := lib.SelectAllGlobalVariablesByVariableName(state.dbh)
        // setup to their initial types/values
        state.fsbi = fsbi.NewFileSummaryByInstance(variables)
-       state.tlwsbt = new(tlwsbt.Table_lock_waits_summary_by_table)
-       state.ewsgben = new(ewsgben.Table_events_waits_summary_global_by_event_name)
+       state.tlwsbt = new(tlwsbt.Object)
+       state.ewsgben = new(ewsgben.Object)
        state.essgben = new(essgben.Object)
 
        state.want_relative_stats = true // we show info from the point we start collecting data
@@ -481,7 +483,7 @@ func (state *State) ScreenSetSize(width, height int) {
 func (state *State) Cleanup() {
        state.screen.Close()
        if state.dbh != nil {
-               state.setup_instruments.Restore(state.dbh)
+               state.setup_instruments.RestoreConfiguration(state.dbh)
                _ = state.dbh.Close()
        }
 }