Ejemplo n.º 1
0
 def plot_dirs(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(
         r"^Starting plotting progress into temporary dirs: (.+) and (.+)$",
         line)
     if m:
         entry.tmp_dir1 = m.group(1)
         entry.tmp_dir2 = m.group(2)
     return m != None
Ejemplo n.º 2
0
 def plot_start_date(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(
         r'^Starting phase 1/4: Forward Propagation into tmp files\.\.\. (.+)',
         line)
     if m:
         entry.started_at = plotman.job.parse_chia_plot_time(s=m.group(1))
     return m != None
Ejemplo n.º 3
0
    def parse(self, file: typing.TextIO) -> PlotInfo:
        """Parses a single log and returns its info"""
        entry = PlotInfo()

        matchers = [
            self.ignore_line, self.plot_id, self.plot_start_date,
            self.plot_size, self.buffer_size, self.buckets, self.threads,
            self.plot_dirs, self.phase1_duration, self.phase2_duration,
            self.phase3_duration, self.phase4_duration, self.total_time,
            self.copy_time, self.filename
        ]

        for line in file:
            for matcher in matchers:
                if (matcher(line, entry)):
                    break

        return entry
Ejemplo n.º 4
0
 def threads(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r"^Using (\d+) threads of stripe size (\d+)", line)
     if m:
         entry.threads = int(m.group(1))
     return m != None
Ejemplo n.º 5
0
 def copy_time(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r"^Copy time = (\d+\.\d+) seconds", line)
     if m:
         entry.copy_time_raw = float(m.group(1))
     return m != None
Ejemplo n.º 6
0
 def phase4_duration(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r"^Time for phase 4 = (\d+\.\d+) seconds", line)
     if m:
         entry.phase4_duration_raw = float(m.group(1))
     return m != None
Ejemplo n.º 7
0
 def filename(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r'^Renamed final file from ".+" to "(.+)"', line)
     if m:
         entry.filename = m.group(1)
     return m != None
Ejemplo n.º 8
0
 def plot_id(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r'^ID: (.+)$', line)
     if m:
         entry.plot_id = m.group(1)
     return m != None
Ejemplo n.º 9
0
 def plot_size(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r'^Plot size is: (\d+)', line)
     if m:
         entry.plot_size = int(m.group(1))
     return m != None
Ejemplo n.º 10
0
 def buffer_size(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r"^Buffer size is: (\d+)MiB", line)
     if m:
         entry.buffer = int(m.group(1))
     return m != None
Ejemplo n.º 11
0
 def buckets(self, line: str, entry: PlotInfo) -> bool:
     m = re.search(r"^Using (\d+) buckets", line)
     if m:
         entry.buckets = int(m.group(1))
     return m != None