Change env_variables to repeated metric.

Bug: b/265929888
Change-Id: I7787e053ca0785801817e4916d9b25fa2ff0e8d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4219772
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
changes/72/4219772/2
Joanna Wang 2 years ago committed by LUCI CQ
parent 3d293077f4
commit 5ed21de943

@ -228,12 +228,13 @@ class MetricsCollector(object):
self._collecting_metrics = True
self.add('metrics_version', metrics_utils.CURRENT_VERSION)
self.add('command', command_name)
environment_variables = [
'%s=%s' % (env, os.environ.get(env)) for env in DEPOT_TOOLS_ENV
if env in os.environ
]
if environment_variables:
self.add('env_variables', ','.join(environment_variables))
for env in DEPOT_TOOLS_ENV:
if env in os.environ:
self.add_repeated('env_variables', {
'name': env,
'value': os.environ.get(env)
})
try:
start = time.time()
result = func(*args, **kwargs)

Loading…
Cancel
Save