MCPcopy
hub / github.com/google/cadvisor / Set

Method Set

lib/container/factory.go:140–153  ·  view source on GitHub ↗

Not thread-safe, exported only for https://pkg.go.dev/flag#Value

(value string)

Source from the content-addressed store, hash-verified

138
139// Not thread-safe, exported only for https://pkg.go.dev/flag#Value
140func (ms *MetricSet) Set(value string) error {
141 *ms = MetricSet{}
142 if value == "" {
143 return nil
144 }
145 for _, metric := range strings.Split(value, ",") {
146 if AllMetrics.Has(MetricKind(metric)) {
147 (*ms).add(MetricKind(metric))
148 } else {
149 return fmt.Errorf("unsupported metric %q specified", metric)
150 }
151 }
152 return nil
153}
154
155func (ms MetricSet) Difference(ms1 MetricSet) MetricSet {
156 result := MetricSet{}

Callers 13

StatsMethod · 0.80
withTTRPCNamespaceHeaderFunction · 0.80
TestCopyTTRPCMetadataFunction · 0.80
CollectMethod · 0.80
collectMachineInfoMethod · 0.80
CollectMethod · 0.80
collectContainersInfoMethod · 0.80
collectVersionInfoMethod · 0.80
mainFunction · 0.80
HandleRequestFunction · 0.80
writeResultFunction · 0.80

Calls 4

MetricKindTypeAlias · 0.85
HasMethod · 0.80
addMethod · 0.80
ErrorfMethod · 0.80

Tested by 2

TestCopyTTRPCMetadataFunction · 0.64