Documentation ¶
Overview ¶
Package datagen is a basic framework for generating fake telemetry data for benchmarking.
Index ¶
- Variables
- type AttrFunc
- type Attrs
- type Config
- type DataGenerator
- func (dg *DataGenerator) AddRandomSpansTo(spans ptrace.SpanSlice)
- func (dg *DataGenerator) AdvanceTime(timeDelta time.Duration)
- func (dg *DataGenerator) CurrentTime() pcommon.Timestamp
- func (dg *DataGenerator) EmptyGaugeMetric(metric pmetric.Metric)
- func (dg *DataGenerator) EmptyMetric(metric pmetric.Metric)
- func (dg *DataGenerator) EmptySumMetric(metric pmetric.Metric)
- func (dg *DataGenerator) EmptySummaryMetric(metric pmetric.Metric)
- func (dg *DataGenerator) ExpHistogramWithEverything(metric pmetric.Metric)
- func (dg *DataGenerator) ExpHistogramWithNoDataPoints(metric pmetric.Metric)
- func (dg *DataGenerator) ExpHistogramWithOnlyExemplars(metric pmetric.Metric)
- func (dg *DataGenerator) ExpHistogramWithOnlyTimestamps(metric pmetric.Metric)
- func (dg *DataGenerator) ExpHistogramWithoutAttrs(metric pmetric.Metric)
- func (dg *DataGenerator) ExpHistogramWithoutAttrsAndWithoutBuckets(metric pmetric.Metric)
- func (dg *DataGenerator) FakeHistogram(metric pmetric.Metric)
- func (dg *DataGenerator) FakeSummary(metric pmetric.Metric)
- func (dg *DataGenerator) GaugeEmptyDataPoint(metric pmetric.Metric)
- func (dg *DataGenerator) GaugeWithExemplars(metric pmetric.Metric)
- func (dg *DataGenerator) GaugeWithoutAttribute(metric pmetric.Metric)
- func (dg *DataGenerator) GaugeWithoutValue(metric pmetric.Metric)
- func (dg *DataGenerator) GenBool() bool
- func (dg *DataGenerator) GenF64Range(min float64, max float64) float64
- func (dg *DataGenerator) GenI64Range(min int64, max int64) int64
- func (dg *DataGenerator) HasHistogramMax() bool
- func (dg *DataGenerator) HasHistogramMin() bool
- func (dg *DataGenerator) HasHistogramSum() bool
- func (dg *DataGenerator) HasMetricDescription() bool
- func (dg *DataGenerator) HasMetricUnit() bool
- func (dg *DataGenerator) HistogramWithEverything(metric pmetric.Metric)
- func (dg *DataGenerator) HistogramWithNoDataPoints(metric pmetric.Metric)
- func (dg *DataGenerator) HistogramWithOnlyExemplars(metric pmetric.Metric)
- func (dg *DataGenerator) HistogramWithOnlyTimestamps(metric pmetric.Metric)
- func (dg *DataGenerator) HistogramWithoutAttrs(metric pmetric.Metric)
- func (dg *DataGenerator) HistogramWithoutAttrsAndWithoutBuckets(metric pmetric.Metric)
- func (dg *DataGenerator) Id16Bytes() pcommon.TraceID
- func (dg *DataGenerator) Id8Bytes() pcommon.SpanID
- func (dg *DataGenerator) LogDebugRecord(log plog.LogRecord)
- func (dg *DataGenerator) LogErrorRecord(log plog.LogRecord)
- func (dg *DataGenerator) LogInfoComplexRecord(log plog.LogRecord)
- func (dg *DataGenerator) LogInfoRecord(log plog.LogRecord)
- func (dg *DataGenerator) LogWarnRecord(log plog.LogRecord)
- func (dg *DataGenerator) NextId16Bytes()
- func (dg *DataGenerator) NextId8Bytes()
- func (dg *DataGenerator) PrevTime() pcommon.Timestamp
- func (dg *DataGenerator) RandomBody(body pcommon.Value)
- func (dg *DataGenerator) RandomEvents(ses ptrace.SpanEventSlice)
- func (dg *DataGenerator) RandomLinks(sls ptrace.SpanLinkSlice, traceID pcommon.TraceID, spanID pcommon.SpanID)
- func (dg *DataGenerator) RandomLogRecord(log plog.LogRecord)
- func (dg *DataGenerator) Spans(spans ptrace.SpanSlice)
- func (dg *DataGenerator) SumEmptyDataPoint(metric pmetric.Metric)
- func (dg *DataGenerator) SumWithExemplars(metric pmetric.Metric)
- func (dg *DataGenerator) SumWithoutAttribute(metric pmetric.Metric)
- func (dg *DataGenerator) SumWithoutValue(metric pmetric.Metric)
- func (dg *DataGenerator) SummaryEmptyDataPoint(metric pmetric.Metric)
- func (dg *DataGenerator) SummaryWithoutAttributeAndQuantile(metric pmetric.Metric)
- func (dg *DataGenerator) SummaryWithoutValue(metric pmetric.Metric)
- func (dg *DataGenerator) SystemCpuLoadAverage1m(metric pmetric.Metric)
- func (dg *DataGenerator) SystemCpuTime(metric pmetric.Metric, cpuCount int)
- func (dg *DataGenerator) SystemMemoryUsage(metric pmetric.Metric)
- func (dg *DataGenerator) WithConfig(config Config) *DataGenerator
- type LogsGenerator
- type MetricsGenerator
- func (mg *MetricsGenerator) GenerateAllKindOfMetrics(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateExponentialHistograms(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateGauges(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateHistograms(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateMetricSlice(batchSize int, collectInterval time.Duration) pmetric.MetricSlice
- func (mg *MetricsGenerator) GenerateRandomMetrics(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateSummaries(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateSums(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateSystemCpuLoadAverage1m(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateSystemCpuTime(batchSize int, collectInterval time.Duration) pmetric.Metrics
- func (mg *MetricsGenerator) GenerateSystemMemoryUsage(batchSize int, collectInterval time.Duration) pmetric.Metrics
- type Span
- type TestEntropy
- func (te TestEntropy) GenId(size uint) []byte
- func (te TestEntropy) NewRandomInstrumentationScopes(count int) []pcommon.InstrumentationScope
- func (te TestEntropy) NewRandomResourceAttributes(count int) []pcommon.Map
- func (te TestEntropy) NewSingleInstrumentationScopes() []pcommon.InstrumentationScope
- func (te TestEntropy) NewSingleResourceAttributes() []pcommon.Map
- func (te TestEntropy) NewStandardAttributes() pcommon.Map
- func (te TestEntropy) NewStandardInstrumentationScopes() []pcommon.InstrumentationScope
- func (te TestEntropy) NewStandardResourceAttributes() []pcommon.Map
- func (te TestEntropy) NewStandardSpanEventAttributes() pcommon.Map
- func (te TestEntropy) NewStandardSpanLinkAttributes() pcommon.Map
- func (te TestEntropy) RandomAttributes() pcommon.Map
- func (te TestEntropy) Start() int64
- type TraceGenerator
Constants ¶
This section is empty.
Variables ¶
var EventNames = []string{"empty", "dns-lookup", "tcp-connect", "tcp-handshake", "tcp-send", "tcp-receive", "tcp-close", "http-send", "http-receive", "http-close", "message-send", "message-receive", "message-close", "grpc-send", "grpc-receive", "grpc-close", "grpc-status", "grpc-trailers", "unknown"}
var GroupIds = []string{"group1", "group2", "group3", "group4", "group5"}
var HOSTNAMES = []string{"host1.mydomain.com", "host2.org", "host3.thedomain.edu", "host4.gov", "host5.retailer.com"}
var STATUS = []int64{200, 300, 400, 404, 500, 503}
var TraceStates = []string{"started", "ended", "unknown"}
var UPS = []bool{true, false}
var VERSIONS = []string{"1.0.0", "1.0.2", "2.0", "1.9.9"}
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Probability of generating a metric description ProbMetricDescription float64 // Probability of generating a metric unit ProbMetricUnit float64 // Probability of generating a metric histogram with a sum ProbHistogramHasSum float64 // Probability of generating a metric histogram with a min ProbHistogramHasMin float64 // Probability of generating a metric histogram with a max ProbHistogramHasMax float64 }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type DataGenerator ¶
type DataGenerator struct { TestEntropy // contains filtered or unexported fields }
func NewDataGenerator ¶
func NewDataGenerator(entropy TestEntropy, resourceAttributes []pcommon.Map, instrumentationScopes []pcommon.InstrumentationScope) *DataGenerator
func (*DataGenerator) AddRandomSpansTo ¶
func (dg *DataGenerator) AddRandomSpansTo(spans ptrace.SpanSlice)
func (*DataGenerator) AdvanceTime ¶
func (dg *DataGenerator) AdvanceTime(timeDelta time.Duration)
func (*DataGenerator) CurrentTime ¶
func (dg *DataGenerator) CurrentTime() pcommon.Timestamp
func (*DataGenerator) EmptyGaugeMetric ¶
func (dg *DataGenerator) EmptyGaugeMetric(metric pmetric.Metric)
func (*DataGenerator) EmptyMetric ¶
func (dg *DataGenerator) EmptyMetric(metric pmetric.Metric)
func (*DataGenerator) EmptySumMetric ¶
func (dg *DataGenerator) EmptySumMetric(metric pmetric.Metric)
func (*DataGenerator) EmptySummaryMetric ¶
func (dg *DataGenerator) EmptySummaryMetric(metric pmetric.Metric)
func (*DataGenerator) ExpHistogramWithEverything ¶
func (dg *DataGenerator) ExpHistogramWithEverything(metric pmetric.Metric)
ExpHistogramWithEverything generates a fake exponential histogram metric. All field are purposely filled with random values.
func (*DataGenerator) ExpHistogramWithNoDataPoints ¶
func (dg *DataGenerator) ExpHistogramWithNoDataPoints(metric pmetric.Metric)
func (*DataGenerator) ExpHistogramWithOnlyExemplars ¶
func (dg *DataGenerator) ExpHistogramWithOnlyExemplars(metric pmetric.Metric)
func (*DataGenerator) ExpHistogramWithOnlyTimestamps ¶
func (dg *DataGenerator) ExpHistogramWithOnlyTimestamps(metric pmetric.Metric)
func (*DataGenerator) ExpHistogramWithoutAttrs ¶
func (dg *DataGenerator) ExpHistogramWithoutAttrs(metric pmetric.Metric)
func (*DataGenerator) ExpHistogramWithoutAttrsAndWithoutBuckets ¶
func (dg *DataGenerator) ExpHistogramWithoutAttrsAndWithoutBuckets(metric pmetric.Metric)
func (*DataGenerator) FakeHistogram ¶
func (dg *DataGenerator) FakeHistogram(metric pmetric.Metric)
FakeHistogram generates a fake histogram metric. All field are purposely filled with random values.
func (*DataGenerator) FakeSummary ¶
func (dg *DataGenerator) FakeSummary(metric pmetric.Metric)
func (*DataGenerator) GaugeEmptyDataPoint ¶
func (dg *DataGenerator) GaugeEmptyDataPoint(metric pmetric.Metric)
func (*DataGenerator) GaugeWithExemplars ¶
func (dg *DataGenerator) GaugeWithExemplars(metric pmetric.Metric)
func (*DataGenerator) GaugeWithoutAttribute ¶
func (dg *DataGenerator) GaugeWithoutAttribute(metric pmetric.Metric)
func (*DataGenerator) GaugeWithoutValue ¶
func (dg *DataGenerator) GaugeWithoutValue(metric pmetric.Metric)
func (*DataGenerator) GenBool ¶
func (dg *DataGenerator) GenBool() bool
func (*DataGenerator) GenF64Range ¶
func (dg *DataGenerator) GenF64Range(min float64, max float64) float64
func (*DataGenerator) GenI64Range ¶
func (dg *DataGenerator) GenI64Range(min int64, max int64) int64
func (*DataGenerator) HasHistogramMax ¶
func (dg *DataGenerator) HasHistogramMax() bool
func (*DataGenerator) HasHistogramMin ¶
func (dg *DataGenerator) HasHistogramMin() bool
func (*DataGenerator) HasHistogramSum ¶
func (dg *DataGenerator) HasHistogramSum() bool
func (*DataGenerator) HasMetricDescription ¶
func (dg *DataGenerator) HasMetricDescription() bool
func (*DataGenerator) HasMetricUnit ¶
func (dg *DataGenerator) HasMetricUnit() bool
func (*DataGenerator) HistogramWithEverything ¶
func (dg *DataGenerator) HistogramWithEverything(metric pmetric.Metric)
HistogramWithEverything generates a fake histogram metric. All field are purposely filled with random values.
func (*DataGenerator) HistogramWithNoDataPoints ¶
func (dg *DataGenerator) HistogramWithNoDataPoints(metric pmetric.Metric)
func (*DataGenerator) HistogramWithOnlyExemplars ¶
func (dg *DataGenerator) HistogramWithOnlyExemplars(metric pmetric.Metric)
func (*DataGenerator) HistogramWithOnlyTimestamps ¶
func (dg *DataGenerator) HistogramWithOnlyTimestamps(metric pmetric.Metric)
func (*DataGenerator) HistogramWithoutAttrs ¶
func (dg *DataGenerator) HistogramWithoutAttrs(metric pmetric.Metric)
func (*DataGenerator) HistogramWithoutAttrsAndWithoutBuckets ¶
func (dg *DataGenerator) HistogramWithoutAttrsAndWithoutBuckets(metric pmetric.Metric)
func (*DataGenerator) Id16Bytes ¶
func (dg *DataGenerator) Id16Bytes() pcommon.TraceID
func (*DataGenerator) Id8Bytes ¶
func (dg *DataGenerator) Id8Bytes() pcommon.SpanID
func (*DataGenerator) LogDebugRecord ¶
func (dg *DataGenerator) LogDebugRecord(log plog.LogRecord)
func (*DataGenerator) LogErrorRecord ¶
func (dg *DataGenerator) LogErrorRecord(log plog.LogRecord)
func (*DataGenerator) LogInfoComplexRecord ¶
func (dg *DataGenerator) LogInfoComplexRecord(log plog.LogRecord)
func (*DataGenerator) LogInfoRecord ¶
func (dg *DataGenerator) LogInfoRecord(log plog.LogRecord)
func (*DataGenerator) LogWarnRecord ¶
func (dg *DataGenerator) LogWarnRecord(log plog.LogRecord)
func (*DataGenerator) NextId16Bytes ¶
func (dg *DataGenerator) NextId16Bytes()
func (*DataGenerator) NextId8Bytes ¶
func (dg *DataGenerator) NextId8Bytes()
func (*DataGenerator) PrevTime ¶
func (dg *DataGenerator) PrevTime() pcommon.Timestamp
func (*DataGenerator) RandomBody ¶
func (dg *DataGenerator) RandomBody(body pcommon.Value)
func (*DataGenerator) RandomEvents ¶
func (dg *DataGenerator) RandomEvents(ses ptrace.SpanEventSlice)
func (*DataGenerator) RandomLinks ¶
func (dg *DataGenerator) RandomLinks(sls ptrace.SpanLinkSlice, traceID pcommon.TraceID, spanID pcommon.SpanID)
func (*DataGenerator) RandomLogRecord ¶
func (dg *DataGenerator) RandomLogRecord(log plog.LogRecord)
RandomLogRecord generates a random log record. The list of fields set is random. The value of these fields is also random.
func (*DataGenerator) Spans ¶
func (dg *DataGenerator) Spans(spans ptrace.SpanSlice)
func (*DataGenerator) SumEmptyDataPoint ¶
func (dg *DataGenerator) SumEmptyDataPoint(metric pmetric.Metric)
func (*DataGenerator) SumWithExemplars ¶
func (dg *DataGenerator) SumWithExemplars(metric pmetric.Metric)
func (*DataGenerator) SumWithoutAttribute ¶
func (dg *DataGenerator) SumWithoutAttribute(metric pmetric.Metric)
func (*DataGenerator) SumWithoutValue ¶
func (dg *DataGenerator) SumWithoutValue(metric pmetric.Metric)
func (*DataGenerator) SummaryEmptyDataPoint ¶
func (dg *DataGenerator) SummaryEmptyDataPoint(metric pmetric.Metric)
func (*DataGenerator) SummaryWithoutAttributeAndQuantile ¶
func (dg *DataGenerator) SummaryWithoutAttributeAndQuantile(metric pmetric.Metric)
func (*DataGenerator) SummaryWithoutValue ¶
func (dg *DataGenerator) SummaryWithoutValue(metric pmetric.Metric)
func (*DataGenerator) SystemCpuLoadAverage1m ¶
func (dg *DataGenerator) SystemCpuLoadAverage1m(metric pmetric.Metric)
func (*DataGenerator) SystemCpuTime ¶
func (dg *DataGenerator) SystemCpuTime(metric pmetric.Metric, cpuCount int)
func (*DataGenerator) SystemMemoryUsage ¶
func (dg *DataGenerator) SystemMemoryUsage(metric pmetric.Metric)
func (*DataGenerator) WithConfig ¶
func (dg *DataGenerator) WithConfig(config Config) *DataGenerator
type LogsGenerator ¶
type LogsGenerator struct { *DataGenerator // contains filtered or unexported fields }
func NewLogsGenerator ¶
func NewLogsGenerator(entropy TestEntropy, resourceAttributes []pcommon.Map, instrumentationScopes []pcommon.InstrumentationScope) *LogsGenerator
type MetricsGenerator ¶
type MetricsGenerator struct { *DataGenerator // contains filtered or unexported fields }
func NewMetricsGenerator ¶
func NewMetricsGenerator(entropy TestEntropy, resourceAttributes []pcommon.Map, instrumentationScopes []pcommon.InstrumentationScope) *MetricsGenerator
func NewMetricsGeneratorFromEntropy ¶
func NewMetricsGeneratorFromEntropy(entropy TestEntropy) *MetricsGenerator
func NewMetricsGeneratorWithDataGenerator ¶
func NewMetricsGeneratorWithDataGenerator(dataGenerator *DataGenerator) *MetricsGenerator
func (*MetricsGenerator) GenerateAllKindOfMetrics ¶
func (*MetricsGenerator) GenerateExponentialHistograms ¶
func (*MetricsGenerator) GenerateGauges ¶
func (*MetricsGenerator) GenerateHistograms ¶
func (*MetricsGenerator) GenerateMetricSlice ¶
func (mg *MetricsGenerator) GenerateMetricSlice(batchSize int, collectInterval time.Duration) pmetric.MetricSlice
func (*MetricsGenerator) GenerateRandomMetrics ¶
func (*MetricsGenerator) GenerateSummaries ¶
func (*MetricsGenerator) GenerateSums ¶
func (*MetricsGenerator) GenerateSystemCpuLoadAverage1m ¶
func (*MetricsGenerator) GenerateSystemCpuTime ¶
func (*MetricsGenerator) GenerateSystemMemoryUsage ¶
type TestEntropy ¶
type TestEntropy struct {
// contains filtered or unexported fields
}
func NewTestEntropy ¶
func NewTestEntropy(seed int64) TestEntropy
func (TestEntropy) GenId ¶
func (te TestEntropy) GenId(size uint) []byte
func (TestEntropy) NewRandomInstrumentationScopes ¶
func (te TestEntropy) NewRandomInstrumentationScopes(count int) []pcommon.InstrumentationScope
func (TestEntropy) NewRandomResourceAttributes ¶
func (te TestEntropy) NewRandomResourceAttributes(count int) []pcommon.Map
func (TestEntropy) NewSingleInstrumentationScopes ¶
func (te TestEntropy) NewSingleInstrumentationScopes() []pcommon.InstrumentationScope
func (TestEntropy) NewSingleResourceAttributes ¶
func (te TestEntropy) NewSingleResourceAttributes() []pcommon.Map
func (TestEntropy) NewStandardAttributes ¶
func (te TestEntropy) NewStandardAttributes() pcommon.Map
func (TestEntropy) NewStandardInstrumentationScopes ¶
func (te TestEntropy) NewStandardInstrumentationScopes() []pcommon.InstrumentationScope
func (TestEntropy) NewStandardResourceAttributes ¶
func (te TestEntropy) NewStandardResourceAttributes() []pcommon.Map
func (TestEntropy) NewStandardSpanEventAttributes ¶
func (te TestEntropy) NewStandardSpanEventAttributes() pcommon.Map
func (TestEntropy) NewStandardSpanLinkAttributes ¶
func (te TestEntropy) NewStandardSpanLinkAttributes() pcommon.Map
func (TestEntropy) RandomAttributes ¶
func (te TestEntropy) RandomAttributes() pcommon.Map
RandomAttributes returns a random set of attributes. The number of attributes is random [0,10). The type and value of each attribute is also random.
func (TestEntropy) Start ¶
func (te TestEntropy) Start() int64
type TraceGenerator ¶
type TraceGenerator struct {
*DataGenerator
}
func NewTracesGenerator ¶
func NewTracesGenerator(entropy TestEntropy, resourceAttributes []pcommon.Map, instrumentationScopes []pcommon.InstrumentationScope) *TraceGenerator