• Home
  • Raw
  • Download

Lines Matching full:summary

7 This is a utility to build a summary of the given directory. and save to a json
13 -p PATH Path to build directory summary.
60 # Minimum disk space should be available after saving the summary file.
73 """Get a unique file path to save the directory summary json string.
75 @param path: The directory path to save the summary file to.
78 # Make sure the summary file name is unique.
104 # Make sure the path ends with `/` so the root key of summary json is always
113 """Delete files/directories only exists in old summary.
115 When the new summary is final, i.e., it's built from the final result
119 @param summary_old: Old directory summary.
120 @param summary_new: New directory summary.
133 # Remove the file from the summary as it can be ignored.
143 # If `name` is a directory in the old summary, but a file in the new
144 # summary, delete the entry in the old summary.
151 def _relocate_summary(result_dir, summary_file, summary): argument
152 """Update the given summary with the path relative to the result_dir.
155 @param summary_file: Path to the summary file.
156 @param summary: A directory summary inside the given result_dir or its
158 @return: An updated summary with the path relative to the result_dir.
163 return summary
177 # Add files in summary to child.
178 for info in summary.files:
193 directory summary.
200 merged_summary: The merged directory summary of the given path.
201 files: All summary files in the given path, including
205 # Find all directory summary files and sort them by the time stamp in file
216 summary = result_info.load_summary_json_file(summary_file)
217 summary = _relocate_summary(path, summary_file, summary)
218 all_summaries.append(summary)
220 utils_lib.LOG('Failed to load summary file %s Error: %s' %
225 for summary in all_summaries[1:]:
226 merged_summary.merge(summary)
229 # If there is no directory summary collected, default client_collected_bytes
235 # Get the summary of current directory
247 def _throttle_results(summary, max_result_size_KB): argument
250 @param summary: A ResultInfo object containing result summary.
253 if throttler_lib.check_throttle_limit(summary, max_result_size_KB):
257 (utils_lib.get_size_string(summary.trimmed_size),
261 args = {'summary': summary,
298 old_size = summary.trimmed_size
302 del args_without_summary['summary']
306 if throttler_lib.check_throttle_limit(summary, max_result_size_KB):
312 new_size = summary.trimmed_size
341 help='Path to build directory summary.')
347 help='-d to delete all result summary files in the '
355 @param path: Path to build directory summary.
366 summary = result_info.ResultInfo.build_from_path(path)
367 summary_json = json.dumps(summary)
375 'Not enough disk space after saving the summary file. '
376 'Available free disk: %s bytes. Summary file size: %s bytes.' %
381 utils_lib.LOG('Directory summary of %s is saved to file %s.' %
384 if max_size_KB > 0 and summary.trimmed_size > 0:
385 old_size = summary.trimmed_size
392 _throttle_results(summary, max_size_KB)
393 if summary.trimmed_size < old_size:
394 # Files are throttled, save the updated summary file.
395 utils_lib.LOG('Overwrite the summary file: %s' % summary_file)
396 result_info.save_summary(summary, summary_file)
400 """Delete all directory summary files in the given directory.
402 This is to cleanup the directory so no summary files are left behind to
405 @param path: Path to cleanup directory summary.
407 # Only summary files directly under the `path` needs to be cleaned.
409 for summary in summary_files:
411 os.remove(summary)
413 utils_lib.LOG('Failed to delete summary: %s. Error: %s' %
414 (summary, e))