예제 #1
0
 def performance(self, req, instance_id):
     """ Get Instance performance list in the given seconds. """
     
     instance_id = int(instance_id)
     instance_name = utils.instance_id_to_name(instance_id)
     
     try:
         seconds = int(req.params.get('seconds', 300))
     except:
         seconds = 300
         
     # Get most recently 300 seconds' performance data.
     instance_perf_list = db.get_instance_recently_perf(instance_name, seconds)
     return instance_perf_list
예제 #2
0
 def statistic(self, req, instance_id):
     instance_id = int(instance_id)
     instance_name = utils.instance_id_to_name(instance_id)
     
     return db.get_instance_statistic(instance_name)