X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=state%2Fstate.go;h=c7168ed64d1aaee7eb8e94091a08aaa9ea366971;hb=c5eb0ee3c462a88cd96a8095063aae6117fce992;hp=33a86ea89cf5ee511e15824c995ed2e23c54ea93;hpb=23d4cb81352e26f3b76b41858988f8aca5797f41;p=pstop.git diff --git a/state/state.go b/state/state.go index 33a86ea..c7168ed 100644 --- a/state/state.go +++ b/state/state.go @@ -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() } }