Ability to pull Sliver stats
diff --git a/planetstack/core/models/sliver.py b/planetstack/core/models/sliver.py
index d9d2028..601afbb 100644
--- a/planetstack/core/models/sliver.py
+++ b/planetstack/core/models/sliver.py
@@ -13,6 +13,7 @@
from core.models import Flavor
from django.contrib.contenttypes import generic
from planetstack.config import Config
+from monitor import driver as monitor
config = Config()
@@ -141,3 +142,15 @@
slices = Slice.select_by_user(user)
qs = Sliver.objects.filter(slice__in=slices)
return qs
+
+ def get_cpu_stats(self):
+ filter = 'instance_id=%s'%self.sliver_id
+ return monitor.get_meter('cpu',filter,None)
+
+ def get_bw_stats(self):
+ filter = 'instance_id=%s'%self.sliver_id
+ return monitor.get_meter('network.outgoing.bytes',filter,None)
+
+ def get_node_stats(self):
+ # Note sure what should go back here
+ return 1