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

Public Member Functions

def __init__
 
def load
 
def getFrontAttribute
 
def getExistingDataRunLabel
 
def getGpuName
 
def getRunTableName
 
def fetchAttribute
 
def fetchQueryNames
 

Public Attributes

 dir_name
 
 filename_list
 
 data
 

Detailed Description

Definition at line 10 of file analyze_benchmark.py.

Constructor & Destructor Documentation

def analyze_benchmark.BenchmarkLoader.__init__ (   self,
  dir_name,
  filename_list 
)

Definition at line 11 of file analyze_benchmark.py.

11 
12  def __init__(self, dir_name, filename_list):
13  self.dir_name = dir_name
14  self.filename_list = filename_list
15  self.data = []

Member Function Documentation

def analyze_benchmark.BenchmarkLoader.fetchAttribute (   self,
  attribute,
  query_names 
)

Definition at line 48 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.data.

48 
49  def fetchAttribute(self, attribute, query_names):
50  result = []
51  for query in query_names:
52  for experiment in self.data:
53  assert attribute in experiment["results"], (
54  attribute + " is not a valid attribute."
55  )
56  if query == experiment["results"]["query_id"]:
57  result.append(experiment["results"][attribute])
58  break
59  return result
def analyze_benchmark.BenchmarkLoader.fetchQueryNames (   self)

Definition at line 60 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.data.

60 
61  def fetchQueryNames(self):
62  result = []
63  for experiment in self.data:
64  result.append(experiment["results"]["query_id"])
65  return result
66 
def analyze_benchmark.BenchmarkLoader.getExistingDataRunLabel (   self)

Definition at line 38 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.getFrontAttribute().

38 
39  def getExistingDataRunLabel(self):
40  return self.getFrontAttribute("run_label")

+ Here is the call graph for this function:

def analyze_benchmark.BenchmarkLoader.getFrontAttribute (   self,
  attribute 
)

Definition at line 32 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.data.

Referenced by analyze_benchmark.BenchmarkLoader.getExistingDataRunLabel(), analyze_benchmark.BenchmarkLoader.getGpuName(), and analyze_benchmark.BenchmarkLoader.getRunTableName().

32 
33  def getFrontAttribute(self, attribute):
34  if self.data:
35  return self.data[0]["results"][attribute]
36  else:
37  return "None"

+ Here is the caller graph for this function:

def analyze_benchmark.BenchmarkLoader.getGpuName (   self)

Definition at line 41 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.getFrontAttribute().

41 
42  def getGpuName(self):
43  return self.getFrontAttribute("run_gpu_name")

+ Here is the call graph for this function:

def analyze_benchmark.BenchmarkLoader.getRunTableName (   self)

Definition at line 44 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.getFrontAttribute().

44 
45  def getRunTableName(self):
46  return self.getFrontAttribute("run_table")

+ Here is the call graph for this function:

def analyze_benchmark.BenchmarkLoader.load (   self,
  bench_filename 
)

Definition at line 17 of file analyze_benchmark.py.

References analyze_benchmark.BenchmarkLoader.data, analyze_benchmark.BenchmarkLoader.dir_name, analyze_benchmark.BenchmarkLoader.filename_list, and heavyai.open().

17 
18  def load(self, bench_filename):
19  assert bench_filename in self.filename_list
20 
21  with open(self.dir_name + bench_filename) as json_file:
22  # only load those queries that were successful
23  filtered_input_data = filter(
24  lambda experiment: experiment["succeeded"] is True,
25  json.load(json_file),
26  )
27  # sort queries based on their IDs
28  self.data = sorted(
29  filtered_input_data,
30  key=lambda experiment: experiment["results"]["query_id"],
31  )
int open(const char *path, int flags, int mode)
Definition: heavyai_fs.cpp:66

+ Here is the call graph for this function:

Member Data Documentation

analyze_benchmark.BenchmarkLoader.data

Definition at line 14 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchmarkLoader.fetchAttribute(), analyze_benchmark.BenchmarkLoader.fetchQueryNames(), analyze_benchmark.BenchmarkLoader.getFrontAttribute(), analyze_benchmark.BenchmarkLoader.load(), heavydb.thrift.ttypes.TColumn.read(), heavydb.thrift.ttypes.TInsertData.read(), heavydb.thrift.ttypes.TInsertChunks.read(), heavydb.thrift.ttypes.TColumn.write(), heavydb.thrift.ttypes.TInsertData.write(), and heavydb.thrift.ttypes.TInsertChunks.write().

analyze_benchmark.BenchmarkLoader.dir_name

Definition at line 12 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchmarkLoader.load().

analyze_benchmark.BenchmarkLoader.filename_list

Definition at line 13 of file analyze_benchmark.py.

Referenced by analyze_benchmark.BenchmarkLoader.load().


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