powerreport

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DraftDirectoryName   = "power_draft"
	ReportsDirectoryName = "power_reports"
)

Variables

This section is empty.

Functions

func PromoteDraft

func PromoteDraft(basePath string)

Types

type Attribution

type Attribution struct {
	Inbound      string              `json:"inbound,omitempty"`
	InboundType  string              `json:"inboundType,omitempty"`
	Network      string              `json:"network,omitempty"`
	Source       string              `json:"source,omitempty"`
	Destination  string              `json:"destination,omitempty"`
	Domain       string              `json:"domain,omitempty"`
	Protocol     string              `json:"protocol,omitempty"`
	User         string              `json:"user,omitempty"`
	Process      *ProcessAttribution `json:"process,omitempty"`
	Rule         string              `json:"rule,omitempty"`
	Chain        []string            `json:"chain,omitempty"`
	Outbound     string              `json:"outbound,omitempty"`
	OutboundType string              `json:"outboundType,omitempty"`
	Server       string              `json:"server,omitempty"`
	DNS          string              `json:"dns,omitempty"`
	DNSType      string              `json:"dnsType,omitempty"`
	Endpoint     string              `json:"endpoint,omitempty"`
}

type Direction

type Direction uint8
const (
	DirectionOutbound Direction = iota
	DirectionInbound
)

func (Direction) String

func (d Direction) String() string

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Recorder

func (m *Manager) Recorder() *Recorder

func (*Manager) Start

func (m *Manager) Start(options Options) error

type Options

type Options struct {
	BasePath         string
	Logger           logger.Logger
	Metadata         any
	OwnerCallback    func(path string)
	LogCallback      func() []byte
	ProfileCallback  func(path string)
	GateInterval     time.Duration
	SampleInterval   time.Duration
	FlushInterval    time.Duration
	FallbackInterval time.Duration
}

type ProcessAttribution

type ProcessAttribution struct {
	ProcessID    uint32   `json:"processId,omitempty"`
	UserID       int32    `json:"userId,omitempty"`
	UserName     string   `json:"userName,omitempty"`
	ProcessPath  string   `json:"processPath,omitempty"`
	PackageNames []string `json:"packageNames,omitempty"`
}

type Recorder

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

func NewRecorder

func NewRecorder(options Options) *Recorder

func (*Recorder) Close

func (r *Recorder) Close() error

func (*Recorder) CountConnectionOpened

func (r *Recorder) CountConnectionOpened()

func (*Recorder) CountDNSQuery

func (r *Recorder) CountDNSQuery()

func (*Recorder) RecordPlatformEvent

func (r *Recorder) RecordPlatformEvent(eventType string)

func (*Recorder) Start

func (r *Recorder) Start() error

func (*Recorder) Touch

func (r *Recorder) Touch(direction Direction, size int, by *Attribution)

Touch reports one I/O activity: one read or write call, or one batched receive or send syscall on paths that batch packets. size is the size of the first packet of the activity and characterizes what ended an idle period; it is not accumulated. Volume totals come from the sampled interface counters instead.

func (*Recorder) UpdateNetworkType

func (r *Recorder) UpdateNetworkType(networkType string)

Jump to

Keyboard shortcuts

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