perfcounter

package
v0.0.0-debug-20260702 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtxKeyCounters = ctxKeyCounters{}
View Source
var NameForGlobal = func() string {

	name := "global"
	Named.Store(name, globalCounterSet)
	return name
}()
View Source
var Named sync.Map

Functions

func AttachBackgroundExecutorKey

func AttachBackgroundExecutorKey(ctx context.Context) context.Context

func AttachBuildPlanMarkKey

func AttachBuildPlanMarkKey(ctx context.Context, counter *CounterSet) context.Context

AttachBuildPlanMarkKey attaches a *CounterSet to the given context with a BuildPlanMarkKey.

func AttachCalcTableRowsKey

func AttachCalcTableRowsKey(ctx context.Context) context.Context

func AttachCalcTableSizeKey

func AttachCalcTableSizeKey(ctx context.Context) context.Context

func AttachCalcTableStatsKey

func AttachCalcTableStatsKey(ctx context.Context) context.Context

func AttachCompilePlanMarkKey

func AttachCompilePlanMarkKey(ctx context.Context, counter *CounterSet) context.Context

AttachCompilePlanMarkKey attaches a *CounterSet to the given context with a CompilePlanMarkKey.

func AttachExecPipelineKey

func AttachExecPipelineKey(ctx context.Context, counter *CounterSet) context.Context

AttachExecPipelineKey attaches a *CounterSet to the given context with an ExecPipelineMarkKey.

func AttachS3RequestKey

func AttachS3RequestKey(ctx context.Context, counter *CounterSet) context.Context

AttachS3RequestKey attaches a *CounterSet to the given context with an S3RequestKey.

func AttachTxnExecutorKey

func AttachTxnExecutorKey(ctx context.Context) context.Context

func GetCacheStats added in v1.1.0

func GetCacheStats(callback func(info []*query.CacheInfo))

GetCacheStats returns the cache stats for nodes.

func IsInternalExecutor

func IsInternalExecutor(ctx context.Context) bool

IsInternalExecutor checks if the given context contains the TxnExecutorKey

func LogNodeCacheStats added in v1.1.0

func LogNodeCacheStats(uuid string)

func NameForFileService added in v1.1.0

func NameForFileService(nodeType string, uuid string, fsName string) string

func NameForNode added in v1.1.0

func NameForNode(nodeType, uuid string) string

func Update

func Update(ctx context.Context, fn func(*CounterSet), extraCounterSets ...*CounterSet)

func WithCounterSet

func WithCounterSet(ctx context.Context, sets ...*CounterSet) context.Context

func WithCounterSetFrom

func WithCounterSetFrom(ctx context.Context, fromCtx context.Context) context.Context

Types

type BackgroundExecutorKey

type BackgroundExecutorKey struct{}

Background Executor Internal Executor

type BuildPlanMarkKey

type BuildPlanMarkKey struct{}

BuildPlanMarkKey is an empty struct used as a key for attaching a build plan counter to a context.

type CalcTableRowsKey

type CalcTableRowsKey struct{}

type CalcTableSizeKey

type CalcTableSizeKey struct{}

type CalcTableStatsKey

type CalcTableStatsKey struct{}

------------------------------------------------------------------------------------------------

type CompilePlanMarkKey

type CompilePlanMarkKey struct{}

CompilePlanMarkKey is an empty struct used as a key for attaching a compile plan counter to a context.

type CounterSet

type CounterSet struct {
	FileService FileServiceCounterSet
}

func GetS3RequestKey

func GetS3RequestKey(ctx context.Context) (*CounterSet, bool)

func (*CounterSet) Reset

func (c *CounterSet) Reset()

func (*CounterSet) ServeHTTP

func (c *CounterSet) ServeHTTP(w http.ResponseWriter, req *http.Request)

type CounterSets

type CounterSets = map[*CounterSet]struct{}

type ExecPipelineMarkKey

type ExecPipelineMarkKey struct{}

ExecPipelineMarkKey is an empty struct used as a key for attaching an execution pipeline counter to a context.

type FileServiceCounterSet

type FileServiceCounterSet struct {
	S3 struct {
		List        atomic.Int64 // listObjects:List all Objects  [Put type request]
		Head        atomic.Int64 // statObject:View all meta information contained in the object [Get type request]
		Put         atomic.Int64 // putObject:Upload an Object   [Put type request]
		Get         atomic.Int64 // getObject:Download an Object   [Get type request]
		Delete      atomic.Int64 // deleteObject:Delete a single Object [Put type request]
		DeleteMulti atomic.Int64 // deleteObjects:Delete multiple Objects [Put type request]
	}

	Cache struct {
		Read   atomic.Int64 // CacheRead
		Hit    atomic.Int64 // CacheHit
		Memory struct {
			Read atomic.Int64 // CacheMemoryRead
			Hit  atomic.Int64 // CacheMemoryHit
		}
		Disk struct {
			Read atomic.Int64 // CacheDiskRead
			Hit  atomic.Int64 // CacheDiskHit
		}
		Remote struct {
			Read atomic.Int64 // CacheRemoteRead
			Hit  atomic.Int64 // CacheRemoteHit
		}
	}

	// ReadSize: actual bytes read from storage layer (excluding rowid tombstone)
	ReadSize atomic.Int64
	// S3ReadSize: actual bytes read from S3 (excluding rowid tombstone)
	S3ReadSize atomic.Int64
	// DiskReadSize: actual bytes read from disk cache (excluding rowid tombstone)
	DiskReadSize atomic.Int64
}

type S3RequestKey

type S3RequestKey struct{}

---------------------------------------------------------------------------------------------------------------------- S3RequestKey is an empty struct used as a key for attaching S3 request counters to a context, which used to count the usage of S3 resources when a certain function is called

type TxnExecutorKey

type TxnExecutorKey struct{}

TxnExecutorKey `refers to `TxnExecuter`

Jump to

Keyboard shortcuts

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