Skip to content
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

method to track session stats #765

Open
betolink opened this issue Aug 3, 2023 · 1 comment
Open

method to track session stats #765

betolink opened this issue Aug 3, 2023 · 1 comment

Comments

@betolink
Copy link

betolink commented Aug 3, 2023

I couldn't find a method to keep track of the total data cached and transferred on a fsspec session but it would be really helpful to have something like that. Maybe there is already a way to calculate this? given that I do the following

s3 = s3fs.S3FileSystem(anon=True, data_tracking=True)
# I do the usual
s3.open(...)

# and then I can ask:
stats = s3.stats()

and stats will have total data transferred, total HTTP calls, current cache size, max cache size etc.

@martindurant
Copy link
Member

It would certainly be possible to do this, but we don't have anything like it yet.

Note that s3fs already has a logger ("s3fs") which you could generate stats from if you made your own custom handler. Most HTTP calls (all?) generate log events.

For caching, did you mean local copies of files, the directory listings or file data caches? For the latter, the filesystem does NOT keep track of the files that are open on it, so that would be tricky. Perhaps you'd need a weakset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants