mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
instrumentation: instrumentation for locks. (#2584)
- Instrumentation for locks. - Detailed test coverage. - Adding RPC control handler to fetch lock instrumentation. - RPC control handlers suite tests with a test RPC server.
This commit is contained in:
committed by
Harshavardhana
parent
de67bca211
commit
07d232c7b4
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/minio/minio/pkg/objcache"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Global constants for Minio.
|
||||
@@ -42,6 +43,10 @@ const (
|
||||
var (
|
||||
globalQuiet = false // Quiet flag set via command line
|
||||
globalTrace = false // Trace flag set via environment setting.
|
||||
|
||||
globalDebug = false // Debug flag set to print debug info.
|
||||
globalDebugLock = false // Lock debug info set via environment variable MINIO_DEBUG=lock .
|
||||
globalDebugMemory = false // Memory debug info set via environment variable MINIO_DEBUG=mem
|
||||
// Add new global flags here.
|
||||
|
||||
// Maximum connections handled per
|
||||
@@ -70,3 +75,15 @@ var (
|
||||
colorBlue = color.New(color.FgBlue).SprintfFunc()
|
||||
colorBold = color.New(color.Bold).SprintFunc()
|
||||
)
|
||||
|
||||
// fetch from environment variables and set the global values related to locks.
|
||||
func setGlobalsDebugFromEnv() {
|
||||
debugEnv := os.Getenv("MINIO_DEBUG")
|
||||
switch debugEnv {
|
||||
case "lock":
|
||||
globalDebugLock = true
|
||||
case "mem":
|
||||
globalDebugMemory = true
|
||||
}
|
||||
globalDebug = globalDebugLock || globalDebugMemory
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user