mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
refactor: optimize analytics event tracking with system info as super properties
This commit is contained in:
parent
fa5a6021b1
commit
57f4186cad
1 changed files with 2 additions and 3 deletions
|
@ -56,6 +56,7 @@ class Analytics:
|
|||
host=posthog_host,
|
||||
on_error=self.posthog_error,
|
||||
enable_exception_autocapture=True,
|
||||
super_properties=self.get_system_info(), # Add system info to all events
|
||||
)
|
||||
|
||||
def disable(self, permanently):
|
||||
|
@ -164,6 +165,7 @@ class Analytics:
|
|||
"os_platform": platform.system(),
|
||||
"os_release": platform.release(),
|
||||
"machine": platform.machine(),
|
||||
"aider_version": __version__,
|
||||
}
|
||||
|
||||
def _redact_model_name(self, model):
|
||||
|
@ -195,7 +197,6 @@ class Analytics:
|
|||
properties["editor_model"] = self._redact_model_name(main_model.editor_model)
|
||||
|
||||
properties.update(kwargs)
|
||||
properties.update(self.get_system_info()) # Add system info to all events
|
||||
|
||||
# Handle numeric values
|
||||
for key, value in properties.items():
|
||||
|
@ -204,8 +205,6 @@ class Analytics:
|
|||
else:
|
||||
properties[key] = str(value)
|
||||
|
||||
properties["aider_version"] = __version__
|
||||
|
||||
if self.mp:
|
||||
try:
|
||||
self.mp.track(self.user_id, event_name, dict(properties))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue