// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2011 Sage Weil * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software * Foundation. See file COPYING. * */ #ifndef CEPH_HEARTBEATMAP_H #define CEPH_HEARTBEATMAP_H #include #include #include #include #include "common/ceph_time.h" #include "common/ceph_mutex.h" #include "include/common_fwd.h" namespace ceph { /* * HeartbeatMap - * * Maintain a set of handles for internal subsystems to periodically * check in with a health check and timeout. Each user can register * and get a handle they can use to set or reset a timeout. * * A simple is_healthy() method checks for any users who are not within * their grace period for a heartbeat. */ struct heartbeat_handle_d { const std::string name; pthread_t thread_id = 0; using clock = ceph::coarse_mono_clock; using time = ceph::coarse_mono_time; std::atomic