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

Unified Diff: scripts/android_stats.py

Issue 1497483002: Daemon for logging Android stats into InfluxDB (Closed) Base URL: https://skia.googlesource.com/buildbot@android_stats
Patch Set: Created 5 years 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
« android_stats/go/android_stats/main.go ('K') | « influxdb/influxdb-config.toml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/android_stats.py
diff --git a/scripts/android_stats.py b/scripts/android_stats.py
index e723fb090a8af4aebe3e4fea96c4b7ce66136823..6d78ba7bd15656eb0e4fda2cd34ef7d55c0b7e16 100755
--- a/scripts/android_stats.py
+++ b/scripts/android_stats.py
@@ -66,9 +66,8 @@ def get_temperature(serial):
def get_device_stats(serial):
"""Obtain and return a dictionary of device statistics."""
- return {
+ return get_device_model(serial), {
'battery': get_battery_stats(serial),
- 'model': get_device_model(serial),
'temperature': get_temperature(serial),
}
@@ -77,8 +76,11 @@ def get_all_device_stats():
"""Obtain and return statistics for all attached devices."""
devices = get_devices()
stats = {}
- for device in devices:
- stats[device] = get_device_stats(device)
+ for serial in devices:
+ model, device_stats = get_device_stats(serial)
+ if not stats.get(model):
+ stats[model] = {}
+ stats[model][serial] = device_stats
return stats
« android_stats/go/android_stats/main.go ('K') | « influxdb/influxdb-config.toml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698