mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +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:
|
||||
return False
|
||||
|
||||
# ask 1% of users
|
||||
return self.user_id < "03"
|
||||
# Define percentage of users to ask
|
||||
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):
|
||||
data_file = Path.home() / ".aider" / "analytics.json"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue