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
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)