OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
benchmarks Namespace Reference

Classes

class  GoogleBenchmark
 
class  HeavyDbServer
 
class  StringDictionaryBenchmark
 
class  TPC_DS_10GB
 

Functions

def conversionFactor
 
def numberOfUsStates
 
def testConnection
 

Function Documentation

def benchmarks.conversionFactor (   time_unit_to,
  time_unit_from 
)

Definition at line 27 of file benchmarks.py.

Referenced by benchmarks.GoogleBenchmark.aggregateBenchmarks().

27 
28 def conversionFactor(time_unit_to, time_unit_from):
29  # See GetTimeUnitString() in https://github.com/google/benchmark/blob/main/include/benchmark/benchmark.h
30  powers = { 's': 0, 'ms': 3, 'us': 6, 'ns': 9 }
31  return 10 ** (powers[time_unit_to] - powers[time_unit_from])
32 
# Name the derived class after the google benchmark executable.
def conversionFactor
Definition: benchmarks.py:27

+ Here is the caller graph for this function:

def benchmarks.numberOfUsStates (   bindir,
  port_main 
)

Definition at line 94 of file benchmarks.py.

Referenced by testConnection().

94 
95 def numberOfUsStates(bindir, port_main):
96  query = b'SELECT COUNT(*) FROM heavyai_us_states;'
97  print('Running test query: %s' % (query))
98  FAILED_TO_OPEN_TRANSPORT = b'Failed to open transport. Is heavydb running?'
99  stdout = FAILED_TO_OPEN_TRANSPORT
100  stderr = b''
101  attempts = 0
102  while stdout.startswith(FAILED_TO_OPEN_TRANSPORT):
103  time.sleep(1)
104  attempts += 1
105  print('Connection attempt {0}'.format(attempts))
106  if (120 < attempts):
107  print('Too many failed connection attempts. Returning -1.')
108  return -1
109  heavysql = subprocess.Popen([bindir+'/heavysql', '-p', 'HyperInteractive', '--port', str(port_main),
110  '--quiet'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
111  (stdout, stderr) = heavysql.communicate(query)
112  return int(stdout)
def numberOfUsStates
Definition: benchmarks.py:94

+ Here is the caller graph for this function:

def benchmarks.testConnection (   bindir,
  port_main 
)

Definition at line 113 of file benchmarks.py.

References numberOfUsStates().

Referenced by benchmarks.TPC_DS_10GB.run().

114 def testConnection(bindir, port_main):
115  number_of_us_states = numberOfUsStates(bindir, port_main)
116  assert number_of_us_states in range(13,100), 'Incorrect number of US states(%d)' % (number_of_us_states)
117  print('Counted %d rows in table heavyai_us_states.' % (number_of_us_states))
118 
@conbench.runner.register_benchmark
def testConnection
Definition: benchmarks.py:113
def numberOfUsStates
Definition: benchmarks.py:94

+ Here is the call graph for this function:

+ Here is the caller graph for this function: