MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / is_usage_stats_enabled

Function is_usage_stats_enabled

fastdeploy/usage/usage_lib.py:59–71  ·  view source on GitHub ↗

Determine whether or not we can send usage stats to the server. The logic is as follows: - By default, it should be enabled. - Three environment variables can disable it: - DO_NOT_TRACK=1

()

Source from the content-addressed store, hash-verified

57
58
59def is_usage_stats_enabled():
60 """Determine whether or not we can send usage stats to the server.
61 The logic is as follows:
62 - By default, it should be enabled.
63 - Three environment variables can disable it:
64 - DO_NOT_TRACK=1
65 """
66 global _USAGE_STATS_ENABLED
67 if _USAGE_STATS_ENABLED is None:
68 do_not_track = envs.DO_NOT_TRACK
69
70 _USAGE_STATS_ENABLED = not do_not_track
71 return _USAGE_STATS_ENABLED
72
73
74def get_current_timestamp_ns() -> int:

Callers 2

report_usage_statsFunction · 0.85

Calls

no outgoing calls

Tested by 1