mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Remove metrics: fallback, vsyscallCount and partialResult
The newly added Weirdness metric with fields should be used instead of them. Simple query for weirdness metric: http://shortn/_DGNk0z2Up6 PiperOrigin-RevId: 370578132
This commit is contained in:
committed by
gVisor bot
parent
509f5aa57f
commit
5b207fe783
@@ -37,7 +37,7 @@ var (
|
||||
ErrInitializationDone = errors.New("metric cannot be created after initialization is complete")
|
||||
|
||||
// WeirdnessMetric is a metric with fields created to track the number
|
||||
// of weird occurrences such as clock fallback, partial_result and
|
||||
// of weird occurrences such as time fallback, partial_result and
|
||||
// vsyscall count.
|
||||
WeirdnessMetric *Uint64Metric
|
||||
)
|
||||
@@ -392,9 +392,9 @@ func CreateSentryMetrics() {
|
||||
return
|
||||
}
|
||||
|
||||
WeirdnessMetric = MustCreateNewUint64Metric("/weirdness", true /* sync */, "Increment for weird occurrences of problems such as clock fallback, partial result and vsyscalls invoked in the sandbox",
|
||||
WeirdnessMetric = MustCreateNewUint64Metric("/weirdness", true /* sync */, "Increment for weird occurrences of problems such as time fallback, partial result and vsyscalls invoked in the sandbox",
|
||||
Field{
|
||||
name: "weirdness_type",
|
||||
allowedValues: []string{"fallback", "partial_result", "vsyscall_count"},
|
||||
allowedValues: []string{"time_fallback", "partial_result", "vsyscall_count"},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/syserror"
|
||||
)
|
||||
|
||||
var vsyscallCount = metric.MustCreateNewUint64Metric("/kernel/vsyscall_count", false /* sync */, "Number of times vsyscalls were invoked by the application")
|
||||
|
||||
// SyscallRestartBlock represents the restart block for a syscall restartable
|
||||
// with a custom function. It encapsulates the state required to restart a
|
||||
// syscall across a S/R.
|
||||
@@ -284,7 +282,6 @@ func (*runSyscallExit) execute(t *Task) taskRunState {
|
||||
// indicated by an execution fault at address addr. doVsyscall returns the
|
||||
// task's next run state.
|
||||
func (t *Task) doVsyscall(addr hostarch.Addr, sysno uintptr) taskRunState {
|
||||
vsyscallCount.Increment()
|
||||
metric.WeirdnessMetric.Increment("vsyscall_count")
|
||||
|
||||
// Grab the caller up front, to make sure there's a sensible stack.
|
||||
|
||||
@@ -29,8 +29,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
partialResultMetric = metric.MustCreateNewUint64Metric("/syscalls/partial_result", true /* sync */, "Whether or not a partial result has occurred for this sandbox.")
|
||||
partialResultOnce sync.Once
|
||||
partialResultOnce sync.Once
|
||||
)
|
||||
|
||||
// incrementPartialResultMetric increments PartialResultMetric by calling
|
||||
@@ -38,7 +37,6 @@ var (
|
||||
// us to pass a function which does not take any arguments, whereas Increment()
|
||||
// takes a variadic number of arguments.
|
||||
func incrementPartialResultMetric() {
|
||||
partialResultMetric.Increment()
|
||||
metric.WeirdnessMetric.Increment("partial_result")
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,6 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/syserror"
|
||||
)
|
||||
|
||||
// fallbackMetric tracks failed updates. It is not sync, as it is not critical
|
||||
// that all occurrences are captured and CalibratedClock may fallback many
|
||||
// times.
|
||||
var fallbackMetric = metric.MustCreateNewUint64Metric("/time/fallback", false /* sync */, "Incremented when a clock falls back to system calls due to a failed update")
|
||||
|
||||
// CalibratedClock implements a clock that tracks a reference clock.
|
||||
//
|
||||
// Users should call Update at regular intervals of around approxUpdateInterval
|
||||
@@ -102,8 +97,7 @@ func (c *CalibratedClock) resetLocked(str string, v ...interface{}) {
|
||||
c.Warningf(str+" Resetting clock; time may jump.", v...)
|
||||
c.ready = false
|
||||
c.ref.Reset()
|
||||
fallbackMetric.Increment()
|
||||
metric.WeirdnessMetric.Increment("fallback")
|
||||
metric.WeirdnessMetric.Increment("time_fallback")
|
||||
}
|
||||
|
||||
// updateParams updates the timekeeping parameters based on the passed
|
||||
|
||||
Reference in New Issue
Block a user