benchmark

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package benchmark is a framework for benchmarking the performance of the OTLP protocol vs the OTLP Arrow protocol.

Index

Constants

View Source
const CompressionTypeNone = ""
View Source
const CompressionTypeZstd = "zstd"

Variables

View Source
var (
	OtlpArrowConversionSection = NewSectionConfig("otel_arrow_conversion_sec", "OTLP -> OTel Arrow conv.", false)
	OtlpConversionSection      = NewSectionConfig("otel_conversion_sec", "OTel Arrow -> OTLP conv.", false)
	SerializationSection       = NewSectionConfig("serialization_sec", "Protobuf serialization", false)
	CompressionSection         = NewSectionConfig("compression_sec", "Compression", false)
	DecompressionSection       = NewSectionConfig("decompression_sec", "Decompression", false)
	DeserializationSection     = NewSectionConfig("deserialization_sec", "Protobuf deserialization", false)
	TotalEncodingTimeSection   = NewSectionConfig("total_encoding_time_sec", "Sub total", false)
	TotalDecodingTimeSection   = NewSectionConfig("total_decoding_time_sec", "Sub total", false)
	Phase1TotalTimeSection     = NewSectionConfig("total_time_sec", "Total", true)
	Phase2TotalTimeSection     = NewSectionConfig("total_time_sec", "Total", false)
	ProcessingSection          = NewSectionConfig("processing_sec", "Batch processing", false)
	UncompressedSizeSection    = NewSectionConfig("uncompressed_size", "Uncompressed (bytes)", false)
	CompressedSizeSection      = NewSectionConfig("compressed_size", "Compressed (bytes)", false)
)

Section identifiers used in the benchmark output.

Functions

func ProfileableSystemID

func ProfileableSystemID(ps ProfileableSystem) string

Types

type ColumnConfig

type ColumnConfig struct {
	// contains filtered or unexported fields
}

ColumnConfig is the configuration for a column of the benchmark table output.

func DefaultColumnConfig

func DefaultColumnConfig() *ColumnConfig

DefaultColumnConfig creates a default column config.

func (*ColumnConfig) MetricNotApplicable

func (c *ColumnConfig) MetricNotApplicable() *ColumnConfig

func (*ColumnConfig) SubTitle

func (c *ColumnConfig) SubTitle(subTitle string) *ColumnConfig

type CompressionAlgorithm

type CompressionAlgorithm interface {
	fmt.Stringer
	Compress(data []byte) ([]byte, error)
	Decompress(data []byte) ([]byte, error)
}

func Lz4

func NoCompression

func NoCompression() CompressionAlgorithm

func Zstd

func Zstd() CompressionAlgorithm

type Config

type Config struct {
	Compression bool
	Stats       bool
}

type Lz4CompressionAlgo

type Lz4CompressionAlgo struct{}

func (*Lz4CompressionAlgo) Compress

func (c *Lz4CompressionAlgo) Compress(data []byte) ([]byte, error)

func (*Lz4CompressionAlgo) Decompress

func (c *Lz4CompressionAlgo) Decompress(data []byte) ([]byte, error)

func (*Lz4CompressionAlgo) String

func (c *Lz4CompressionAlgo) String() string

type NoCompressionAlgo

type NoCompressionAlgo struct{}

func (*NoCompressionAlgo) Compress

func (c *NoCompressionAlgo) Compress(data []byte) ([]byte, error)

func (*NoCompressionAlgo) Decompress

func (c *NoCompressionAlgo) Decompress(data []byte) ([]byte, error)

func (*NoCompressionAlgo) String

func (c *NoCompressionAlgo) String() string

type ProfileOptions

type ProfileOptions struct {
	UnaryRpcMode bool
}

type ProfileableSystem

type ProfileableSystem interface {
	Name() string
	Tags() []string
	DatasetSize() int
	CompressionAlgorithm() CompressionAlgorithm

	StartProfiling(writer io.Writer)
	EndProfiling(writer io.Writer)

	InitBatchSize(writer io.Writer, batchSize int)
	PrepareBatch(writer io.Writer, startAt, size int)
	ConvertOtlpToOtlpArrow(writer io.Writer, startAt, size int)

	Process(writer io.Writer) string

	Serialize(writer io.Writer) ([][]byte, error)
	Deserialize(writer io.Writer, buffers [][]byte)
	ConvertOtlpArrowToOtlp(writer io.Writer)

	Clear()
	ShowStats()
}

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

Profiler is the main profiler object used to implement benchmarks.

func NewProfiler

func NewProfiler(batchSizes []int, logfile string, warmUpIter uint64) *Profiler

func (*Profiler) AddSectionWithTotal

func (p *Profiler) AddSectionWithTotal(section *SectionConfig, table *tablewriter.Table, values map[string]*stats.Summary, transform func(float64) float64, maxIter uint64)

func (*Profiler) AddSeparator

func (p *Profiler) AddSeparator(table *tablewriter.Table)

func (*Profiler) AddStep

func (p *Profiler) AddStep(
	section *SectionConfig,
	table *tablewriter.Table,
	values map[string]*stats.Summary,
	transform func(float64) float64,
	titleColor []int)

func (*Profiler) AddTitle

func (p *Profiler) AddTitle(table *tablewriter.Table, title string, titleColor []int)

func (*Profiler) CheckProcessingResults

func (p *Profiler) CheckProcessingResults()

func (*Profiler) ExportMetricsBytesCSV

func (p *Profiler) ExportMetricsBytesCSV(filePrefix string)

func (*Profiler) ExportMetricsTimesCSV

func (p *Profiler) ExportMetricsTimesCSV(filePrefix string)

func (*Profiler) PrintCompressionRatio

func (p *Profiler) PrintCompressionRatio(maxIter uint64)

func (*Profiler) PrintPhase1StepsTiming

func (p *Profiler) PrintPhase1StepsTiming(_ uint64)

func (*Profiler) PrintPhase2StepsTiming

func (p *Profiler) PrintPhase2StepsTiming(_ uint64)

func (*Profiler) PrintResults

func (p *Profiler) PrintResults(maxIter uint64)

func (*Profiler) Printf

func (p *Profiler) Printf(format string, a ...any)

func (*Profiler) Profile

func (p *Profiler) Profile(profileable ProfileableSystem, maxIter uint64) error

type SectionConfig

type SectionConfig struct {
	ID string

	Title string
	// contains filtered or unexported fields
}

SectionConfig is the configuration for a section of the benchmark table output.

func NewSectionConfig

func NewSectionConfig(sectionID string, title string, total bool) *SectionConfig

NewSectionConfig creates a new SectionConfig with default values.

func (*SectionConfig) CustomColumnFor

func (sc *SectionConfig) CustomColumnFor(ps ProfileableSystem) *ColumnConfig

func (*SectionConfig) MetricNotApplicable

func (sc *SectionConfig) MetricNotApplicable(columnID string) bool

func (*SectionConfig) SubTitle

func (sc *SectionConfig) SubTitle(columnID string) string

type ZstdCompressionAlgo

type ZstdCompressionAlgo struct {
	// contains filtered or unexported fields
}

func (*ZstdCompressionAlgo) Compress

func (c *ZstdCompressionAlgo) Compress(data []byte) ([]byte, error)

func (*ZstdCompressionAlgo) Decompress

func (c *ZstdCompressionAlgo) Decompress(data []byte) ([]byte, error)

func (*ZstdCompressionAlgo) String

func (c *ZstdCompressionAlgo) String() string

Directories

Path Synopsis
Package dataset defines the concept of dataset used in this benchmarking framework.
Package dataset defines the concept of dataset used in this benchmarking framework.
Package profileable defines the different protocols that can be profiled.
Package profileable defines the different protocols that can be profiled.
arrow
Package arrow implements the Profile interface for the OTLP Arrow protocol.
Package arrow implements the Profile interface for the OTLP Arrow protocol.
otlp
Package otlp implements the Profile interface for the OTLP protocol.
Package otlp implements the Profile interface for the OTLP protocol.

Jump to

Keyboard shortcuts

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