Versions in this module Expand all Collapse all v0 v0.5.6 Jul 2, 2026 v0.5.5 Jun 9, 2026 Changes in this version + const DefaultHeapSampleCap + const DefaultProfileSpanCap + var ErrNoNativeSamples = errors.New("no native samples in input") + var ErrProfileUIAuthMissing = errors.New("profile UI auth required for non-loopback bind") + func EncodeChromeTrace(t *RequestTrace) ([]byte, error) + func EncodeFirefoxGecko(t *RequestTrace) ([]byte, error) + func EncodePprof(t *RequestTrace) ([]byte, error) + func HostcallNameIndex(name string) uint16 + func IsLoopbackBindAddress(addr string) bool + func MergeNativeSamples(store *ProfileStore, events []NativeSampleEvent, expectedPID int, ...) int + func ModuleIDOf(wasmbytes []byte) string + func NativeProfilerStrategy(mode ProfileMode) (wasmtime.ProfilingStrategy, bool) + func NativeSamplingRequested(mode ProfileMode) bool + func ResolveHostcallName(idx uint16) string + func ValidateProfileUIAuth(addr, token string, insecure bool) error + func WrapProfileUIAuth(h http.Handler, token string) http.Handler + func WriteWasmSymbolSidecar(wasmbytes []byte, dir, moduleID string, mode ProfileMode) (string, error) + type BackendCall struct + ConnectNanos *int64 + DNSNanos *int64 + Method string + Name string + Outcome BackendOutcome + PendingID uint32 + ReqHeaderBytes int + RespHeaderBytes int + Started int64 + Status int + TLSNanos *int64 + TTFBNanos *int64 + TotalNanos int64 + URLRedacted string + type BackendOutcome uint8 + const BackendOutcomeCancelled + const BackendOutcomeIncomplete + const BackendOutcomeNetworkError + const BackendOutcomeOk + const BackendOutcomeOrphaned + const BackendOutcomeSyntheticFailure + func (o BackendOutcome) String() string + type Binding struct + DeepEnabled bool + ModuleID string + Store *ProfileStore + type CompileConfig struct + Mode ProfileMode + type DeepMetrics struct + BodyReadBytes int64 + BodyWriteBytes int64 + CacheHits int + CacheInserts int + CacheLookups int + CacheMisses int + CacheStale int + HeapSamples []HeapSample + HeapSamplesDropped int + RequestHeaders []HeaderSummary + ResponseHeaders []HeaderSummary + StoreAccess []StoreAccess + func NewDeepMetrics() *DeepMetrics + func (d *DeepMetrics) AddHeapSample(relativeNanos, memoryBytes int64) + func (d *DeepMetrics) BumpStoreAccess(kind, name string) + func (d *DeepMetrics) Finalize() + func (d *DeepMetrics) StoreAccessCount(kind, name string) int + type HeaderSummary struct + Bytes int + Count int + Name string + func SummarizeHeaders(h http.Header) []HeaderSummary + type HeapAggregates struct + Final int64 + Max int64 + Min int64 + func HeapAggregatesOf(samples []HeapSample) HeapAggregates + type HeapSample struct + MemoryBytes int64 + RelativeNanos int64 + type NativeSample struct + Function string + RelativeNanos int64 + type NativeSampleEvent struct + Function string + PID int + UnixNanos int64 + type NativeSampleImporter interface + Import func(io.Reader) ([]NativeSampleEvent, error) + type PerfScriptImporter struct + func NewPerfScriptImporter() *PerfScriptImporter + func (p *PerfScriptImporter) Import(r io.Reader) ([]NativeSampleEvent, error) + type ProfileMode string + const ProfileModeCombined + const ProfileModeDeep + const ProfileModeNative + const ProfileModeOff + const ProfileModeTrace + func (m ProfileMode) IncludesTrace() bool + type ProfileStore struct + func NewProfileStore() *ProfileStore + func (s *ProfileStore) AsyncGrace() time.Duration + func (s *ProfileStore) BackendCap() int + func (s *ProfileStore) CompleteTrace(t *RequestTrace) + func (s *ProfileStore) Dir() string + func (s *ProfileStore) Get(reqID uint64) *RequestTrace + func (s *ProfileStore) InFlight() []*RequestTrace + func (s *ProfileStore) NewRequestTrace(moduleID string, r *http.Request) *RequestTrace + func (s *ProfileStore) Recent(n int) []*RequestTrace + func (s *ProfileStore) Retain() int + func (s *ProfileStore) SetAsyncGrace(d time.Duration) + func (s *ProfileStore) SetBackendCap(n int) + func (s *ProfileStore) SetDir(dir string) + func (s *ProfileStore) SetRetain(n int) + func (s *ProfileStore) SetUIAddr(addr string) + func (s *ProfileStore) SetUIAuthToken(token string) + func (s *ProfileStore) SetUIInsecure(insecure bool) + func (s *ProfileStore) UIAddr() string + func (s *ProfileStore) UIAuthToken() string + func (s *ProfileStore) UIInsecure() bool + type ProfileUI struct + func NewProfileUI(store *ProfileStore) *ProfileUI + func (p *ProfileUI) ServeHTTP(w http.ResponseWriter, r *http.Request) + type RequestTrace struct + BackendCalls []BackendCall + Deep *DeepMetrics + Dropped int + DroppedBackendCalls int + GuestActiveNanos int64 + HeaderFlushNanos *int64 + HijackedNanos *int64 + HostcallNanos int64 + Method string + ModuleID string + NativeCPUNanos *int64 + NativeSamples []NativeSample + Notes []string + Outcome TraceOutcome + ReqID uint64 + Spans []Span + Status int + URL string + WallNanos int64 + WallStart time.Time + func (t *RequestTrace) MarshalJSON() ([]byte, error) + func (t *RequestTrace) SnapshotNativeSamples() []NativeSample + type ResponseObserver interface + BytesWritten func() int64 + HeaderFlushed func() *int64 + Hijacked func() *int64 + Status func() int + func NewTraceResponseWriter(w http.ResponseWriter) ResponseObserver + type Span struct + Duration int64 + NameIdx uint16 + RC int32 + Start int64 + TagSlots [4]int64 + TagStrIdx [2]uint16 + type StoreAccess struct + Count int + Kind string + Name string + type TraceOutcome uint8 + const TraceOutcomeCtxCanceled + const TraceOutcomeLoopFail + const TraceOutcomeNormal + const TraceOutcomePanic + const TraceOutcomeTrap + func (o TraceOutcome) String() string + type TraceResponseWriter struct + func (t *TraceResponseWriter) BytesWritten() int64 + func (t *TraceResponseWriter) Header() http.Header + func (t *TraceResponseWriter) HeaderFlushed() *int64 + func (t *TraceResponseWriter) Hijacked() *int64 + func (t *TraceResponseWriter) Status() int + func (t *TraceResponseWriter) Write(b []byte) (int, error) + func (t *TraceResponseWriter) WriteHeader(status int)