• 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.
71 # Minimum disk space should be available after saving the summary file.
84 """Get a unique file path to save the directory summary json string.
86 @param path: The directory path to save the summary file to.
89 # Make sure the summary file name is unique.
115 # Make sure the path ends with `/` so the root key of summary json is always
124 """Delete files/directories only exists in old summary.
126 When the new summary is final, i.e., it's built from the final result
130 @param summary_old: Old directory summary.
131 @param summary_new: New directory summary.
144 # Remove the file from the summary as it can be ignored.
154 # If `name` is a directory in the old summary, but a file in the new
155 # summary, delete the entry in the old summary.
162 def _relocate_summary(result_dir, summary_file, summary): argument
163 """Update the given summary with the path relative to the result_dir.
166 @param summary_file: Path to the summary file.
167 @param summary: A directory summary inside the given result_dir or its
169 @return: An updated summary with the path relative to the result_dir.
174 return summary
188 # Add files in summary to child.
189 for info in summary.files:
204 directory summary.
211 merged_summary: The merged directory summary of the given path.
212 files: All summary files in the given path, including
216 # Find all directory summary files and sort them by the time stamp in file
227 summary = result_info.load_summary_json_file(summary_file)
228 summary = _relocate_summary(path, summary_file, summary)
229 all_summaries.append(summary)
231 utils_lib.LOG('Failed to load summary file %s Error: %s' %
236 for summary in all_summaries[1:]:
237 merged_summary.merge(summary)
240 # If there is no directory summary collected, default client_collected_bytes
246 # Get the summary of current directory
258 def _throttle_results(summary, max_result_size_KB): argument
261 @param summary: A ResultInfo object containing result summary.
264 if throttler_lib.check_throttle_limit(summary, max_result_size_KB):
268 (utils_lib.get_size_string(summary.trimmed_size),
272 args = {'summary': summary,
307 old_size = summary.trimmed_size
311 del args_without_summary['summary']
315 if throttler_lib.check_throttle_limit(summary, max_result_size_KB):
321 new_size = summary.trimmed_size
350 help='Path to build directory summary.')
356 help='-d to delete all result summary files in the '
364 @param path: Path to build directory summary.
377 summary = result_info.ResultInfo.build_from_path(path)
378 summary_json = json.dumps(summary)
386 'Not enough disk space after saving the summary file. '
387 'Available free disk: %s bytes. Summary file size: %s bytes.' %
392 utils_lib.LOG('Directory summary of %s is saved to file %s.' %
395 if max_size_KB > 0 and summary.trimmed_size > 0:
396 old_size = summary.trimmed_size
403 _throttle_results(summary, max_size_KB)
404 if summary.trimmed_size < old_size:
405 # Files are throttled, save the updated summary file.
406 utils_lib.LOG('Overwrite the summary file: %s' % summary_file)
407 result_info.save_summary(summary, summary_file)
411 """Delete all directory summary files in the given directory.
413 This is to cleanup the directory so no summary files are left behind to
416 @param path: Path to cleanup directory summary.
418 # Only summary files directly under the `path` needs to be cleaned.
420 for summary in summary_files:
422 os.remove(summary)
424 utils_lib.LOG('Failed to delete summary: %s. Error: %s' %
425 (summary, e))