def METHOD_NAME(self, result):
    """End auditing."""
    if self.audit_check(AuditFlag.RESOURCE):
        self.resource_monitor.stop()
        result.runtime = gather_runtime_info(self.resource_monitor.fname)
        if self.audit_check(AuditFlag.PROV):
            self.audit_message(
                {"@id": self.mid, "endedAtTime": now(), "wasEndedBy": self.aid},
                AuditFlag.PROV,
            )
            # audit resources/runtime information
            self.eid = f"uid:{gen_uuid()}"
            entity = attr.asdict(result.runtime, recurse=False)
            entity.update(
                **{
                    "@id": self.eid,
                    "@type": "runtime",
                    "prov:wasGeneratedBy": self.aid,
                }
            )
            self.audit_message(entity, AuditFlag.PROV)
            self.audit_message(
                {
                    "@type": "prov:Generation",
                    "entity_generated": self.eid,
                    "hadActivity": self.mid,
                },
                AuditFlag.PROV,
            )
        self.resource_monitor = None
    if self.audit_check(AuditFlag.PROV):
        # audit outputs
        self.audit_message(
            {"@id": self.aid, "endedAtTime": now(), "errored": result.errored},
            AuditFlag.PROV,
        )