From a0b3021bdcf76859054fda8e30abb3ed47749e83 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Wed, 29 May 2024 08:10:00 -0700 Subject: Trim trailing whitespace Start trimming trailing whitespace, but limit the blast radius to a handful of file types. --- scripts/metrics/viewer_asset_logs.py | 8 ++++---- scripts/metrics/viewerstats.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'scripts/metrics') diff --git a/scripts/metrics/viewer_asset_logs.py b/scripts/metrics/viewer_asset_logs.py index bd996dff79..4fb9fd15b3 100644 --- a/scripts/metrics/viewer_asset_logs.py +++ b/scripts/metrics/viewer_asset_logs.py @@ -63,7 +63,7 @@ def update_stats(stats,rec): # handle fps record as special case pass else: - #print "field",field + #print "field",field stats.setdefault(field,{}) type_stats = stats.get(field) newcount = val["resp_count"] @@ -75,9 +75,9 @@ def update_stats(stats,rec): type_stats["sum_bytes"] = type_stats.get("sum_bytes",0) + val["resp_count"] * val.get("resp_mean_bytes",0) type_stats["enqueued"] = type_stats.get("enqueued",0) + val["enqueued"] type_stats["dequeued"] = type_stats.get("dequeued",0) + val["dequeued"] - - - + + + if __name__ == "__main__": parser = argparse.ArgumentParser(description="process metric xml files for viewer asset fetching") diff --git a/scripts/metrics/viewerstats.py b/scripts/metrics/viewerstats.py index e64343329c..41bc493aaa 100755 --- a/scripts/metrics/viewerstats.py +++ b/scripts/metrics/viewerstats.py @@ -144,7 +144,7 @@ def get_used_strings(root_dir): #if ext not in [".cpp", ".hpp", ".h", ".xml"]: # skipped_ext.add(ext) # continue - + full_name = os.path.join(dir_name,fname) with open(full_name,"r") as f: @@ -158,8 +158,8 @@ def get_used_strings(root_dir): print("skipped extensions", skipped_ext) print("got used_str", len(used_str)) return used_str - - + + if __name__ == "__main__": parser = argparse.ArgumentParser(description="process tab-separated table containing viewerstats logs") @@ -184,7 +184,7 @@ if __name__ == "__main__": if args.preferences: print("\nSETTINGS.XML") settings_sd = parse_settings_xml("settings.xml") - #for skey,svals in settings_sd.items(): + #for skey,svals in settings_sd.items(): # print skey, "=>", svals (all_str,_,_,_) = show_stats_by_key(recs,["preferences","settings"],settings_sd) print() @@ -211,16 +211,16 @@ if __name__ == "__main__": print("PREFIX_USED", len(prefix_used), ",".join(list(prefix_used))) print() unref_strings = unref_strings - prefix_used - + print("\nUNREF_IN_CODE " + str(len(unref_strings)) + "\n") print("\n".join(list(unref_strings))) settings_str = read_raw_settings_xml("settings.xml") # Do this via direct string munging to generate minimal changeset settings_edited = remove_settings(settings_str,unref_strings) write_raw_settings_xml("settings.xml.edit",settings_edited) - - - + + + -- cgit v1.2.3