Module scalaris_bench
[hide private]
[frames] | no frames]

Module scalaris_bench

source code

Classes [hide private]
  BenchRunnable
Abstract base class of a test run that is to be run in a thread.
  BenchRunnable2
  TransSingleOpBench1
Performs a benchmark writing objects using a new TransactionSingleOp object for each test.
  TransSingleOpBench2
Performs a benchmark writing objects using a new TransactionSingleOp but re-using a single connection for each test.
  TransSingleOpBench3
Performs a benchmark writing objects using a single TransactionSingleOp object for all tests.
  TransBench1
Performs a benchmark writing objects using a new Transaction for each test.
  TransBench2
Performs a benchmark writing objects using a new Transaction but re-using a single connection for each test.
  TransBench3
Performs a benchmark writing objects using a single Transaction object for all tests.
  TransIncrementBench
Performs a benchmark writing integer numbers on a single key and increasing them.
  TransIncrementBench1
Performs a benchmark writing integer numbers on a single key and increasing them using a new Transaction for each test.
  TransIncrementBench2
Performs a benchmark writing integer numbers on a single key and increasing them using a new Transaction but re-using a single connection for each test.
  TransIncrementBench3
Performs a benchmark writing objects using a single Transaction object for all tests.
  TransReadXWriteXBench
Performs a benchmark reading X values and overwriting them afterwards inside a transaction.
  TransRead5Write5Bench1
Performs a benchmark reading 5 values and overwriting them afterwards inside a transaction using a new Transaction for each test.
  TransRead5Write5Bench2
Performs a benchmark reading 5 values and overwriting them afterwards inside a transaction using a new Transaction but re-using a single connection for each test.
  TransRead5Write5Bench3
Performs a benchmark reading 5 values and overwriting them afterwards inside a transaction using a single Transaction object for all tests.
  TransAppendToListBench
Performs a benchmark adding values to a list inside a transaction.
  TransAppendToListBench1
Performs a benchmark adding values to a list inside a transaction using a new Transaction for each test.
  TransAppendToListBench2
Performs a benchmark adding values to a list inside a transaction using a new Transaction but re-using a single connection for each test.
  TransAppendToListBench3
Performs a benchmark adding values to a list inside a transaction using a single Transaction object for all tests.
Functions [hide private]
 
minibench(operations, threads_per_node, benchmarks)
Default minimal benchmark.
source code
 
_getCurrentMillis()
Gets the number of milliseconds since epoch.
source code
 
_testBegin()
Call this method when a benchmark is started.
source code
 
_testEnd(testruns)
Call this method when a benchmark is finished.
source code
 
_getConnection() source code
 
_getResultArray(rows, columns)
Returns a pre-initialized results array with values <tt>-1</tt>.
source code
 
_getRandom(size, mytype)
Creates an random string or binary object from <size> random characters/bytes.
source code
 
_integrateResults(results, i, worker, failed)
Integrates the workers' results into the result array.
source code
 
_getAvgSpeed(results)
Calculates the average number of transactions per second from the results of executing 10 transactions per test run.
source code
 
_runBenchAndPrintResults(benchmarks, results, columns, rows, test_types, test_types_str, test_bench, test_group, first_bench_id, operations, parallel_runs)
Runs the given benchmarks and prints a results table.
source code
 
_runBench(operations, value, name, clazz, parallel_runs)
Runs the given benchmark.
source code
 
_printResults(columns, rows, results, operations, parallel_runs)
Prints a result table.
source code
 
_printException() source code
 
run_from_cmd(argv) source code
Variables [hide private]
  _BENCH_DATA_SIZE = 1000
The size of a single data item that is send to scalaris.
  _benchTime = 0
This is used to create different erlang keys for each run.
  _PERCENT_TO_REMOVE = 5
Cut 5% off of both ends of the result list.
  _TESTRUNS = 1
  DEFAULT_URLS = ['http://localhost:8000']
  __package__ = None

Imports: scalaris, datetime, Thread, time, threading, random, string, os, sys, traceback


Function Details [hide private]

minibench(operations, threads_per_node, benchmarks)

source code 

Default minimal benchmark.

Tests some strategies for writing key/value pairs to scalaris: 1) writing binary objects (random data, size = _BENCH_DATA_SIZE) 2) writing string objects (random data, size = _BENCH_DATA_SIZE) each with the given number of consecutive operations and parallel threads per Scalaris node, * first using a new Transaction or TransactionSingleOp for each test, * then using a new Transaction or TransactionSingleOp but re-using a single connection, * and finally re-using a single Transaction or TransactionSingleOp object.

_testBegin()

source code 

Call this method when a benchmark is started. Sets the time the benchmark was started.

_testEnd(testruns)

source code 

Call this method when a benchmark is finished. Calculates the time the benchmark took and the number of transactions performed during this time. Returns the number of achieved transactions per second.

_getAvgSpeed(results)

source code 

Calculates the average number of transactions per second from the results of executing 10 transactions per test run. Will remove the top and bottom _PERCENT_TO_REMOVE percent of the sorted results array. Returns the average number of transactions per second.