benchhelper

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package benchhelper provides utilities for large data set memory or cpu benchmark.

Index

Constants

This section is empty.

Variables

View Source
var Fformat = struct {
	JPGHistogramTiny  string
	JPGHistogramSmall string
	JPGHistogramMid   string
}{
	JPGHistogramTiny: `
set terminal jpeg size 300,200;

# the bar width
set boxwidth 0.7 relative

set style fill solid border;

# show horizontal grid
set grid ytics;

set style line 101 lc rgb '#909090' lt 1 lw 1

# left and bottom border
set border 3 front ls 101

# plot title at the right top
set key font ",8"

# x-axis, the numbers
set tics font "Verdana,8"

# space between x-axis and x-tics label
set xtics offset 0,0.3,0

# cluster spacing is 1(bar-width)
set style histogram cluster gap 1
`,
	JPGHistogramSmall: `
set terminal jpeg size 400,300;
set boxwidth 0.8;
set style fill solid;
set grid ytics;

set style line 101 lc rgb '#909090' lt 1 lw 1
set border 3 front ls 101
`,
	JPGHistogramMid: `
set terminal jpeg size 600,400;
set boxwidth 0.7;
set style fill solid;
set grid ytics;

set style line 101 lc rgb '#909090' lt 1 lw 1
set border 3 front ls 101
`,
}
View Source
var LineStyles = struct {
	Colorful string
	Orange   string
	Yellow   string
	Green    string
	Cyan     string
	Blue     string
	Purple   string
}{
	Colorful: `
set style line 1 lc rgb '#4688F1' pt 1 ps 1 lt 1 lw 2;
set style line 2 lc rgb '#CA4E5D' pt 6 ps 1 lt 1 lw 2;
set style line 3 lc rgb '#79A2F1' pt 6 ps 1 lt 1 lw 2;
set style line 4 lc rgb '#8ED0F1' pt 6 ps 1 lt 1 lw 2;
set style line 5 lc rgb '#8AE7CC' pt 6 ps 1 lt 1 lw 2;

set style line 1 lc rgb '#4688F1' pt 1 ps 1 lt 1 lw 2;
set style line 2 lc rgb '#6CA8F3' pt 6 ps 1 lt 1 lw 2;
set style line 3 lc rgb '#79A2F1' pt 6 ps 1 lt 1 lw 2;
set style line 4 lc rgb '#8ED0F1' pt 6 ps 1 lt 1 lw 2;
set style line 5 lc rgb '#8AE7CC' pt 6 ps 1 lt 1 lw 2;
`,
	Orange: `
set style line 1  lc rgb '#edbe8a' pt 1 ps 1 lt 1 lw 2;
set style line 2  lc rgb '#e29543' pt 6 ps 1 lt 1 lw 2;
set style line 3  lc rgb '#da7409' pt 6 ps 1 lt 1 lw 2;
set style line 4  lc rgb '#c16400' pt 6 ps 1 lt 1 lw 2;
set style line 5  lc rgb '#ad5900' pt 6 ps 1 lt 1 lw 2;
`,
	Yellow: `
set style line 1  lc rgb '#e9d16c' pt 1 ps 1 lt 1 lw 2;
set style line 2  lc rgb '#e2c444' pt 6 ps 1 lt 1 lw 2;
set style line 3  lc rgb '#daaf08' pt 6 ps 1 lt 1 lw 2;
set style line 4  lc rgb '#cfb033' pt 6 ps 1 lt 1 lw 2;
set style line 5  lc rgb '#ad8a00' pt 6 ps 1 lt 1 lw 2;
`,
	Green: `
set style line 1 lc rgb '#a2e2b8' pt 1 ps 1 lt 1 lw 2;
set style line 2 lc rgb '#6ecd9b' pt 6 ps 1 lt 1 lw 2;
set style line 3 lc rgb '#5db191' pt 6 ps 1 lt 1 lw 2;
set style line 4 lc rgb '#519d7f' pt 6 ps 1 lt 1 lw 2;
set style line 5 lc rgb '#49856e' pt 6 ps 1 lt 1 lw 2;

`,
	Cyan: `
set style line 1 lc rgb '#adece1' pt 1 ps 1 lt 1 lw 2;
set style line 2 lc rgb '#5cd4d9' pt 6 ps 1 lt 1 lw 2;
set style line 3 lc rgb '#70bcca' pt 6 ps 1 lt 1 lw 2;
set style line 4 lc rgb '#4297a7' pt 6 ps 1 lt 1 lw 2;

`,
	Blue: `
set style line 1 lc rgb '#97c8d5' pt 1 ps 1 lt 1 lw 2;
set style line 2 lc rgb '#5ca6d9' pt 6 ps 1 lt 1 lw 2;
set style line 3 lc rgb '#4c80bc' pt 6 ps 1 lt 1 lw 2;
set style line 4 lc rgb '#4172a7' pt 6 ps 1 lt 1 lw 2;

`,
	Purple: `
set style line 1  lc rgb '#c4aecf' pt 1 ps 1 lt 1 lw 2;
set style line 2  lc rgb '#b674c0' pt 6 ps 1 lt 1 lw 2;
set style line 3  lc rgb '#a562a6' pt 6 ps 1 lt 1 lw 2;
set style line 4  lc rgb '#915593' pt 6 ps 1 lt 1 lw 2;
`,
}
View Source
var Plot = struct {
	Histogram string
}{
	Histogram: `
stats fn skip 1 nooutput
max_col = STATS_columns

plot for [col=2:max_col] fn \
using col:xticlabels(gprintf('10^{%T}',column(1)))           \
with histogram              \
linestyle col-1             \
title columnheader
`,
}

Functions

func Allocated

func Allocated() int64

Allocated returns the in-use heap in bytes.

func Fplot added in v0.3.1

func Fplot(fn, script string)

Plot a image by gnuplot script "script" and output it to "fn".

func NewBytesSlices

func NewBytesSlices(eltSize int, n int) [][]byte

func NewDataFileTable added in v0.3.1

func NewDataFileTable(fn string) (*os.File, *tablewriter.Table)

func NewMDFileTable

func NewMDFileTable(fn string) (*os.File, *tablewriter.Table)

func RandByteSlices added in v0.3.1

func RandByteSlices(cnt, leng int) [][]byte

func RandBytes added in v0.3.1

func RandBytes(leng int, from []byte) []byte

func RandI32SliceBetween

func RandI32SliceBetween(min int32, max int32, factor float64) []int32

func RandSortedStrings added in v0.3.1

func RandSortedStrings(cnt, leng int, from []byte) []string

func RandString added in v0.3.1

func RandString(leng int, from []byte) string

func WriteTableFiles added in v0.5.1

func WriteTableFiles(name string, content interface{})

WriteTableFiles write a .md file and a .data file

Types

type ReportCmdFlag added in v0.3.1

type ReportCmdFlag struct {
	Bench    bool
	BenchMem bool
	FPR      bool
	Plot     bool
}

func InitCmdFlag added in v0.3.1

func InitCmdFlag() *ReportCmdFlag

Jump to

Keyboard shortcuts

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