| #pragma once |
| |
| #include "utils.hpp" |
| |
| #include <cstdint> |
| #include <memory> |
| #include <string_view> |
| |
| namespace boot_time_monitor |
| { |
| |
| /** |
| * An interface class for the Boot Manager APIs |
| */ |
| class BootManagerIface |
| { |
| public: |
| virtual ~BootManagerIface() = default; |
| |
| /** |
| * Set a new checkpoint to Boot Manager |
| * |
| * @param[in] cpName - Checkpoint name |
| * @param[in] externalWallTime - Current epoch time in milliseconds |
| * @param[in] duration - Self measured duration in milliseconds |
| */ |
| virtual void setCheckpoint(std::string_view cpName, |
| int64_t externalWallTime, int64_t duration) = 0; |
| |
| /** |
| * Set a new duration to Boot Manager |
| * |
| * @param[in] durName - Duration name |
| * @param[in] duration - Self measured duration in milliseconds |
| */ |
| virtual void setDuration(std::string_view durName, int64_t duration) = 0; |
| |
| /** |
| * Inform Boot Manager that current reboot process has completed. |
| */ |
| virtual void notifyComplete() = 0; |
| |
| /** |
| * Check if we are in a reboot process |
| * |
| * @return true if it's rebooting |
| */ |
| virtual bool isRebooting() = 0; |
| |
| /** |
| * Get current checkpoints |
| * |
| * @return vector of current checkpoints |
| */ |
| virtual const std::vector<Checkpoint>& getCheckpoints() = 0; |
| |
| /** |
| * Get current durations |
| * |
| * @return vector of current durations |
| */ |
| virtual const std::vector<Duration>& getDurations() = 0; |
| |
| /** |
| * Get previous checkpoints |
| * |
| * @return vector of previous checkpoints |
| */ |
| virtual const std::vector<Checkpoint>& getPreCheckpoints() = 0; |
| |
| /** |
| * Get previous durations |
| * |
| * @return vector of previous durations |
| */ |
| virtual const std::vector<Duration>& getPreDurations() = 0; |
| }; |
| |
| } // namespace boot_time_monitor |