mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Add memory profiling for custom builds (#5584)
This commit is contained in:
@@ -20,12 +20,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/mitchellh/cli"
|
||||
testing "github.com/mitchellh/go-testing-interface"
|
||||
"github.com/posener/complete"
|
||||
|
||||
"google.golang.org/grpc/grpclog"
|
||||
|
||||
"github.com/armon/go-metrics"
|
||||
"github.com/armon/go-metrics/circonus"
|
||||
"github.com/armon/go-metrics/datadog"
|
||||
@@ -49,11 +43,17 @@ import (
|
||||
"github.com/hashicorp/vault/vault"
|
||||
vaultseal "github.com/hashicorp/vault/vault/seal"
|
||||
"github.com/hashicorp/vault/version"
|
||||
"github.com/mitchellh/cli"
|
||||
testing "github.com/mitchellh/go-testing-interface"
|
||||
"github.com/posener/complete"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
)
|
||||
|
||||
var _ cli.Command = (*ServerCommand)(nil)
|
||||
var _ cli.CommandAutocomplete = (*ServerCommand)(nil)
|
||||
|
||||
var memProfilerEnabled = false
|
||||
|
||||
const storageMigrationLock = "core/migration"
|
||||
|
||||
type ServerCommand struct {
|
||||
@@ -431,6 +431,10 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
log: os.Getenv("VAULT_GRPC_LOGGING") != "",
|
||||
})
|
||||
|
||||
if memProfilerEnabled {
|
||||
c.startMemProfiler()
|
||||
}
|
||||
|
||||
// Ensure that a backend is provided
|
||||
if config.Storage == nil {
|
||||
c.UI.Output("A storage backend must be specified")
|
||||
|
||||
Reference in New Issue
Block a user