X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=performance_schema%2Ffile_summary_by_instance%2Ffile_summary_by_instance.go;h=10ef5f45f93dc42e30be1e0e9c411d85d6206981;hb=84f9a5c41e806461c4193db0c7a0ef652b1b1357;hp=5340ed7c3d87430561f1bbd72d1223beef894370;hpb=38376bf5db9af25660b8183b2c022d079bb2b5ea;p=pstop.git diff --git a/performance_schema/file_summary_by_instance/file_summary_by_instance.go b/performance_schema/file_summary_by_instance/file_summary_by_instance.go index 5340ed7..10ef5f4 100644 --- a/performance_schema/file_summary_by_instance/file_summary_by_instance.go +++ b/performance_schema/file_summary_by_instance/file_summary_by_instance.go @@ -6,8 +6,9 @@ package file_summary_by_instance import ( "database/sql" + "time" - // "github.com/sjmudd/pstop/lib" + "github.com/sjmudd/pstop/lib" ps "github.com/sjmudd/pstop/performance_schema" ) @@ -55,7 +56,7 @@ type File_summary_by_instance struct { } // reset the statistics to current values -func (t *File_summary_by_instance) UpdateInitialValues() { +func (t *File_summary_by_instance) SyncReferenceValues() { t.SetNow() t.initial = make(file_summary_by_instance_rows, len(t.current)) copy(t.initial, t.current) @@ -73,6 +74,7 @@ func (t *File_summary_by_instance) UpdateInitialValues() { // Collect data from the db, then merge it in. func (t *File_summary_by_instance) Collect(dbh *sql.DB) { + start := time.Now() // UPDATE current from db handle t.current = merge_by_table_name(select_fsbi_rows(dbh), t.global_variables) @@ -102,6 +104,7 @@ func (t *File_summary_by_instance) Collect(dbh *sql.DB) { // setup the totals t.totals = t.results.totals() + lib.Logger.Println("File_summary_by_instance.Collect() took:", time.Duration(time.Since(start)).String()) } // return the headings for a table