mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
refactor: Improve user sampling logic with configurable percentage
This commit is contained in:
parent
6e076a40a9
commit
75f52a1324
1 changed files with 5 additions and 2 deletions
|
@ -78,8 +78,11 @@ class Analytics:
|
||||||
if not self.user_id:
|
if not self.user_id:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# ask 1% of users
|
# Define percentage of users to ask
|
||||||
return self.user_id < "03"
|
PERCENT = 1
|
||||||
|
# Convert percentage to hex threshold (1% = "03", 10% = "1a", etc)
|
||||||
|
threshold = format(int(256 * PERCENT / 100), "02x")
|
||||||
|
return self.user_id < threshold
|
||||||
|
|
||||||
def get_data_file_path(self):
|
def get_data_file_path(self):
|
||||||
data_file = Path.home() / ".aider" / "analytics.json"
|
data_file = Path.home() / ".aider" / "analytics.json"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue