MCPcopy Create free account
hub / github.com/cloudbase/garm / Duration

Method Duration

config/config.go:690–700  ·  view source on GitHub ↗

Duration returns the configured duration or the default duration if no value is configured or the configured value is invalid.

()

Source from the content-addressed store, hash-verified

688// Duration returns the configured duration or the default duration if no value
689// is configured or the configured value is invalid.
690func (m *Metrics) Duration() time.Duration {
691 duration, err := m.ParseDuration()
692 if err != nil {
693 slog.With(slog.Any("error", err)).Error(fmt.Sprintf("defined duration %s is invalid", m.Period))
694 }
695 if duration == 0 {
696 slog.Debug(fmt.Sprintf("using default duration %s for metrics update interval", appdefaults.DefaultMetricsUpdateInterval))
697 return appdefaults.DefaultMetricsUpdateInterval
698 }
699 return duration
700}
701
702// WebUI holds configuration for the web UI
703type WebUI struct {

Callers 14

ShouldProcessMethod · 0.45
NewInstanceJWTTokenMethod · 0.45
GetJWTTokenMethod · 0.45
GetJWTMetricsTokenMethod · 0.45
mainFunction · 0.45
JobBackoffMethod · 0.45
giteaUpdateLoopMethod · 0.45
loopMethod · 0.45
keepListenerAliveMethod · 0.45
RecordFailureMethod · 0.45
requestLoggerFunction · 0.45

Calls 2

ParseDurationMethod · 0.95
ErrorMethod · 0.45

Tested by 1

TestTimeToLiveDurationFunction · 0.36