common

package
v0.0.0-...-982e07a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Overview

Package common provides functions for initialization and running benchmarks

Index

Constants

View Source
const (
	// RowCount num of rows that will be generated in each write benchmark
	RowCount = 6000
	// RequestCount num of requests that will be done in each read benchmark
	RequestCount = 80000
	// MaxDataLength size of test random data that will be generated and inserted to db (before encrypting)
	MaxDataLength = 1 * 1024 // 1 kb
)

Variables

This section is empty.

Functions

func Connect

func Connect() *sql.DB

Connect return connection to db using env variable PG_CONNECTION_STRING

func ConnectAcra

func ConnectAcra() *sql.DB

ConnectAcra return connection to acra using env variable ACRA_CONNECTION_STRING

func DropCreate

func DropCreate(db *sql.DB)

DropCreate drop table 'test_data' if exists and create table with sequence for primary key. Into this table will be inserted acrastructs encrypted with one key and used in read benchmarks

func DropCreateRaw

func DropCreateRaw(db *sql.DB)

DropCreateRaw drop table 'test_raw' if exists and create table with sequence for primary key. Into this table will be inserted raw data without encryption and used in read benchmarks of reading raw data

func GenerateData

func GenerateData() ([]byte, error)

GenerateData generates random data with MaxDataLength

func GetServerOneKeyPublic

func GetServerOneKeyPublic() *keys.PublicKey

GetServerOneKeyPublic reads public key

func RunScripts

func RunScripts(scripts []string, db *sql.DB)

RunScripts function execute all sql queries in scripts variable using using db

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL