| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from datetime import date | 5 from datetime import date |
| 6 from datetime import datetime | 6 from datetime import datetime |
| 7 from datetime import timedelta | 7 from datetime import timedelta |
| 8 | 8 |
| 9 from crash.type_enums import CrashClient | 9 from crash.type_enums import CrashClient |
| 10 import iterator | 10 import iterator |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 start_date=_A_YEAR_AGO, | 49 start_date=_A_YEAR_AGO, |
| 50 end_date=_TODAY, | 50 end_date=_TODAY, |
| 51 batch_size=_DEFAULT_BATCH_SIZE, | 51 batch_size=_DEFAULT_BATCH_SIZE, |
| 52 batch_run=False): # pragma: no cover. | 52 batch_run=False): # pragma: no cover. |
| 53 """Genrates query to query crashes and iterates crashes. | 53 """Genrates query to query crashes and iterates crashes. |
| 54 | 54 |
| 55 Args: | 55 Args: |
| 56 client_id (CrashClient): One of CrashClient.FRACAS, CrashClient.CRACAS, | 56 client_id (CrashClient): One of CrashClient.FRACAS, CrashClient.CRACAS, |
| 57 CrashClient.CLUSTERFUZZ. | 57 CrashClient.CLUSTERFUZZ. |
| 58 app_id (str): App engine app id. | 58 app_id (str): App engine app id. |
| 59 fields (list): Field names of CrashAnalysis entity to project. | 59 fields (list or None): Field names of CrashAnalysis entity to be projected |
| 60 to a dict. If None provided, return the entities instead of a projected |
| 61 dict. |
| 60 property_values (dict): Property values to filter. | 62 property_values (dict): Property values to filter. |
| 61 start_date (str): Only iterate testcases after this date including this | 63 start_date (str): Only iterate testcases after this date including this |
| 62 date, format '%Y-%m-%d'. | 64 date, format '%Y-%m-%d'. |
| 63 end_date (str): Only iterate testcases before this date excluding this date, | 65 end_date (str): Only iterate testcases before this date excluding this date, |
| 64 format '%Y-%m-%d'. | 66 format '%Y-%m-%d'. |
| 65 batch_size (int): The number of crashes to query at one time. | 67 batch_size (int): The number of crashes to query at one time. |
| 66 batch_run (bool): If True, iterate batches of crashes, if | 68 batch_run (bool): If True, iterate batches of crashes, if |
| 67 False, iterate each crash. | 69 False, iterate each crash. |
| 68 | 70 |
| 69 An example is available in crash_printer/print_crash.py. | 71 An example is available in crash_printer/print_crash.py. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 batch_run (bool): If True, iterate batches of crashes, if | 107 batch_run (bool): If True, iterate batches of crashes, if |
| 106 False, iterate each crash. | 108 False, iterate each crash. |
| 107 | 109 |
| 108 An example is available in crash_printer/print_crash.py. | 110 An example is available in crash_printer/print_crash.py. |
| 109 """ | 111 """ |
| 110 for crash in IterateCrashes(client_id, app_id, fields=fields, | 112 for crash in IterateCrashes(client_id, app_id, fields=fields, |
| 111 property_values=property_values, | 113 property_values=property_values, |
| 112 start_date=start_date, end_date=end_date, | 114 start_date=start_date, end_date=end_date, |
| 113 batch_size=batch_size, batch_run=batch_run): | 115 batch_size=batch_size, batch_run=batch_run): |
| 114 yield crash | 116 yield crash |
| OLD | NEW |