Ability to pull slice stats
diff --git a/planetstack/core/models/slice.py b/planetstack/core/models/slice.py
index 1f29f0e..6e1d163 100644
--- a/planetstack/core/models/slice.py
+++ b/planetstack/core/models/slice.py
@@ -149,3 +149,14 @@
slices = Slice.select_by_user(user)
qs = SliceDeployments.objects.filter(slice__in=slices)
return qs
+
+ def get_cpu_stats(self):
+ filter = 'project_id=%s'%self.tenant_id
+ return monitor.get_meter('cpu',filter,None)
+
+ def get_bw_stats(self):
+ filter = 'project_id=%s'%self.tenant_id
+ return monitor.get_meter('network.outgoing.bytes',filter,None)
+
+ def get_node_stats(self):
+ return len(self.slice.slivers)