#pragma once #include #include #include struct sqlite3; namespace pex { struct Sample { int64_t host_id = 0; int64_t unix_ts = 0; float cpu_pct = 0.0f; float ram_used_mb = 0.0f; float ram_total_mb = 0.0f; float disk_read_mb_s = 0.0f; float disk_write_mb_s = 0.0f; float net_rx_mb_s = 0.0f; float net_tx_mb_s = 0.0f; float gpu_pct = 0.0f; }; class SamplesDb { public: SamplesDb(); ~SamplesDb(); bool open(const std::string& path); void close(); bool insert(const Sample& s); // Devuelve muestras del host en ventana [unix_from, unix_to], ordenadas asc. std::vector query_range(int64_t host_id, int64_t unix_from, int64_t unix_to); private: sqlite3* db_ = nullptr; }; } // namespace pex