def getVideoByTrendingAndCountry(catalog, country): delta_time = -1.0 delta_memory = -1.0 tracemalloc.start() start_time = getTime() start_memory = getMemory() videos = model.getVideosByCountry(catalog, country) size = lt.size(videos) videos = model.sortVideosByID(videos, size) video = model.getNumByID(videos) stop_memory = getMemory() stop_time = getTime() tracemalloc.stop() delta_time = stop_time - start_time delta_memory = deltaMemory(start_memory, stop_memory) delta = delta_time, delta_memory return video, delta
def sortVideosID(catalog, country): return model.sortVideosByID(catalog, country)
def sortVideosByID(filtro_pais): """ Ordena los videos por id. """ return model.sortVideosByID(filtro_pais)