MCPcopy
hub / github.com/kopia/kopia / initialize

Method initialize

cli/observability_flags.go:106–121  ·  view source on GitHub ↗
(ctx *kingpin.ParseContext)

Source from the content-addressed store, hash-verified

104}
105
106func (c *observabilityFlags) initialize(ctx *kingpin.ParseContext) error {
107 // write to a separate file per command and process execution to avoid
108 // conflicts with previously created files
109 command := "unknown"
110 if cmd := ctx.SelectedCommand; cmd != nil {
111 command = strings.ReplaceAll(cmd.FullCommand(), " ", "-")
112 }
113
114 c.outputSubdirectoryName = clock.Now().Format("20060102-150405-") + command
115
116 if (c.saveMetrics || c.pf.saveProfiles || c.pf.profileCPU) && c.outputDirectory == "" {
117 return errors.New("writing diagnostics output requires a non-empty directory name (specified with the '--diagnostics-output-directory' flag)")
118 }
119
120 return nil
121}
122
123// spanName specifies the name of the span at the start of a trace. A tracer is
124// started only when spanName is not empty.

Callers

nothing calls this directly

Calls 2

NowFunction · 0.92
FormatMethod · 0.65

Tested by

no test coverage detected