OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
analyze_benchmark.BenchAnalyzer Class Reference

Public Member Functions

def __init__
 
def collectMissingQueries
 
def printHeader
 
def findAnomaliesRatio
 

Private Attributes

 __header_info
 
 __label_name_ref
 
 __label_name_sample
 
 __missing_queries_ref
 
 __missing_queries_sample
 
 __attribute_ref
 
 __attribute_sample
 

Detailed Description

Definition at line 67 of file analyze_benchmark.py.

Constructor & Destructor Documentation

def analyze_benchmark.BenchAnalyzer.__init__ (   self,
  ref,
  sample,
  attribute 
)

Definition at line 68 of file analyze_benchmark.py.

68 
69  def __init__(self, ref, sample, attribute):
70  assert isinstance(ref, BenchmarkLoader)
71  assert isinstance(sample, BenchmarkLoader)
72  self.__header_info = [ref.getFrontAttribute("query_group"), attribute]
73  self.__label_name_ref = ref.fetchQueryNames()
74  self.__label_name_sample = sample.fetchQueryNames()
76  self.__missing_queries_sample = []
79  self.__attribute_ref = ref.fetchAttribute(
80  attribute, self.__label_name_ref
81  )
82  self.__attribute_sample = sample.fetchAttribute(
83  attribute, self.__label_name_sample
84  )

Member Function Documentation

def analyze_benchmark.BenchAnalyzer.collectMissingQueries (   self)

Definition at line 86 of file analyze_benchmark.py.

References analyze_benchmark.BenchAnalyzer.__label_name_ref, and analyze_benchmark.BenchAnalyzer.__label_name_sample.

86 
87  def collectMissingQueries(self):
88  for query in self.__label_name_ref:
89  if query not in self.__label_name_sample:
90  self.__missing_queries_sample.append(query)
91  self.__label_name_ref.remove(query)
92  for query in self.__label_name_sample:
93  if query not in self.__label_name_ref:
94  self.__missing_queries_ref.append(query)
95  self.__label_name_sample.remove(query)
def analyze_benchmark.BenchAnalyzer.findAnomaliesRatio (   self,
  epsilon 
)

Definition at line 100 of file analyze_benchmark.py.

References analyze_benchmark.BenchAnalyzer.__attribute_ref, analyze_benchmark.BenchAnalyzer.__attribute_sample, analyze_benchmark.BenchAnalyzer.__label_name_ref, analyze_benchmark.BenchAnalyzer.__missing_queries_ref, analyze_benchmark.BenchAnalyzer.__missing_queries_sample, analyze_benchmark.compute_speedup(), and analyze_benchmark.BenchAnalyzer.printHeader().

101  def findAnomaliesRatio(self, epsilon):
102  found = False
103  speedup = compute_speedup(
105  )
106  print("Differences outside of %2.0f%%: " % (epsilon * 100), end="")
107  self.printHeader()
108  for i in range(len(speedup)):
109  if abs(speedup[i] - 1.0) > epsilon:
110  if found == False:
111  found = True
112  print(
113  "\n%s: reference = %.2f ms, sample = %.2f ms, speedup = %.2fx"
114  % (
115  self.__label_name_ref[i],
116  self.__attribute_ref[i],
117  self.__attribute_sample[i],
118  speedup[i],
119  ),
120  end="",
121  )
122  if found == False:
123  print(": None", end="")
124  if self.__missing_queries_ref:
125  print("\n*** Missing queries from reference: ", end="")
126  for query in self.__missing_queries_ref:
127  print(query + " ", end="")
128  if self.__missing_queries_sample:
129  print("\n*** Missing queries from sample: ", end="")
130  for query in self.__missing_queries_sample:
131  print(query + " ", end="")
132  print(
133  "\n======================================================================="
134  )
135 

+ Here is the call graph for this function:

def analyze_benchmark.BenchAnalyzer.printHeader (   self)

Definition at line 96 of file analyze_benchmark.py.

References analyze_benchmark.BenchAnalyzer.__header_info.

Referenced by analyze_benchmark.BenchAnalyzer.findAnomaliesRatio(), and analyze_benchmark.PrettyPrint.printAttribute().

96 
97  def printHeader(self):
98  for h in self.__header_info:
99  print(" " + h, end="")

+ Here is the caller graph for this function:

Member Data Documentation

analyze_benchmark.BenchAnalyzer.__attribute_ref
private

Definition at line 78 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.findAnomaliesRatio(), analyze_benchmark.PrettyPrint.printAttribute(), and analyze_benchmark.PrettyPrint.printLine().

analyze_benchmark.BenchAnalyzer.__attribute_sample
private

Definition at line 81 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.findAnomaliesRatio(), and analyze_benchmark.PrettyPrint.printAttribute().

analyze_benchmark.BenchAnalyzer.__header_info
private

Definition at line 71 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.printHeader(), and analyze_benchmark.PrettyPrint.printHeader().

analyze_benchmark.BenchAnalyzer.__label_name_ref
private

Definition at line 72 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.collectMissingQueries(), analyze_benchmark.PrettyPrint.collectMissingQueries(), analyze_benchmark.BenchAnalyzer.findAnomaliesRatio(), and analyze_benchmark.PrettyPrint.printAttribute().

analyze_benchmark.BenchAnalyzer.__label_name_sample
private

Definition at line 73 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.collectMissingQueries(), and analyze_benchmark.PrettyPrint.collectMissingQueries().

analyze_benchmark.BenchAnalyzer.__missing_queries_ref
private

Definition at line 74 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.findAnomaliesRatio().

analyze_benchmark.BenchAnalyzer.__missing_queries_sample
private

Definition at line 75 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchAnalyzer.findAnomaliesRatio().


The documentation for this class was generated from the following file: