ray/dashboard/modules/usage_stats/__init__.py
SangBin Cho 36a31cb6fd
[Usage Stats] Implement usage stats report "Turned off by default". (#22249)
This is the second PR to implement usage stats on Ray. Please refer to the file usage_lib.py for more details.

The full specification is here https://docs.google.com/document/d/1ZT-l9YbGHh-iWRUC91jS-ssQ5Qe2UQ43Lsoc1edCalc/edit#heading=h.17dss3b9evbj.

This adds a dashboard module to enable usage stats. **Usage stats report is turned off by default** after this PR. We can control the report (enablement, report period, and URL. Note that URL is strictly for testing) using the env variable.  

## NOTE
This requires us to add `requests` to the default library. `requests` must be okay to be included because
1. it is extremely lightweight. It is implemented only with built-in libs.
2. It is really stable. The project basically claims they are "deprecated", meaning no new features will be added there.

cc @edoakes @richardliaw for the approval

For the HTTP request, I was alternatively considered httpx, but it was not as lightweight as `requests`. So I decided to implement async requests using the thread pool.
2022-02-22 15:32:02 -08:00

0 lines
Python