pub struct LogFileStatsProvider { /* private fields */ }Expand description
A QueryStatsProvider that extracts stats by parsing Hyper’s JSON log file.
Hyper writes detailed query-end log entries to hyperd.log in JSON-per-line
format. This provider:
- Records the file offset before each query
- After the query, reads new log entries from that offset
- Finds the matching
query-endentry by query text prefix - Parses the JSON stats into a
QueryStatsstruct
§Example
use hyperdb_api::LogFileStatsProvider;
// From an explicit path
let provider = LogFileStatsProvider::new("/path/to/hyperd.log");
// From a HyperProcess (auto-detects log path)
// let provider = LogFileStatsProvider::from_process(&hyper);Implementations§
Source§impl LogFileStatsProvider
impl LogFileStatsProvider
Sourcepub fn new(log_path: impl Into<PathBuf>) -> Self
pub fn new(log_path: impl Into<PathBuf>) -> Self
Creates a new provider that reads from the given log file path.
The path should point to the hyperd.log file written by the Hyper server.
Sourcepub fn from_process(process: &HyperProcess) -> Self
pub fn from_process(process: &HyperProcess) -> Self
Creates a new provider by auto-detecting the log path from a HyperProcess.
The log file is expected at <log_dir>/hyperd.log.
Trait Implementations§
Source§impl Debug for LogFileStatsProvider
impl Debug for LogFileStatsProvider
Auto Trait Implementations§
impl Freeze for LogFileStatsProvider
impl RefUnwindSafe for LogFileStatsProvider
impl Send for LogFileStatsProvider
impl Sync for LogFileStatsProvider
impl Unpin for LogFileStatsProvider
impl UnsafeUnpin for LogFileStatsProvider
impl UnwindSafe for LogFileStatsProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request