Support uploading host_name info in the tool event logger
host_name info is useful in several use cases including
1) to distinguish the concurrent tool invocations from the same user.
2) to understand the potential different performance from different hosts (e.g. local workstation VS cloudtop).
3) required to integrate the tool event log with the EPR system.
Test: atest tool_event_logger_test
Bug: 348482213
Change-Id: I98422b3f8ccec73d57fcdcdedac91780c448dc47
diff --git a/tools/tool_event_logger/tool_event_logger.py b/tools/tool_event_logger/tool_event_logger.py
index 65a9696..b249d91 100644
--- a/tools/tool_event_logger/tool_event_logger.py
+++ b/tools/tool_event_logger/tool_event_logger.py
@@ -38,6 +38,7 @@
tool_tag: str,
invocation_id: str,
user_name: str,
+ host_name: str,
source_root: str,
platform_version: str,
python_version: str,
@@ -46,6 +47,7 @@
self.tool_tag = tool_tag
self.invocation_id = invocation_id
self.user_name = user_name
+ self.host_name = host_name
self.source_root = source_root
self.platform_version = platform_version
self.python_version = python_version
@@ -57,6 +59,7 @@
tool_tag=tool_tag,
invocation_id=str(uuid.uuid4()),
user_name=getpass.getuser(),
+ host_name=platform.node(),
source_root=os.environ.get('ANDROID_BUILD_TOP', ''),
platform_version=platform.platform(),
python_version=platform.python_version(),
@@ -110,6 +113,7 @@
tool_tag=self.tool_tag,
invocation_id=self.invocation_id,
user_name=self.user_name,
+ host_name=self.host_name,
source_root=self.source_root,
)