def METHOD_NAME(event: KubernetesResourceEvent) -> int:
    resource = event.get_resource()
    kind = resource.kind
    try:
        if kind == "Deployment" or kind == "StatefulSet":
            return resource.spec.replicas if resource.spec.replicas is not None else 1
        elif kind == "DaemonSet":
            return 0 if not resource.status.desired_number_scheduled else resource.status.desired_number_scheduled
        elif kind == "Pod":
            return 1
        return 0
    except Exception:
        logging.error(f"Failed to extract total pods from {resource}", exc_info=True)
    return 1