saving a bit
[pstop.git] / performance_schema / file_summary_by_instance / file_summary_by_instance.go
index 5340ed7..10ef5f4 100644 (file)
@@ -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