postgres

package
v0.0.0-...-744680b Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 0x40
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnTuple

type ConnTuple = struct {
	Saddr_h  uint64
	Saddr_l  uint64
	Daddr_h  uint64
	Daddr_l  uint64
	Sport    uint16
	Dport    uint16
	Netns    uint32
	Pid      uint32
	Metadata uint32
}

type EbpfEvent

type EbpfEvent struct {
	Tuple ConnTuple
	Tx    EbpfTx
}

type EbpfTx

type EbpfTx struct {
	Request_fragment    [64]byte
	Request_started     uint64
	Response_last_seen  uint64
	Original_query_size uint32
	Pad_cgo_0           [4]byte
}

type Key

type Key struct {
	Operation Operation
	TableName string
	types.ConnectionKey
}

Key is an identifier for a group of Postgres transactions

func NewKey

func NewKey(saddr, daddr util.Address, sport, dport uint16, operation Operation, tableName string) Key

NewKey creates a new postgres key

type Operation

type Operation uint8

Operation represents a postgres query operation supported by our decoder.

const (
	// UnknownOP represents an unknown operation.
	UnknownOP Operation = iota
	// SelectOP represents a SELECT operation.
	SelectOP
	// InsertOP represents an INSERT operation.
	InsertOP
	// UpdateOP represents an UPDATE operation.
	UpdateOP
	// CreateTableOP represents a CREATE TABLE operation.
	CreateTableOP
	// DropTableOP represents a DROP TABLE operation.
	DropTableOP
)

func FromString

func FromString(op string) Operation

FromString returns the Operation from a string.

func (Operation) String

func (op Operation) String() string

String returns the string representation of the operation.

type RequestStat

type RequestStat struct {
	// this field order is intentional to help the GC pointer tracking
	Latencies          *ddsketch.DDSketch
	FirstLatencySample float64
	Count              int
}

RequestStat represents a group of Postgres transactions that has a shared key.

func (*RequestStat) CombineWith

func (r *RequestStat) CombineWith(newStats *RequestStat)

CombineWith merges the data in 2 RequestStats objects newStats is kept as it is, while the method receiver gets mutated

Directories

Path Synopsis
Package debugging provides debug-friendly representations of internal data structures
Package debugging provides debug-friendly representations of internal data structures

Jump to

Keyboard shortcuts

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