-
Notifications
You must be signed in to change notification settings - Fork 645
test: simplify IO tests #5228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wjones127
merged 11 commits into
lance-format:main
from
wjones127:feat/simplify-io-tests
Nov 20, 2025
Merged
test: simplify IO tests #5228
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
df5678b
simplify IO tests
wjones127 d1bbd5d
feat: expose IO stats to Python
wjones127 3b21d37
fix: address code review issues for IO stats API
wjones127 e399444
feat: add IO tracking to LocalObjectReader for local filesystem
wjones127 5fb6d64
cleanup
wjones127 a7546e0
fix s3 test
wjones127 9c988cd
minor fix
wjones127 3542f68
simplify
wjones127 1a8cc1d
pr feedback
wjones127 eac2b74
better naming
wjones127 94a5088
fix python
wjones127 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // SPDX-FileCopyrightText: Copyright The Lance Authors | ||
|
|
||
| //! IO statistics tracking for dataset operations | ||
|
|
||
| use pyo3::{pyclass, pymethods}; | ||
|
|
||
| /// IO statistics for dataset operations | ||
| /// | ||
| /// This tracks the number of IO operations and bytes transferred for read and write | ||
| /// operations performed on the dataset's object store. | ||
| /// | ||
| /// Note: Calling `io_stats()` returns the statistics accumulated since the last call | ||
| /// and resets the internal counters (incremental stats pattern). | ||
| #[pyclass(name = "IOStats", module = "_lib", get_all)] | ||
| #[derive(Clone, Debug)] | ||
| pub struct IoStats { | ||
| /// Number of read IO operations performed | ||
| pub read_iops: u64, | ||
| /// Total bytes read from storage | ||
| pub read_bytes: u64, | ||
| /// Number of write IO operations performed | ||
| pub write_iops: u64, | ||
| /// Total bytes written to storage | ||
| pub written_bytes: u64, | ||
| } | ||
|
|
||
| #[pymethods] | ||
| impl IoStats { | ||
| fn __repr__(&self) -> String { | ||
| format!( | ||
| "IOStats(read_iops={}, read_bytes={}, write_iops={}, write_bytes={})", | ||
| self.read_iops, self.read_bytes, self.write_iops, self.written_bytes | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| impl IoStats { | ||
| /// Convert from Lance's internal IoStats type | ||
| pub fn from_lance(stats: lance_io::utils::tracking_store::IoStats) -> Self { | ||
| Self { | ||
| read_iops: stats.read_iops, | ||
| read_bytes: stats.read_bytes, | ||
| write_iops: stats.write_iops, | ||
| written_bytes: stats.written_bytes, | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could include these docs in mkdocs. I'll make an issue to figure that out. Then we wouldn't need the lengthy
Returnsblock on the python.