Documentation ¶
Index ¶
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 RunGoroutineStat ¶
func RunGoroutineStat()
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 }
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.