• 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.
73 # Minimum disk space should be available after saving the summary file.
86 """Get a unique file path to save the directory summary json string.
88 @param path: The directory path to save the summary file to.
91 # Make sure the summary file name is unique.
117 # Make sure the path ends with `/` so the root key of summary json is always
126 """Delete files/directories only exists in old summary.
128 When the new summary is final, i.e., it's built from the final result
132 @param summary_old: Old directory summary.
133 @param summary_new: New directory summary.
146 # Remove the file from the summary as it can be ignored.
156 # If `name` is a directory in the old summary, but a file in the new
157 # summary, delete the entry in the old summary.
164 def _relocate_summary(result_dir, summary_file, summary): argument
165 """Update the given summary with the path relative to the result_dir.
168 @param summary_file: Path to the summary file.
169 @param summary: A directory summary inside the given result_dir or its
171 @return: An updated summary with the path relative to the result_dir.
176 return summary
190 # Add files in summary to child.
191 for info in summary.files:
206 directory summary.
213 merged_summary: The merged directory summary of the given path.
214 files: All summary files in the given path, including
218 # Find all directory summary files and sort them by the time stamp in file
229 summary = result_info.load_summary_json_file(summary_file)
230 summary = _relocate_summary(path, summary_file, summary)
231 all_summaries.append(summary)
233 utils_lib.LOG('Failed to load summary file %s Error: %s' %
238 for summary in all_summaries[1:]:
239 merged_summary.merge(summary)
242 # If there is no directory summary collected, default client_collected_bytes
248 # Get the summary of current directory
260 def _throttle_results(summary, max_result_size_KB): argument
263 @param summary: A ResultInfo object containing result summary.
266 if throttler_lib.check_throttle_limit(summary, max_result_size_KB):
270 (utils_lib.get_size_string(summary.trimmed_size),
274 args = {'summary': summary,
311 old_size = summary.trimmed_size
315 del args_without_summary['summary']
319 if throttler_lib.check_throttle_limit(summary, max_result_size_KB):
325 new_size = summary.trimmed_size
354 help='Path to build directory summary.')
360 help='-d to delete all result summary files in the '
368 @param path: Path to build directory summary.
379 summary = result_info.ResultInfo.build_from_path(path)
380 summary_json = json.dumps(summary)
388 'Not enough disk space after saving the summary file. '
389 'Available free disk: %s bytes. Summary file size: %s bytes.' %
394 utils_lib.LOG('Directory summary of %s is saved to file %s.' %
397 if max_size_KB > 0 and summary.trimmed_size > 0:
398 old_size = summary.trimmed_size
405 _throttle_results(summary, max_size_KB)
406 if summary.trimmed_size < old_size:
407 # Files are throttled, save the updated summary file.
408 utils_lib.LOG('Overwrite the summary file: %s' % summary_file)
409 result_info.save_summary(summary, summary_file)
413 """Delete all directory summary files in the given directory.
415 This is to cleanup the directory so no summary files are left behind to
418 @param path: Path to cleanup directory summary.
420 # Only summary files directly under the `path` needs to be cleaned.
422 for summary in summary_files:
424 os.remove(summary)
426 utils_lib.LOG('Failed to delete summary: %s. Error: %s' %
427 (summary, e))