github.com/ttpreport/gvisor-ligolo@v0.0.0-20240123134145-a858404967ba/pkg/metric/condmetric_profiling.go (about) 1 // Copyright 2022 The gVisor Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 //go:build condmetric_profiling 16 // +build condmetric_profiling 17 18 package metric 19 20 // This file defines conditional metrics that are meant to be used when profiling 21 // runsc during benchmark tests. 22 23 // ProfilingUint64Metric is a metric type that is registered and used only when 24 // the "condmetric_profiling" go tag is specified for go build. 25 // 26 // Otherwise it is exactly like a Uint64Metric. 27 type ProfilingUint64Metric = Uint64Metric 28 29 // ProfilingDistributionMetric is a metric type that is registered and used only 30 // when the "condmetric_profiling" go tag is specified for go build. 31 // 32 // Otherwise it is exactly like a DistributionMetric. 33 type ProfilingDistributionMetric = DistributionMetric 34 35 // ProfilingTimerMetric is a metric type that is registered and used only when 36 // the "condmetric_profiling" go tag is specified for go build. 37 // 38 // Otherwise it is exactly like a TimerMetric. 39 type ProfilingTimerMetric = TimerMetric 40 41 // NewProfilingUint64Metric is equivalent to NewUint64Metric except it creates a 42 // ProfilingUint64Metric 43 var NewProfilingUint64Metric = NewUint64Metric 44 45 // MustCreateNewProfilingUint64Metric is equivalent to MustCreateNewUint64Metric 46 // except it creates a ProfilingUint64Metric. 47 var MustCreateNewProfilingUint64Metric = MustCreateNewUint64Metric 48 49 // NewProfilingDistributionMetric is equivalent to NewDistributionMetric except 50 // it creates a ProfilingDistributionMetric. 51 var NewProfilingDistributionMetric = NewDistributionMetric 52 53 // MustCreateNewProfilingDistributionMetric is equivalent to 54 // MustCreateNewDistributionMetric except it creates a 55 // ProfilingDistributionMetric. 56 var MustCreateNewProfilingDistributionMetric = MustCreateNewDistributionMetric 57 58 // NewProfilingTimerMetric is equivalent to NewTimerMetric except it creates a 59 // ProfilingTimerMetric. 60 var NewProfilingTimerMetric = NewTimerMetric 61 62 // MustCreateNewProfilingTimerMetric is equivalent to MustCreateNewTimerMetric 63 // except it creates a ProfilingTimerMetric. 64 var MustCreateNewProfilingTimerMetric = MustCreateNewTimerMetric