Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c97633b1
Commit
c97633b1
authored
Nov 14, 2016
by
gmarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a flag allowing contention profiling of the API server
parent
984fb711
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
known-flags.txt
hack/verify-flags/known-flags.txt
+1
-0
config.go
pkg/genericapiserver/config.go
+11
-4
server_run_options.go
pkg/genericapiserver/options/server_run_options.go
+4
-0
No files found.
hack/verify-flags/known-flags.txt
View file @
c97633b1
...
@@ -106,6 +106,7 @@ container-port
...
@@ -106,6 +106,7 @@ container-port
container-runtime
container-runtime
container-runtime-endpoint
container-runtime-endpoint
contain-pod-resources
contain-pod-resources
contention-profiling
controller-start-interval
controller-start-interval
cors-allowed-origins
cors-allowed-origins
cpu-cfs-quota
cpu-cfs-quota
...
...
pkg/genericapiserver/config.go
View file @
c97633b1
...
@@ -24,6 +24,7 @@ import (
...
@@ -24,6 +24,7 @@ import (
"os"
"os"
"path"
"path"
"regexp"
"regexp"
goruntime
"runtime"
"sort"
"sort"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -78,10 +79,12 @@ type Config struct {
...
@@ -78,10 +79,12 @@ type Config struct {
// Allows api group versions or specific resources to be conditionally enabled/disabled.
// Allows api group versions or specific resources to be conditionally enabled/disabled.
APIResourceConfigSource
APIResourceConfigSource
APIResourceConfigSource
APIResourceConfigSource
// allow downstream consumers to disable the index route
// allow downstream consumers to disable the index route
EnableIndex
bool
EnableIndex
bool
EnableProfiling
bool
EnableProfiling
bool
EnableMetrics
bool
// Requires generic profiling enabled
EnableGarbageCollection
bool
EnableContentionProfiling
bool
EnableMetrics
bool
EnableGarbageCollection
bool
Version
*
version
.
Info
Version
*
version
.
Info
CorsAllowedOriginList
[]
string
CorsAllowedOriginList
[]
string
...
@@ -285,6 +288,7 @@ func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config {
...
@@ -285,6 +288,7 @@ func (c *Config) ApplyOptions(options *options.ServerRunOptions) *Config {
c
.
CorsAllowedOriginList
=
options
.
CorsAllowedOriginList
c
.
CorsAllowedOriginList
=
options
.
CorsAllowedOriginList
c
.
EnableGarbageCollection
=
options
.
EnableGarbageCollection
c
.
EnableGarbageCollection
=
options
.
EnableGarbageCollection
c
.
EnableProfiling
=
options
.
EnableProfiling
c
.
EnableProfiling
=
options
.
EnableProfiling
c
.
EnableContentionProfiling
=
options
.
EnableContentionProfiling
c
.
EnableSwaggerUI
=
options
.
EnableSwaggerUI
c
.
EnableSwaggerUI
=
options
.
EnableSwaggerUI
c
.
ExternalAddress
=
options
.
ExternalHost
c
.
ExternalAddress
=
options
.
ExternalHost
c
.
MaxRequestsInFlight
=
options
.
MaxRequestsInFlight
c
.
MaxRequestsInFlight
=
options
.
MaxRequestsInFlight
...
@@ -462,6 +466,9 @@ func (s *GenericAPIServer) installAPI(c *Config) {
...
@@ -462,6 +466,9 @@ func (s *GenericAPIServer) installAPI(c *Config) {
}
}
if
c
.
EnableProfiling
{
if
c
.
EnableProfiling
{
routes
.
Profiling
{}
.
Install
(
s
.
HandlerContainer
)
routes
.
Profiling
{}
.
Install
(
s
.
HandlerContainer
)
if
c
.
EnableContentionProfiling
{
goruntime
.
SetBlockProfileRate
(
1
)
}
}
}
if
c
.
EnableMetrics
{
if
c
.
EnableMetrics
{
if
c
.
EnableProfiling
{
if
c
.
EnableProfiling
{
...
...
pkg/genericapiserver/options/server_run_options.go
View file @
c97633b1
...
@@ -83,6 +83,7 @@ type ServerRunOptions struct {
...
@@ -83,6 +83,7 @@ type ServerRunOptions struct {
AuditLogMaxSize
int
AuditLogMaxSize
int
EnableGarbageCollection
bool
EnableGarbageCollection
bool
EnableProfiling
bool
EnableProfiling
bool
EnableContentionProfiling
bool
EnableSwaggerUI
bool
EnableSwaggerUI
bool
EnableWatchCache
bool
EnableWatchCache
bool
EtcdServersOverrides
[]
string
EtcdServersOverrides
[]
string
...
@@ -139,6 +140,7 @@ func NewServerRunOptions() *ServerRunOptions {
...
@@ -139,6 +140,7 @@ func NewServerRunOptions() *ServerRunOptions {
DeleteCollectionWorkers
:
1
,
DeleteCollectionWorkers
:
1
,
EnableGarbageCollection
:
true
,
EnableGarbageCollection
:
true
,
EnableProfiling
:
true
,
EnableProfiling
:
true
,
EnableContentionProfiling
:
false
,
EnableWatchCache
:
true
,
EnableWatchCache
:
true
,
InsecureBindAddress
:
net
.
ParseIP
(
"127.0.0.1"
),
InsecureBindAddress
:
net
.
ParseIP
(
"127.0.0.1"
),
InsecurePort
:
8080
,
InsecurePort
:
8080
,
...
@@ -347,6 +349,8 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
...
@@ -347,6 +349,8 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
fs
.
BoolVar
(
&
s
.
EnableProfiling
,
"profiling"
,
s
.
EnableProfiling
,
fs
.
BoolVar
(
&
s
.
EnableProfiling
,
"profiling"
,
s
.
EnableProfiling
,
"Enable profiling via web interface host:port/debug/pprof/"
)
"Enable profiling via web interface host:port/debug/pprof/"
)
fs
.
BoolVar
(
&
s
.
EnableContentionProfiling
,
"contention-profiling"
,
s
.
EnableContentionProfiling
,
"Enable contention profiling. Requires --profiling to be set to work."
)
fs
.
BoolVar
(
&
s
.
EnableSwaggerUI
,
"enable-swagger-ui"
,
s
.
EnableSwaggerUI
,
fs
.
BoolVar
(
&
s
.
EnableSwaggerUI
,
"enable-swagger-ui"
,
s
.
EnableSwaggerUI
,
"Enables swagger ui on the apiserver at /swagger-ui"
)
"Enables swagger ui on the apiserver at /swagger-ui"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment