Documentation
¶
Index ¶
- Constants
- func ClearNonActiveAppRuns() error
- func ConvertToRuntimeStatData(stat ds.RuntimeStatsInfo) rpctypes.RuntimeStatData
- func GetAllAppRunPeerInfos(since int64) []rpctypes.AppRunInfo
- func GetAppRunStatsDelta() (tevent.AppRunStats, int)
- func PruneAppRunPeers() int
- type AppRunPeer
- type GoRoutine
- type GoRoutinePeer
- func (gp *GoRoutinePeer) GetGoRoutineCounts() (int, int, int)
- func (gp *GoRoutinePeer) GetMaxGoId() int64
- func (gp *GoRoutinePeer) GetParsedGoRoutinesAtTimestamp(moduleName string, timestamp int64, activeOnly bool) GoRoutinesAtTimestampResult
- func (gp *GoRoutinePeer) GetParsedGoRoutinesByIds(moduleName string, goIds []int64, timestamp int64) []rpctypes.ParsedGoRoutine
- func (gp *GoRoutinePeer) GetTimeSpansSinceTickIdx(sinceTickIdx int64, showOutrig bool) rpctypes.GoRoutineTimeSpansResponse
- func (gp *GoRoutinePeer) ProcessGoroutineStacks(info ds.GoroutineInfo)
- type GoRoutinesAtTimestampResult
- type LogLinePeer
- func (lp *LogLinePeer) GetLogLines() ([]ds.LogLine, int)
- func (lp *LogLinePeer) GetTotalCount() int
- func (lp *LogLinePeer) NotifySearchManagers(line ds.LogLine)
- func (lp *LogLinePeer) ProcessLogLine(line ds.LogLine)
- func (lp *LogLinePeer) ProcessMultiLogLines(lines []ds.LogLine)
- func (lp *LogLinePeer) RegisterSearchManager(manager gensearch.SearchManagerInterface)
- func (lp *LogLinePeer) UnregisterSearchManager(manager gensearch.SearchManagerInterface)
- type RuntimeStatsPeer
- func (rsp *RuntimeStatsPeer) GetFilteredStats(sinceTs int64) []ds.RuntimeStatsInfo
- func (rsp *RuntimeStatsPeer) GetRuntimeStats(sinceTs int64) []rpctypes.RuntimeStatData
- func (rsp *RuntimeStatsPeer) GetTotalCollectionCount() int
- func (rsp *RuntimeStatsPeer) IsEmpty() bool
- func (rsp *RuntimeStatsPeer) ProcessRuntimeStats(stats ds.RuntimeStatsInfo)
- type Watch
- type WatchesPeer
- func (wp *WatchesPeer) GetActiveWatchCount() int
- func (wp *WatchesPeer) GetAllWatches() []rpctypes.CombinedWatchSample
- func (wp *WatchesPeer) GetTotalWatchCount() int
- func (wp *WatchesPeer) GetWatchesByIds(watchIds []int64) []rpctypes.CombinedWatchSample
- func (wp *WatchesPeer) ProcessWatchInfo(watchInfo ds.WatchInfo)
Constants ¶
const ( MaxAppRunPeers = 8 PruneInterval = 15 * time.Second )
const ( AppStatusRunning = "running" AppStatusDone = "done" AppStatusDisconnected = "disconnected" )
const GoRoutinePruneThreshold = 600 // Number of iterations after which inactive goroutines are pruned
const GoRoutineStackBufferSize = 600
const LogLineBufferSize = gensearch.LogLineBufferSize
const RuntimeStatsBufferSize = 600 // 10 minutes of 1-second samples
const WatchBufferSize = 600 // 10 minutes of 1-second samples
Variables ¶
This section is empty.
Functions ¶
func ClearNonActiveAppRuns ¶ added in v0.7.4
func ClearNonActiveAppRuns() error
ClearNonActiveAppRuns removes all AppPeers that are not currently running
func ConvertToRuntimeStatData ¶
func ConvertToRuntimeStatData(stat ds.RuntimeStatsInfo) rpctypes.RuntimeStatData
ConvertToRuntimeStatData converts a ds.RuntimeStatsInfo to rpctypes.RuntimeStatData
func GetAllAppRunPeerInfos ¶
func GetAllAppRunPeerInfos(since int64) []rpctypes.AppRunInfo
GetAllAppRunPeerInfos returns AppRunInfo for all valid app run peers If since > 0, only returns peers that have been modified since the given timestamp
func GetAppRunStatsDelta ¶
func GetAppRunStatsDelta() (tevent.AppRunStats, int)
GetAppRunStatsDelta returns the delta of cumulative stats from all app runs since the last time this function was called, and the count of active app runs.
func PruneAppRunPeers ¶
func PruneAppRunPeers() int
PruneAppRunPeers removes old app run peers to keep the total count under MaxAppRunPeers It will not prune peers that are running or have a non-zero reference count
Types ¶
type AppRunPeer ¶
type AppRunPeer struct {
AppRunId string
AppInfo *ds.AppInfo
Status string // Current status of the application
LastModTime int64 // Last modification time in milliseconds
FirstGoRoutineCollectionTs int64 // Timestamp of first goroutine collection
Logs *LogLinePeer
GoRoutines *GoRoutinePeer
Watches *WatchesPeer
RuntimeStats *RuntimeStatsPeer
CollectorStatus map[string]ds.CollectorStatus // Collector statuses by name
TotalBytesReceived atomic.Int64 // Total bytes received from client
// contains filtered or unexported fields
}
AppRunPeer represents a peer connection to an app client
func GetAllAppRunPeers ¶
func GetAllAppRunPeers() []*AppRunPeer
GetAllAppRunPeers returns all AppRunPeers
func GetAppRunPeer ¶
func GetAppRunPeer(appRunId string, incRefCount bool) *AppRunPeer
GetAppRunPeer gets an existing AppRunPeer by ID or creates a new one if it doesn't exist If incRefCount is true, increments the reference counter
func (*AppRunPeer) GetAppRunInfo ¶
func (p *AppRunPeer) GetAppRunInfo() rpctypes.AppRunInfo
GetAppRunInfo constructs and returns an AppRunInfo struct for this peer
func (*AppRunPeer) GetPeerStats ¶
func (p *AppRunPeer) GetPeerStats() (tevent.AppRunStats, string)
GetPeerStats returns the stats and status for this peer
func (*AppRunPeer) GetRefCount ¶
func (p *AppRunPeer) GetRefCount() int
GetRefCount safely returns the current reference count
func (*AppRunPeer) HandlePacket ¶
func (p *AppRunPeer) HandlePacket(packetType string, packetData json.RawMessage) error
HandlePacket processes a packet received from the domain socket connection
func (*AppRunPeer) Release ¶
func (p *AppRunPeer) Release()
Release decrements the reference counter and closes resources when it reaches zero
type GoRoutine ¶
type GoRoutine struct {
GoId int64
Name string
Tags []string
CreatedByGoId int64 // ID of the goroutine that created this one
CreatedByFrame *rpctypes.StackFrame // Frame information for the creation point
StackTraces *utilds.CirBuf[ds.GoRoutineStack]
TimeSpan rpctypes.TimeSpan // Time span when the goroutine was active
LastActiveIteration int64 // Iteration when the goroutine was last active
Decl *ds.GoDecl // Declaration information for this goroutine
}
GoRoutine represents a goroutine with its stack traces
type GoRoutinePeer ¶
type GoRoutinePeer struct {
// contains filtered or unexported fields
}
GoRoutinePeer manages goroutines for an AppRunPeer
func MakeGoRoutinePeer ¶
func MakeGoRoutinePeer(appRunId string) *GoRoutinePeer
MakeGoRoutinePeer creates a new GoRoutinePeer instance
func (*GoRoutinePeer) GetGoRoutineCounts ¶
func (gp *GoRoutinePeer) GetGoRoutineCounts() (int, int, int)
GetGoRoutineCounts returns (total, active, activeOutrig) goroutine counts
func (*GoRoutinePeer) GetMaxGoId ¶
func (gp *GoRoutinePeer) GetMaxGoId() int64
GetMaxGoId returns the maximum goroutine ID seen with proper locking
func (*GoRoutinePeer) GetParsedGoRoutinesAtTimestamp ¶ added in v0.9.0
func (gp *GoRoutinePeer) GetParsedGoRoutinesAtTimestamp(moduleName string, timestamp int64, activeOnly bool) GoRoutinesAtTimestampResult
GetParsedGoRoutinesAtTimestamp returns parsed goroutines for RPC at a specific timestamp If timestamp is 0, returns the latest goroutines (same as GetParsedGoRoutines) If timestamp is provided, returns all goroutines that were active at that timestamp by finding the stack trace with the largest timestamp <= the provided timestamp If activeOnly is false, returns all goroutines regardless of active status
func (*GoRoutinePeer) GetParsedGoRoutinesByIds ¶
func (gp *GoRoutinePeer) GetParsedGoRoutinesByIds(moduleName string, goIds []int64, timestamp int64) []rpctypes.ParsedGoRoutine
GetParsedGoRoutinesByIds returns parsed goroutines for specific goroutine IDs
func (*GoRoutinePeer) GetTimeSpansSinceTickIdx ¶ added in v0.9.0
func (gp *GoRoutinePeer) GetTimeSpansSinceTickIdx(sinceTickIdx int64, showOutrig bool) rpctypes.GoRoutineTimeSpansResponse
GetTimeSpansSinceTickIdx returns the complete GoRoutineTimeSpansResponse for the given tick index
func (*GoRoutinePeer) ProcessGoroutineStacks ¶
func (gp *GoRoutinePeer) ProcessGoroutineStacks(info ds.GoroutineInfo)
ProcessGoroutineStacks processes goroutine stacks from a packet
type GoRoutinesAtTimestampResult ¶ added in v0.9.0
type GoRoutinesAtTimestampResult struct {
GoRoutines []rpctypes.ParsedGoRoutine
TotalCount int // Total count of all goroutines (not filtered by activeOnly)
TotalNonOutrig int // Total count of non-outrig goroutines (not filtered by activeOnly)
EffectiveTimestamp int64 // The timestamp that was actually used for the query
}
GoRoutinesAtTimestampResult contains the result of GetParsedGoRoutinesAtTimestamp
type LogLinePeer ¶
type LogLinePeer struct {
// contains filtered or unexported fields
}
LogLinePeer manages log lines for an AppRunPeer
func MakeLogLinePeer ¶
func MakeLogLinePeer() *LogLinePeer
MakeLogLinePeer creates a new LogLinePeer instance
func (*LogLinePeer) GetLogLines ¶
func (lp *LogLinePeer) GetLogLines() ([]ds.LogLine, int)
GetLogLines returns all log lines and the total count
func (*LogLinePeer) GetTotalCount ¶
func (lp *LogLinePeer) GetTotalCount() int
GetTotalCount returns the total count of log lines
func (*LogLinePeer) NotifySearchManagers ¶
func (lp *LogLinePeer) NotifySearchManagers(line ds.LogLine)
NotifySearchManagers notifies all registered search managers about a new log line
func (*LogLinePeer) ProcessLogLine ¶
func (lp *LogLinePeer) ProcessLogLine(line ds.LogLine)
ProcessLogLine processes a log line
func (*LogLinePeer) ProcessMultiLogLines ¶
func (lp *LogLinePeer) ProcessMultiLogLines(lines []ds.LogLine)
ProcessMultiLogLines processes multiple log lines at once
func (*LogLinePeer) RegisterSearchManager ¶
func (lp *LogLinePeer) RegisterSearchManager(manager gensearch.SearchManagerInterface)
RegisterSearchManager registers a search manager with this LogLinePeer
func (*LogLinePeer) UnregisterSearchManager ¶
func (lp *LogLinePeer) UnregisterSearchManager(manager gensearch.SearchManagerInterface)
UnregisterSearchManager removes a search manager from this LogLinePeer
type RuntimeStatsPeer ¶
type RuntimeStatsPeer struct {
// contains filtered or unexported fields
}
RuntimeStatsPeer manages runtime stats for an AppRunPeer
func MakeRuntimeStatsPeer ¶
func MakeRuntimeStatsPeer() *RuntimeStatsPeer
MakeRuntimeStatsPeer creates a new RuntimeStatsPeer instance
func (*RuntimeStatsPeer) GetFilteredStats ¶
func (rsp *RuntimeStatsPeer) GetFilteredStats(sinceTs int64) []ds.RuntimeStatsInfo
GetFilteredStats returns runtime stats filtered by a timestamp
func (*RuntimeStatsPeer) GetRuntimeStats ¶
func (rsp *RuntimeStatsPeer) GetRuntimeStats(sinceTs int64) []rpctypes.RuntimeStatData
GetRuntimeStats retrieves runtime stats for RPC
func (*RuntimeStatsPeer) GetTotalCollectionCount ¶
func (rsp *RuntimeStatsPeer) GetTotalCollectionCount() int
GetTotalCollectionCount returns the total number of runtime stats collected
func (*RuntimeStatsPeer) IsEmpty ¶
func (rsp *RuntimeStatsPeer) IsEmpty() bool
IsEmpty returns true if the runtime stats buffer is empty
func (*RuntimeStatsPeer) ProcessRuntimeStats ¶
func (rsp *RuntimeStatsPeer) ProcessRuntimeStats(stats ds.RuntimeStatsInfo)
ProcessRuntimeStats processes runtime stats from a packet
type WatchesPeer ¶
type WatchesPeer struct {
// contains filtered or unexported fields
}
WatchesPeer manages watches for an AppRunPeer
func MakeWatchesPeer ¶
func MakeWatchesPeer(appRunId string) *WatchesPeer
MakeWatchesPeer creates a new WatchesPeer instance
func (*WatchesPeer) GetActiveWatchCount ¶
func (wp *WatchesPeer) GetActiveWatchCount() int
GetActiveWatchCount returns the number of active watches
func (*WatchesPeer) GetAllWatches ¶
func (wp *WatchesPeer) GetAllWatches() []rpctypes.CombinedWatchSample
GetAllWatches returns all watches with their most recent values as combined samples
func (*WatchesPeer) GetTotalWatchCount ¶
func (wp *WatchesPeer) GetTotalWatchCount() int
GetTotalWatchCount returns the total number of watches (active and inactive)
func (*WatchesPeer) GetWatchesByIds ¶
func (wp *WatchesPeer) GetWatchesByIds(watchIds []int64) []rpctypes.CombinedWatchSample
GetWatchesByIds returns watches for specific watch IDs
func (*WatchesPeer) ProcessWatchInfo ¶
func (wp *WatchesPeer) ProcessWatchInfo(watchInfo ds.WatchInfo)
ProcessWatchInfo processes watch information from a packet