Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: infra/services/sysmon/android_device_metrics.py

Issue 2023003004: Don't report android device port paths. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | infra/services/sysmon/test/android_device_metrics_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/services/sysmon/android_device_metrics.py
diff --git a/infra/services/sysmon/android_device_metrics.py b/infra/services/sysmon/android_device_metrics.py
index 8616be068bb5d0a5f1a777074ecd6c4ff5d2851a..6990cc0c19b80fcd22e3b585f3dbf9c28a86b6c7 100644
--- a/infra/services/sysmon/android_device_metrics.py
+++ b/infra/services/sysmon/android_device_metrics.py
@@ -5,6 +5,7 @@
import json
import logging
import os
+import re
import socket
import time
@@ -23,6 +24,8 @@ ANDROID_DEVICE_FILE = os.path.join(os.path.expanduser('~'),
# Don't read a file older than this many seconds.
ANDROID_DEVICE_FILE_STALENESS_S = 120
+PORT_PATH_RE = re.compile(r'\d+\/\d+')
+
cpu_temp = ts_mon.FloatMetric('dev/cpu/temperature',
description='device CPU temperature in deg C')
@@ -51,6 +54,11 @@ def get_device_statuses(device_file=ANDROID_DEVICE_FILE, now=None):
return
for device_name, device in devices.iteritems():
+ if PORT_PATH_RE.match(device_name):
+ logging.warning('Found port path %s as device id. Skipping.',
ghost stip (do not use) 2016/06/01 18:03:37 interesting. when would this come up instead of de
bpastene 2016/06/01 21:43:30 I imagine it happens when there's a protocol/usb f
+ device_name)
+ continue
+
fields = {'device_id': device_name}
# Fields with special handling.
« no previous file with comments | « no previous file | infra/services/sysmon/test/android_device_metrics_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698