Documentation
¶
Index ¶
- Constants
- func GenerateResource(rscID PICTInputResource) *otlpresource.Resource
- func GenerateResourceSpan(tracingInputs *PICTTracingInputs, spanPairsFile string, random io.Reader) (*otlptrace.ResourceSpans, error)
- func GenerateResourceSpans(tracePairsFile string, spanPairsFile string, random io.Reader) ([]*otlptrace.ResourceSpans, error)
- func GenerateSpan(traceID []byte, parentID []byte, spanName string, spanInputs *PICTSpanInputs, ...) *otlptrace.Span
- func GenerateSpans(count int, startPos int, pictFile string, random io.Reader) ([]*otlptrace.Span, int, error)
- type PICTInputAttributes
- type PICTInputInstrumentationLibrary
- type PICTInputKind
- type PICTInputParent
- type PICTInputResource
- type PICTInputSpanChild
- type PICTInputSpans
- type PICTInputStatus
- type PICTInputTracestate
- type PICTSpanInputs
- type PICTTracingInputs
Constants ¶
const ( TracesColumnResource = 0 TracesColumnInstrumentationLibrary = 1 TracesColumnSpans = 2 )
Input columns in pict_input_traces.txt
const ( SpansColumnParent = 0 SpansColumnTracestate = 1 SpansColumnKind = 2 SpansColumnAttributes = 3 SpansColumnEvents = 4 SpansColumnLinks = 5 SpansColumnStatus = 6 )
Input columns in pict_input_spans.txt
Variables ¶
This section is empty.
Functions ¶
func GenerateResource ¶
func GenerateResource(rscID PICTInputResource) *otlpresource.Resource
GenerateResource generates a OTLP Resource object with representative attributes for the underlying resource type specified by the rscID input parameter.
func GenerateResourceSpan ¶
func GenerateResourceSpan(tracingInputs *PICTTracingInputs, spanPairsFile string, random io.Reader) (*otlptrace.ResourceSpans, error)
GenerateResourceSpan generates a single OTLP ResourceSpans populated based on the provided inputs. They are:
tracingInputs - the pairwise combination of field value variations for this ResourceSpans spanPairsFile - the file with the PICT-generated parameter combinations to generate spans for random - the random number generator to use in generating ID values
The generated resource spans. If err is not nil, some or all of the resource spans fields will be nil.
func GenerateResourceSpans ¶
func GenerateResourceSpans(tracePairsFile string, spanPairsFile string, random io.Reader) ([]*otlptrace.ResourceSpans, error)
GenerateResourceSpans generates a slice of OTLP ResourceSpans objects based on the PICT-generated pairwise parameters defined in the parameters file specified by the tracePairsFile parameter. The pairs to generate spans for for defined in the file specified by the spanPairsFile parameter. The random parameter injects the random number generator to use in generating IDs and other random values. The slice of ResourceSpans are returned. If an err is returned, the slice elements will be nil.
func GenerateSpan ¶
func GenerateSpan(traceID []byte, parentID []byte, spanName string, spanInputs *PICTSpanInputs, random io.Reader) *otlptrace.Span
GenerateSpan generates a single OTLP Span based on the input values provided. They are:
traceID - the trace ID to use, should not be nil parentID - the parent span ID or nil if it is a root span spanName - the span name, should not be blank spanInputs - the pairwise combination of field value variations for this span random - the random number generator to use in generating ID values
The generated span is returned.
func GenerateSpans ¶
func GenerateSpans(count int, startPos int, pictFile string, random io.Reader) ([]*otlptrace.Span, int, error)
GenerateSpans generates a slice of OTLP Span objects with the number of spans specified by the count input parameter. The startPos parameter specifies the line in the PICT tool-generated, test parameter combination records file specified by the pictFile parameter to start reading from. When the end record is reached it loops back to the first record. The random parameter injects the random number generator to use in generating IDs and other random values. Using a random number generator with the same seed value enables reproducible tests.
The return values are the slice with the generated spans, the starting position for the next generation run and the error which caused the spans generation to fail. If err is not nil, the spans slice will have nil values.
Types ¶
type PICTInputAttributes ¶
type PICTInputAttributes string
Enumerates the categories of representative attributes a generated span can be populated with.
const ( SpanAttrNil PICTInputAttributes = "Nil" SpanAttrEmpty PICTInputAttributes = "Empty" SpanAttrDatabaseSQL PICTInputAttributes = "DatabaseSQL" SpanAttrDatabaseNoSQL PICTInputAttributes = "DatabaseNoSQL" SpanAttrFaaSDatasource PICTInputAttributes = "FaaSDatasource" SpanAttrFaaSHTTP PICTInputAttributes = "FaaSHTTP" SpanAttrFaaSPubSub PICTInputAttributes = "FaaSPubSub" SpanAttrFaaSTimer PICTInputAttributes = "FaaSTimer" SpanAttrFaaSOther PICTInputAttributes = "FaaSOther" SpanAttrHTTPClient PICTInputAttributes = "HTTPClient" SpanAttrHTTPServer PICTInputAttributes = "HTTPServer" SpanAttrMessagingProducer PICTInputAttributes = "MessagingProducer" SpanAttrMessagingConsumer PICTInputAttributes = "MessagingConsumer" SpanAttrGRPCClient PICTInputAttributes = "gRPCClient" SpanAttrGRPCServer PICTInputAttributes = "gRPCServer" SpanAttrInternal PICTInputAttributes = "Internal" SpanAttrMaxCount PICTInputAttributes = "MaxCount" )
type PICTInputInstrumentationLibrary ¶
type PICTInputInstrumentationLibrary string
Enumerates the number and kind of instrumentation library instances that can be generated.
const ( LibraryNone PICTInputInstrumentationLibrary = "None" LibraryOne PICTInputInstrumentationLibrary = "One" LibraryTwo PICTInputInstrumentationLibrary = "Two" )
type PICTInputKind ¶
type PICTInputKind string
Enumerates the span kind values that can be set for a span.
const ( SpanKindUnspecified PICTInputKind = "Unspecified" SpanKindInternal PICTInputKind = "Internal" SpanKindServer PICTInputKind = "Server" SpanKindClient PICTInputKind = "Client" SpanKindProducer PICTInputKind = "Producer" SpanKindConsumer PICTInputKind = "Consumer" )
type PICTInputParent ¶
type PICTInputParent string
Enumerates the parent/child types of spans that can be generated.
const ( SpanParentRoot PICTInputParent = "Root" SpanParentChild PICTInputParent = "Child" )
type PICTInputResource ¶
type PICTInputResource string
Enumerates the supported types of resource instances that can be generated.
const ( ResourceNil PICTInputResource = "Nil" ResourceEmpty PICTInputResource = "Empty" ResourceVMOnPrem PICTInputResource = "VMOnPrem" ResourceVMCloud PICTInputResource = "VMCloud" ResourceK8sOnPrem PICTInputResource = "K8sOnPrem" ResourceK8sCloud PICTInputResource = "K8sCloud" ResourceFaas PICTInputResource = "Faas" )
type PICTInputSpanChild ¶
type PICTInputSpanChild string
Enumerates the categories of events and/or links a generated span can be populated with.
const ( SpanChildCountNil PICTInputSpanChild = "Nil" SpanChildCountEmpty PICTInputSpanChild = "Empty" SpanChildCountOne PICTInputSpanChild = "One" SpanChildCountTwo PICTInputSpanChild = "Two" SpanChildCountEight PICTInputSpanChild = "Eight" )
type PICTInputSpans ¶
type PICTInputSpans string
Enumerates the relative sizes of tracing spans that can be attached to an instrumentation library span instance.
const ( LibrarySpansNone PICTInputSpans = "None" LibrarySpansOne PICTInputSpans = "One" LibrarySpansSeveral PICTInputSpans = "Several" LibrarySpansAll PICTInputSpans = "All" )
type PICTInputStatus ¶
type PICTInputStatus string
Enumerates the status values a generated span can be populated with.
const ( SpanStatusNil PICTInputStatus = "Nil" SpanStatusOk PICTInputStatus = "Ok" SpanStatusCancelled PICTInputStatus = "Cancelled" SpanStatusUnknownError PICTInputStatus = "UnknownError" SpanStatusInvalidArgument PICTInputStatus = "InvalidArgument" SpanStatusDeadlineExceeded PICTInputStatus = "DeadlineExceeded" SpanStatusNotFound PICTInputStatus = "NotFound" SpanStatusAlreadyExists PICTInputStatus = "AlreadyExists" SpanStatusPermissionDenied PICTInputStatus = "PermissionDenied" SpanStatusResourceExhausted PICTInputStatus = "ResourceExhausted" SpanStatusFailedPrecondition PICTInputStatus = "FailedPrecondition" SpanStatusAborted PICTInputStatus = "Aborted" SpanStatusOutOfRange PICTInputStatus = "OutOfRange" SpanStatusUnimplemented PICTInputStatus = "Unimplemented" SpanStatusInternalError PICTInputStatus = "InternalError" SpanStatusDataLoss PICTInputStatus = "DataLoss" SpanStatusUnauthenticated PICTInputStatus = "Unauthenticated" )
type PICTInputTracestate ¶
type PICTInputTracestate string
Enumerates the categories of tracestate values that can be generated for a span.
const ( TraceStateEmpty PICTInputTracestate = "Empty" TraceStateOne PICTInputTracestate = "One" TraceStateFour PICTInputTracestate = "Four" )
type PICTSpanInputs ¶
type PICTSpanInputs struct { // Specifies whether the ParentSpanId field should be populated or not Parent PICTInputParent // Specifies the category of contents to populate the TraceState field with Tracestate PICTInputTracestate // Specifies the value to populate the Kind field with Kind PICTInputKind // Specifies the category of values to populate the Attributes field with Attributes PICTInputAttributes // Specifies the category of contents to populate the Events field with Events PICTInputSpanChild // Specifies the category of contents to populate the Links field with Links PICTInputSpanChild // Specifies the value to populate the Status field with Status PICTInputStatus }
PICTSpanInputs defines one pairwise combination of Span variations
type PICTTracingInputs ¶
type PICTTracingInputs struct { // Specifies the category of attributes to populate the Resource field with Resource PICTInputResource // Specifies the number and library categories to populte the InstrumentationLibrarySpans field with InstrumentationLibrary PICTInputInstrumentationLibrary // Specifies the relative number of spans to populate the InstrumentationLibrarySpans' Spans field with Spans PICTInputSpans }
PICTTracingInputs defines one pairwise combination of ResourceSpans variations