Counts how many crash dumps have been stored in this database. Optionally filters the count by heuristic signature. @type signature: object @param signature: (Optional) Count only the crashes that match this signature. See L{Crash.signature} for more de
(self, signature=None)
| 951 | |
| 952 | @Transactional |
| 953 | def count(self, signature=None): |
| 954 | """ |
| 955 | Counts how many crash dumps have been stored in this database. |
| 956 | Optionally filters the count by heuristic signature. |
| 957 | |
| 958 | @type signature: object |
| 959 | @param signature: (Optional) Count only the crashes that match |
| 960 | this signature. See L{Crash.signature} for more details. |
| 961 | |
| 962 | @rtype: int |
| 963 | @return: Count of crash dumps stored in this database. |
| 964 | """ |
| 965 | query = self._session.query(CrashDTO.id) |
| 966 | if signature: |
| 967 | sig_pickled = pickle.dumps(signature, protocol=0) |
| 968 | query = query.filter_by(signature=sig_pickled) |
| 969 | return query.count() |
| 970 | |
| 971 | @Transactional |
| 972 | def delete(self, crash): |