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

Unified Diff: appengine/swarming/server/bot_management.py

Issue 2212073002: Add endpoint and cron job to aggregate all dimensions and values (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Address more comments Created 4 years, 4 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
Index: appengine/swarming/server/bot_management.py
diff --git a/appengine/swarming/server/bot_management.py b/appengine/swarming/server/bot_management.py
index 48c3afb8aa43fddeb5a8f8058975fd98a8b5790e..feff1773397b570f2ff84e94429fc4195d6db657 100644
--- a/appengine/swarming/server/bot_management.py
+++ b/appengine/swarming/server/bot_management.py
@@ -211,6 +211,21 @@ class BotSettings(ndb.Model):
quarantined = ndb.BooleanProperty()
+class DimensionValues(ndb.Model):
+ dimension = ndb.StringProperty()
+ values = ndb.StringProperty(repeated=True)
+
+
+class DimensionAggregation(ndb.Model):
+ """Has all dimensions that are currently in use."""
+ dimensions = ndb.LocalStructuredProperty(DimensionValues, repeated=True)
+
+ ts = ndb.DateTimeProperty()
+
+ # We only store one of these entities. Use this key to refer to any instance.
+ KEY = ndb.Key('DimensionAggregation', 'current')
+
+
### Private APIs.

Powered by Google App Engine
This is Rietveld 408576698