tracer

package
v0.0.0-...-be7916c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: MIT Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FaultType_name = map[int32]string{
	0: "Fault_",
	1: "FaultCrash",
	2: "FaultDelay",
}
View Source
var FaultType_value = map[string]int32{
	"Fault_":     0,
	"FaultCrash": 1,
	"FaultDelay": 2,
}
View Source
var MessageType_name = map[int32]string{
	0: "Message_",
	1: "Message_Request",
	2: "Message_Response",
}
View Source
var MessageType_value = map[string]int32{
	"Message_":         0,
	"Message_Request":  1,
	"Message_Response": 2,
}
View Source
var RecordType_name = map[int32]string{
	0: "Record_",
	1: "RecordSend",
	2: "RecordReceive",
}
View Source
var RecordType_value = map[string]int32{
	"Record_":       0,
	"RecordSend":    1,
	"RecordReceive": 2,
}
View Source
var ServiceUUID = NewUUID()
View Source
var Store = &store{
	traces: map[TraceID]*traces{},
}

Functions

func NewCodec

func NewCodec(ctx context.Context, basic baseCodec) *codec

func NewContext

func NewContext(ctx context.Context) context.Context

func NewContextWithContextMeta

func NewContextWithContextMeta(ctx context.Context, c *ContextMeta) context.Context

Types

type ContextMeta

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

func NewContextMeta

func NewContextMeta(traceID TraceID, uuid UUID, url string) *ContextMeta

func (*ContextMeta) UUID

func (c *ContextMeta) UUID() UUID

func (*ContextMeta) Url

func (c *ContextMeta) Url() string

type ContextMetaKey

type ContextMetaKey struct{}

type FaultType

type FaultType int32
const (
	FaultType_Fault_     FaultType = 0
	FaultType_FaultCrash FaultType = 1
	FaultType_FaultDelay FaultType = 2
)

func (FaultType) EnumDescriptor

func (FaultType) EnumDescriptor() ([]byte, []int)

func (FaultType) String

func (x FaultType) String() string

type Faults

type Faults struct {
	IDs    []int
	Faults []*TFI
}

type Generator

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

func NewGenerator

func NewGenerator(names []string) *Generator

func (*Generator) Generate

func (c *Generator) Generate(resultChan chan *Faults)

func (*Generator) GetFaults

func (c *Generator) GetFaults(arr []int) *Faults

func (*Generator) SetLen

func (c *Generator) SetLen(length int)

type MessageType

type MessageType int32
const (
	MessageType_Message_         MessageType = 0
	MessageType_Message_Request  MessageType = 1
	MessageType_Message_Response MessageType = 2
)

func (MessageType) EnumDescriptor

func (MessageType) EnumDescriptor() ([]byte, []int)

func (MessageType) String

func (x MessageType) String() string

type RLFI

type RLFI struct {
	Type                 FaultType `protobuf:"varint,1,opt,name=type,proto3,enum=tracer.FaultType" json:"type,omitempty"`
	Name                 string    `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Delay                int64     `protobuf:"varint,3,opt,name=delay,proto3" json:"delay,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*RLFI) Descriptor

func (*RLFI) Descriptor() ([]byte, []int)

func (*RLFI) GetDelay

func (m *RLFI) GetDelay() int64

func (*RLFI) GetName

func (m *RLFI) GetName() string

func (*RLFI) GetType

func (m *RLFI) GetType() FaultType

func (*RLFI) ProtoMessage

func (*RLFI) ProtoMessage()

func (*RLFI) Reset

func (m *RLFI) Reset()

func (*RLFI) String

func (m *RLFI) String() string

func (*RLFI) XXX_DiscardUnknown

func (m *RLFI) XXX_DiscardUnknown()

func (*RLFI) XXX_Marshal

func (m *RLFI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RLFI) XXX_Merge

func (m *RLFI) XXX_Merge(src proto.Message)

func (*RLFI) XXX_Size

func (m *RLFI) XXX_Size() int

func (*RLFI) XXX_Unmarshal

func (m *RLFI) XXX_Unmarshal(b []byte) error

type Record

type Record struct {
	Type                 RecordType `protobuf:"varint,1,opt,name=type,proto3,enum=tracer.RecordType" json:"type,omitempty"`
	Timestamp            int64      `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	MessageName          string     `protobuf:"bytes,3,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"`
	Uuid                 string     `protobuf:"bytes,4,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Service              string     `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*Record) Descriptor

func (*Record) Descriptor() ([]byte, []int)

func (*Record) GetMessageName

func (m *Record) GetMessageName() string

func (*Record) GetService

func (m *Record) GetService() string

func (*Record) GetTimestamp

func (m *Record) GetTimestamp() int64

func (*Record) GetType

func (m *Record) GetType() RecordType

func (*Record) GetUuid

func (m *Record) GetUuid() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) String

func (m *Record) String() string

func (*Record) XXX_DiscardUnknown

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal

func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Record) XXX_Merge

func (m *Record) XXX_Merge(src proto.Message)

func (*Record) XXX_Size

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal

func (m *Record) XXX_Unmarshal(b []byte) error

type RecordType

type RecordType int32
const (
	RecordType_Record_       RecordType = 0
	RecordType_RecordSend    RecordType = 1
	RecordType_RecordReceive RecordType = 2
)

func (RecordType) EnumDescriptor

func (RecordType) EnumDescriptor() ([]byte, []int)

func (RecordType) String

func (x RecordType) String() string

type TFI

type TFI struct {
	Type                 FaultType  `protobuf:"varint,1,opt,name=type,proto3,enum=tracer.FaultType" json:"type,omitempty"`
	Name                 []string   `protobuf:"bytes,2,rep,name=name,proto3" json:"name,omitempty"`
	Delay                int64      `protobuf:"varint,3,opt,name=delay,proto3" json:"delay,omitempty"`
	After                []*TFIMeta `protobuf:"bytes,4,rep,name=after,proto3" json:"after,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*TFI) Descriptor

func (*TFI) Descriptor() ([]byte, []int)

func (*TFI) GetAfter

func (m *TFI) GetAfter() []*TFIMeta

func (*TFI) GetDelay

func (m *TFI) GetDelay() int64

func (*TFI) GetName

func (m *TFI) GetName() []string

func (*TFI) GetType

func (m *TFI) GetType() FaultType

func (*TFI) ProtoMessage

func (*TFI) ProtoMessage()

func (*TFI) Reset

func (m *TFI) Reset()

func (*TFI) String

func (m *TFI) String() string

func (*TFI) XXX_DiscardUnknown

func (m *TFI) XXX_DiscardUnknown()

func (*TFI) XXX_Marshal

func (m *TFI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TFI) XXX_Merge

func (m *TFI) XXX_Merge(src proto.Message)

func (*TFI) XXX_Size

func (m *TFI) XXX_Size() int

func (*TFI) XXX_Unmarshal

func (m *TFI) XXX_Unmarshal(b []byte) error

type TFIMeta

type TFIMeta struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Times                int64    `protobuf:"varint,2,opt,name=times,proto3" json:"times,omitempty"`
	Already              int64    `protobuf:"varint,3,opt,name=already,proto3" json:"already,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*TFIMeta) Descriptor

func (*TFIMeta) Descriptor() ([]byte, []int)

func (*TFIMeta) GetAlready

func (m *TFIMeta) GetAlready() int64

func (*TFIMeta) GetName

func (m *TFIMeta) GetName() string

func (*TFIMeta) GetTimes

func (m *TFIMeta) GetTimes() int64

func (*TFIMeta) ProtoMessage

func (*TFIMeta) ProtoMessage()

func (*TFIMeta) Reset

func (m *TFIMeta) Reset()

func (*TFIMeta) String

func (m *TFIMeta) String() string

func (*TFIMeta) XXX_DiscardUnknown

func (m *TFIMeta) XXX_DiscardUnknown()

func (*TFIMeta) XXX_Marshal

func (m *TFIMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TFIMeta) XXX_Merge

func (m *TFIMeta) XXX_Merge(src proto.Message)

func (*TFIMeta) XXX_Size

func (m *TFIMeta) XXX_Size() int

func (*TFIMeta) XXX_Unmarshal

func (m *TFIMeta) XXX_Unmarshal(b []byte) error

type Trace

type Trace struct {
	Id                   int64     `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Records              []*Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"`
	Rlfis                []*RLFI   `protobuf:"bytes,20,rep,name=rlfis,proto3" json:"rlfis,omitempty"`
	Tfis                 []*TFI    `protobuf:"bytes,21,rep,name=tfis,proto3" json:"tfis,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*Trace) AppendRecord

func (m *Trace) AppendRecord(record *Record) *Trace

func (*Trace) CalFI

func (m *Trace) CalFI(records []*Record)

func (*Trace) Copy

func (m *Trace) Copy() *Trace

func (*Trace) Descriptor

func (*Trace) Descriptor() ([]byte, []int)

func (*Trace) DoFI

func (m *Trace) DoFI(name string) error

func (*Trace) GetId

func (m *Trace) GetId() int64

func (*Trace) GetRecords

func (m *Trace) GetRecords() []*Record

func (*Trace) GetRlfis

func (m *Trace) GetRlfis() []*RLFI

func (*Trace) GetTfis

func (m *Trace) GetTfis() []*TFI

func (*Trace) JSONString

func (m *Trace) JSONString() string

func (*Trace) ProtoMessage

func (*Trace) ProtoMessage()

func (*Trace) RLFI

func (m *Trace) RLFI(name string) error

func (*Trace) Reset

func (m *Trace) Reset()

func (*Trace) String

func (m *Trace) String() string

func (*Trace) TFI

func (m *Trace) TFI(name string) error

func (*Trace) XXX_DiscardUnknown

func (m *Trace) XXX_DiscardUnknown()

func (*Trace) XXX_Marshal

func (m *Trace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Trace) XXX_Merge

func (m *Trace) XXX_Merge(src proto.Message)

func (*Trace) XXX_Size

func (m *Trace) XXX_Size() int

func (*Trace) XXX_Unmarshal

func (m *Trace) XXX_Unmarshal(b []byte) error

type TraceID

type TraceID = int64

type Tracer

type Tracer interface {
	GetFI_Name() string

	GetFI_Trace() *Trace
	SetFI_Trace(trace *Trace)

	GetMessageType() MessageType
}

type UUID

type UUID = string

func NewUUID

func NewUUID() UUID

Jump to

Keyboard shortcuts

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