-
Notifications
You must be signed in to change notification settings - Fork 431
Finalize and document Tracker API #42
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
Conversation
9f60277 to
f867159
Compare
I wonder if we want to document the |
I agree with both, those are good points. What about if we rename Regarding |
I've gone with "no" for now, in part because we haven't yet gotten any requests for this, but also because I'm not as familiar with those classes and I can't speak as well to whether we're willing to commit to interface stability on them, or whether there's things that still need to be revisited.
Yes, but the destination that we send to isn't identified by the host and port that you give. You do I dunno - I find the name a bit misleading, but I also can't really think of a way to fix it. I guess we could call it
Ack, I'll make that change. |
|
|
After some offline discussion, we've settled on leaving class memray.SocketDestination(port: int, host: str = '127.0.0.1')to class memray.SocketDestination(server_port: int, address: str = '127.0.0.1') |
These annotations were missing from the extension module's type stubs. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
When backticks are used without any explicit role, default to assuming that the referenced text is the name of a Python object. This doesn't affect the behavior of qualified lookups at all. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This will let Sphinx link our type hints to types provided by the Python interpreter and standard library. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Document how to use the Memray API to programmatically control tracking of allocations in a Python process. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
This is meant as a short blurb to inform the user that the feature exists, without going into any depth. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
To make it clearer what the effect of using a `SocketDestination` is, use `server_port` rather than `port` and `address` rather than `host` as the names of its attributes. Also, correct the type hint for `address`: it mistakenly indicated that it could be `None`, but it can't (though it can be omitted, because it has a default value). Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
The name `exist_ok` did a poor job of conveying what would happen if it already existed: it could have not failed but also not written anything, or it could have overwritten the existing file. The new name makes the outcome clearer. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Closes: #25
Rendered documentation can be previewed here.
@pablogsal Let me know whether there's anything else that you'd like to see documented here.
Now is probably our last chance to rename some of this before the API actually gets users. I'm wondering whether we should have gone with
force=Trueoroverwrite=Truefor the parameter to tell aFileDestinationto overwrite an existing file, instead ofexist_ok=True. I'm also thinking that the nameSocketDestinationis a bit odd for something that configures how to start a server, rather than a client...