cognite-sdk-python
cognite-sdk-python copied to clipboard
Add callback to global_config to allow tracking of one's own SDK usage
DRAFT
Ref. edm-pipeline debug discussion: @spex66 @thorkildcognite
Checklist:
- [ ] Tests added/updated.
- [ ] Documentation updated. Documentation is generated from docstrings - these must be updated according to your change. If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
- [ ] Changelog updated in CHANGELOG.md.
- [ ] Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.
Not run it yet, but expected code consolidating counters across threads/processes?
Or does it require handling concurrency on callback side?
Parallelism still confuses me every time :)
Accidentally clicked close... 👀
Not run it yet, but expected code consolidating counters across threads/processes?
@spex66 The callback will be called by the different threads executing the requests (the SDK only uses threading as a means of concurrency). In the two examples given in the docstring, they would all write to the same object, which is totally fine (GIL + ordering doesn't matter).
Do you have a usage pattern in mind that you're afraid might have a race condition?
@spex66 do you need this feature or should we put it on hold?
Ok hold pls, and I need to set a reminder to look into it .. later