config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTemplate

func CreateTemplate() error

CreateTemplate creates a template configuration file from the actual Config struct with pre-built examples.

Types

type Config

type Config struct {
	FunctionFilter map[string]FunctionFilter `json:"function_collection_filter"`
}

Config holds the main configuration for the prof tool.

func LoadFromFile

func LoadFromFile(filename string) (*Config, error)

LoadFromFile loads and validates config from a JSON file.

type FunctionFilter

type FunctionFilter struct {
	// Prefixes: only collect functions starting with these prefixes
	// Example: []string{"github.com/myorg", "main."}
	IncludePrefixes []string `json:"include_prefixes,omitempty"`

	// IgnoreFunctions ignores the function name after the last dot.
	// Example: "Get,Set" excludes pool.Get() and cache.Set()
	IgnoreFunctions []string `json:"ignore_functions,omitempty"`
}

FunctionCollectionFilter defines filters for a specific benchmark, the filters are used when deciding which functions to collect code line level information for.

Jump to

Keyboard shortcuts

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