Skip to content
API Documentation
BastionGuard™
device_health_probe.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <functional>
5#include <string>
6#include <vector>
7
15
17 uint64_t offset {0};
18 size_t size {0};
19 bool success {false};
20 bool timeout {false};
21 std::string error;
22 uint64_t latency_ms {0};
23};
24
26 std::string device_path;
27 uint64_t total_size {0};
28 uint32_t logical_sector_size {512};
29 bool open_ok {false};
30 bool read_lba0_ok {false};
31 bool read_tail_ok {false};
33 bool size_suspicious {false};
34 bool unstable_latency {false};
36 std::vector<DeviceProbeSample> samples;
37 std::string summary;
38};
39
41public:
42 using CancelCallback = std::function<bool()>;
43
45 const std::string& device_path,
46 CancelCallback cancel_cb = {});
47};
static DeviceHealthReport probe(const std::string &device_path, CancelCallback cancel_cb={})
std::function< bool()> CancelCallback
DeviceHealthState
DeviceHealthState state
std::vector< DeviceProbeSample > samples