Commit 703f4814 authored by Jomaro Rodrigues's avatar Jomaro Rodrigues
Browse files

funcionando com tempo de processamento

parent 29feeabd
...@@ -2,12 +2,11 @@ import os ...@@ -2,12 +2,11 @@ import os
import time import time
from script.base.dataframe_base import load_dataframes from script.base.dataframe_base import load_dataframes
from script.build_cache import build_cache from script.build_cache import build_cache
from datetime import timedelta
from script.analysis.degree_analysis import *
from script.utils.situations import *
from script.analysis.course_analysis import * from script.analysis.course_analysis import *
from datetime import timedelta from datetime import timedelta
def analyze(submission): def analyze(submission):
start_time = time.clock() start_time = time.clock()
start_time_exec = time.time() start_time_exec = time.time()
...@@ -16,11 +15,15 @@ def analyze(submission): ...@@ -16,11 +15,15 @@ def analyze(submission):
build_cache(dataframe) build_cache(dataframe)
submission.process_time = round(time.clock() - start_time)
submission.save()
cpu_time = timedelta(seconds=round(time.clock() - start_time)) cpu_time = timedelta(seconds=round(time.clock() - start_time))
run_time = timedelta(seconds=round(time.time() - start_time_exec)) run_time = timedelta(seconds=round(time.time() - start_time_exec))
print("--- Tempo de CPU: {} ---".format(cpu_time)) print("--- Tempo de CPU: {} ---".format(cpu_time))
print("--- Tempo total: {} ---".format(run_time)) print("--- Tempo total: {} ---".format(run_time))
def main(): def main():
start_time = time.clock() start_time = time.clock()
start_time_exec = time.time() start_time_exec = time.time()
......
...@@ -24,6 +24,8 @@ class Submission(models.Model): ...@@ -24,6 +24,8 @@ class Submission(models.Model):
processed = models.BooleanField(default=False) processed = models.BooleanField(default=False)
process_time = models.IntegerField(null=True)
def path(self): def path(self):
return path.join(settings.MEDIA_ROOT, self.course, str(self.id)) return path.join(settings.MEDIA_ROOT, self.course, str(self.id))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment