phpfpm

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepScanPending

func DeepScanPending() string

func LastRefreshStats

func LastRefreshStats() (time.Time, int)

func RefreshPending

func RefreshPending() bool

func SetSkipDeepProbes

func SetSkipDeepProbes(v bool)

func TriggerDeepScan

func TriggerDeepScan(site string)

TriggerDeepScan asks the next refresh to also re-walk the docroot filesystem scan for one site (or "*" for all).

func TriggerRefresh

func TriggerRefresh()

TriggerRefresh asks the next Collect() to do a full refresh.

Types

type CallCategory

type CallCategory string

CallCategory groups calls by what they typically represent.

const (
	CatFramework CallCategory = "framework" // WP/Laravel/Symfony hook system, autoload
	CatRender    CallCategory = "render"    // Elementor / theme rendering
	CatDB        CallCategory = "db"        // MySQL/Postgres/Redis client
	CatHTTP      CallCategory = "http"      // outbound curl / remote API
	CatFS        CallCategory = "fs"        // filesystem reads/writes
	CatExec      CallCategory = "exec"      // shell-exec family (DANGEROUS in normal code)
	CatCrypto    CallCategory = "crypto"    // hashing, encryption
	CatImage     CallCategory = "image"     // GD / Imagick / image-magick
	CatRegex     CallCategory = "regex"     // preg_* — can be O(n²) on bad patterns
	CatSerialize CallCategory = "serialize" // serialize / json_encode for huge structures
	CatOther     CallCategory = "other"
)

type CallFnCount

type CallFnCount struct {
	Function string
	Hits     int
}

CallFnCount is the input shape — function name + observation count.

type CallInfo

type CallInfo struct {
	Function    string
	Category    CallCategory
	Severity    string // "normal" | "heavy" | "critical"
	Explanation string
	Optimize    string
}

CallInfo carries the classifier output for one function.

func ClassifyCall

func ClassifyCall(fn string) CallInfo

ClassifyCall returns the CallInfo for a PHP function name as it appears in the slow-log stack ("shell_exec", "do_action", etc.). Unknown names are returned with Category=CatOther, severity "normal".

type ClassifiedCall

type ClassifiedCall struct {
	Function string
	Hits     int
	Info     CallInfo
}

ClassifiedCall is the output for one analyzed function.

func ClassifyTopCalls

func ClassifyTopCalls(calls []CallFnCount) []ClassifiedCall

ClassifyTopCalls runs ClassifyCall on each (fn, count) pair and returns them sorted by severity (critical → heavy → normal), then by count desc. Used to render the analyzed blocking-calls section.

type Collector

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

func NewCollector

func NewCollector() *Collector

func (*Collector) Collect

func (c *Collector) Collect(snap *model.Snapshot) error

func (*Collector) LastRefreshAt

func (c *Collector) LastRefreshAt() time.Time

func (*Collector) MaxMsPerTick

func (c *Collector) MaxMsPerTick() int

func (*Collector) Name

func (c *Collector) Name() string

type FSFinding

type FSFinding struct {
	Path     string
	Kind     string
	Signal   string
	Evidence string
	Size     int64
	ModTime  time.Time
}

Jump to

Keyboard shortcuts

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