Documentation ¶
Index ¶
- Constants
- Variables
- func ConditionallyStartStatsServer(addhandlers ...func(mux *http.ServeMux, profiles map[string]string))
- func Index(w http.ResponseWriter, r *http.Request)
- func RunCancellableGoroutineStat(ctx context.Context)
- func RunGoroutineStat()
- func StartCancellableStatsServerWithPort(ctx context.Context, startupOpts StartupOptions, ...)
- func StartStatsServerWithPort(startupOpts StartupOptions, ...)
- type StartupOptions
Constants ¶
View Source
const ( DefaultEnvVar = "START_STATS_SERVER" DefaultEnabledValue = "true" DefaultPort = 9091 )
Variables ¶
View Source
var ( MNumGoRoutines = stats.Int64("runtime/goroutines", "The number of goroutines", "1") GoroutinesNumView = &view.View{ Name: "runtime/goroutines", Measure: MNumGoRoutines, Description: "The number of goroutines", Aggregation: view.Sum(), } )
Functions ¶
func ConditionallyStartStatsServer ¶ added in v0.11.5
func ConditionallyStartStatsServer(addhandlers ...func(mux *http.ServeMux, profiles map[string]string))
start the server with the default startup options
func RunCancellableGoroutineStat ¶ added in v0.21.27
func RunGoroutineStat ¶
func RunGoroutineStat()
func StartCancellableStatsServerWithPort ¶ added in v0.21.27
func StartStatsServerWithPort ¶
func StartStatsServerWithPort(startupOpts StartupOptions, addhandlers ...func(mux *http.ServeMux, profiles map[string]string))
Types ¶
type StartupOptions ¶ added in v0.11.5
type StartupOptions struct { // only start the server if this env var is present in the environment, and it is set to the given value // a StartStatsServer invocation when this is not the case is a no-op // if EnvVar is not provided, then the server starts unconditionally EnvVar string EnabledValue string // listen on this port Port int // If set, the server will use this `AtomicLevel` to serve // the "/logging" endpoint instead of building its own logger. LogLevel *zap.AtomicLevel }
func DefaultStartupOptions ¶ added in v0.11.5
func DefaultStartupOptions() StartupOptions
return options indicating that the server should:
- start up only if DefaultEnvVar is set to DefaultEnabledValue
- listen on DefaultPort
Click to show internal directories.
Click to hide internal directories.