Lines Matching refs:self
78 def __init__(self, significant, notable, percentage_string):
79 self.significant_ = significant
80 self.notable_ = notable
81 self.percentage_string_ = percentage_string
83 def percentage_string(self):
84 return self.percentage_string_;
86 def isSignificant(self):
87 return self.significant_
89 def isNotablyPositive(self):
90 return self.notable_ > 0
92 def isNotablyNegative(self):
93 return self.notable_ < 0
97 def __init__(self, units, count, result, sigma):
98 self.units_ = units
99 self.count_ = float(count)
100 self.result_ = float(result)
101 self.sigma_ = float(sigma)
103 def Compare(self, other):
104 if self.units_ != other.units_:
105 print ("Incompatible units: %s and %s" % (self.units_, other.units_))
112 if self.units_ == "score":
113 compare_num = 100*self.result_/other.result_ - 100
115 compare_num = 100*other.result_/self.result_ - 100
119 self.result_, self.count_)
129 def result(self):
130 return self.result_
132 def sigma(self):
133 return self.sigma_
137 def __init__(self, name):
138 self.name_ = name
139 self.runs_ = {}
141 def name(self):
142 return self.name_
144 def getResult(self, run_name):
145 return self.runs_.get(run_name)
147 def appendResult(self, run_name, trace):
155 self.runs_[run_name] = BenchmarkResult(units, count, mean, stddev)
159 def __init__(self, name):
160 self.name_ = name
161 self.benchmarks_ = {}
163 def SortedTestKeys(self):
164 keys = self.benchmarks_.keys()
172 def name(self):
173 return self.name_
175 def getBenchmark(self, benchmark_name):
176 benchmark_object = self.benchmarks_.get(benchmark_name)
179 self.benchmarks_[benchmark_name] = benchmark_object
184 def __init__(self, output_file):
185 self.benchmarks_ = []
186 self.print_output_ = []
187 self.output_file_ = output_file
189 def Print(self, str_data):
190 self.print_output_.append(str_data)
192 def FlushOutput(self):
193 string_data = "\n".join(self.print_output_)
195 if self.output_file_:
197 with open(self.output_file_, "w") as text_file:
202 def bold(self, data):
205 def red(self, data):
209 def green(self, data):
212 def PrintHeader(self):
326 self.Print(data)
328 def StartSuite(self, suite_name, run_names):
329 self.Print("<h2>")
330 self.Print("<a name=\"%s\">%s</a> <a href=\"#top\">(top)</a>" %
332 self.Print("</h2>");
333 self.Print("<table class=\"benchmark\">")
334 self.Print("<thead>")
335 self.Print(" <th>Test</th>")
338 self.Print(" <th>%s</th>" % run_name)
342 self.Print(" <th>%</th>")
343 self.Print("</thead>")
344 self.Print("<tbody>")
347 def FinishSuite(self):
348 self.Print("</tbody>")
349 self.Print("</table>")
352 def StartBenchmark(self, benchmark_name):
353 self.Print(" <tr>")
354 self.Print(" <td class=\"name-column\">%s</td>" % benchmark_name)
356 def FinishBenchmark(self):
357 self.Print(" </tr>")
360 def PrintResult(self, run):
362 self.PrintEmptyCell()
364 self.Print(" <td>%3.1f</td>" % run.result())
367 def PrintComparison(self, run, main_run):
369 self.PrintEmptyCell()
374 res = self.bold(res)
376 res = self.green(res)
378 res = self.red(res)
379 self.Print(" <td>%s</td>" % res)
382 def PrintEmptyCell(self):
383 self.Print(" <td></td>")
386 def StartTOC(self, title):
387 self.Print("<h1>%s</h1>" % title)
388 self.Print("<ul>")
390 def FinishTOC(self):
391 self.Print("</ul>")
393 def PrintBenchmarkLink(self, benchmark):
394 self.Print("<li><a href=\"#" + benchmark + "\">" + benchmark + "</a></li>")
396 def PrintFooter(self):
400 self.Print(data)