postgres

package
v0.0.0-...-409fc48 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Operation  Operation
	Parameters 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, parameters 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
	// DeleteTableOP represents a DELETE TABLE operation.
	DeleteTableOP
	// AlterTableOP represents an ALTER TABLE operation.
	AlterTableOP
	// TruncateTableOP represents a TRUNCATE operation.
	TruncateTableOP
	// ShowOP represents a command SHOW
	ShowOP
)

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
	StaticTags         uint64
}

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