X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=performance_schema%2Ffile_summary_by_instance%2Ffile_summary_by_instance_row.go;h=6c10ef40362e53c7ba5d73c38a603efaa1c0fcd3;hb=6befaeecc9554be09177e699544d9573e699f1c8;hp=20bd6060615cf82ec2adf4a7217f243ae737248c;hpb=fdd0ec702b869519f99f005358b50802191923ab;p=pstop.git diff --git a/performance_schema/file_summary_by_instance/file_summary_by_instance_row.go b/performance_schema/file_summary_by_instance/file_summary_by_instance_row.go index 20bd606..6c10ef4 100644 --- a/performance_schema/file_summary_by_instance/file_summary_by_instance_row.go +++ b/performance_schema/file_summary_by_instance/file_summary_by_instance_row.go @@ -209,6 +209,10 @@ func (t file_summary_by_instance_row) simple_name(global_variables map[string]st path := t.FILE_NAME + if cached_result, err := get_from_cache(path); err == nil { + return cached_result + } + // FIXME and make this work. // re4 := regexp.MustCompile(re_encoded) // if m4 := re4.FindStringSubmatch(path); m4 != nil { @@ -222,33 +226,33 @@ func (t file_summary_by_instance_row) simple_name(global_variables map[string]st if m1 := re_table_file.FindStringSubmatch(path); m1 != nil { // we may match temporary tables so check for them if m2 := re_temp_table.FindStringSubmatch(m1[2]); m2 != nil { - return "" + return save_to_cache(path, "") } // we may match partitioned tables so check for them if m3 := re_part_table.FindStringSubmatch(m1[2]); m3 != nil { - return m1[1] + "." + m3[1] // . (less partition info) + return save_to_cache(path, m1[1]+"."+m3[1]) // .
(less partition info) } - return m1[1] + "." + m1[2] // .
+ return save_to_cache(path, m1[1]+"."+m1[2]) // .
} if re_ibdata.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_redo_log.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_binlog.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_db_opt.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_slowlog.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_auto_cnf.MatchString(path) == true { - return "" + return save_to_cache(path, "") } // relay logs are a bit complicated. If a full path then easy to // identify,but if a relative path we may need to add $datadir, @@ -261,19 +265,19 @@ func (t file_summary_by_instance_row) simple_name(global_variables map[string]st } re_relay_log := relay_log + `\.(\d{6}|index)$` if regexp.MustCompile(re_relay_log).MatchString(path) == true { - return "" + return save_to_cache(path, "") } } if re_pid_file.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_error_msg.MatchString(path) == true { - return "" + return save_to_cache(path, "") } if re_charset.MatchString(path) == true { - return "" + return save_to_cache(path, "") } - return path + return save_to_cache(path, path) } // Convert the imported "table" to a merged one with merged data.