Read and decode a metric segment from disk. Returns all (timestamp_ms, value) pairs.
(path: &Path)
| 185 | /// |
| 186 | /// Returns all (timestamp_ms, value) pairs. |
| 187 | pub fn read_metric_segment(path: &Path) -> Result<MetricSegmentData, SegmentReadError> { |
| 188 | let data = std::fs::read(path)?; |
| 189 | read_metric_segment_from_bytes(&data) |
| 190 | } |
| 191 | |
| 192 | /// Read and decode a metric segment from in-memory bytes. |
| 193 | pub fn read_metric_segment_from_bytes(data: &[u8]) -> Result<MetricSegmentData, SegmentReadError> { |