blob: 1d68b5a2a5377abc83b2bd495a90e95649694202 [file] [log] [blame]
#pragma once
#include "boot_manager.hpp"
#include "utils.hpp"
#include <sdbusplus/asio/object_server.hpp>
#include <sdbusplus/bus/match.hpp>
#include <xyz/openbmc_project/Time/Boot/Checkpoint/server.hpp>
#include <xyz/openbmc_project/Time/Boot/Duration/server.hpp>
#include <xyz/openbmc_project/Time/Boot/Statistic/server.hpp>
#include <cstdint>
#include <memory>
#include <string>
namespace boot_time_monitor
{
class DbusHandler :
sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Time::Boot::server::Duration>,
sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Time::Boot::server::Checkpoint>,
sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Time::Boot::server::Statistic>
{
public:
DbusHandler(sdbusplus::bus::bus& dbus, const std::string& objPath,
std::shared_ptr<BootManagerIface> bootManager,
std::shared_ptr<UtilIface> util);
void setCheckpoint(std::string checkpointName, int64_t wallTime,
int64_t selfMeasuredDuration) override;
std::vector<std::tuple<std::string, int64_t, int64_t>>
getCheckpointList() override;
void rebootComplete() override;
void setDuration(std::string durationName, int64_t duration) override;
std::vector<std::tuple<std::string, int64_t>>
getAdditionalDurations() override;
bool isRebooting() const override;
private:
std::shared_ptr<BootManagerIface> bootManager;
std::shared_ptr<UtilIface> util;
};
} // namespace boot_time_monitor