Documentation ¶
Index ¶
- Constants
- Variables
- type AppPath
- type Calculator
- type Contributor
- type EnableJdwp
- type EnableJfr
- type EnableJmx
- type EnableNmt
- type HeadRoom
- type JVMCacerts
- type JVMClassAdj
- type JVMClassCount
- type JVMOptions
- type JavaToolOptions
- type LoadedClassCount
- type MemoryLimitPath
- type ThreadCount
- type Verbose
Constants ¶
View Source
const ( DefaultAppPath = AppPath("/app") FlagAppPath = "app-path" EnvAppPath = "BPI_APPLICATION_PATH" UsageAppPath = "the directory on the container where the app's contents are placed" )
View Source
const ( DefaultEnableJdwp = EnableJdwp(true) FlagEnableJdwp = "enable-jdwp" EnvEnableJdwp = "BPL_DEBUG_ENABLED" UsageEnableJdwp = "enables Java Debug Wire Protocol (JDWP)" )
View Source
const ( DefaultEnableJfr = EnableJfr(false) FlagEnableJfr = "enable-jfr" EnvEnableJfr = "BPL_JFR_ENABLED" UsageEnableJfr = "enables Java Flight Recorder (JFR)" )
View Source
const ( DefaultEnableJmx = EnableJmx(false) FlagEnableJmx = "enable-jmx" EnvEnableJmx = "BPL_JMX_ENABLED" UsageEnableJmx = "enables Java Management Extensions (JMX)" )
View Source
const ( DefaultEnableNmt = EnableNmt(false) FlagEnableNmt = "enable-nmt" EnvEnableNmt = "BPL_JAVA_NMT_ENABLED" UsageEnableNmt = "enables Native Memory Tracking (NMT)" )
View Source
const ( DefaultHeadRoom = HeadRoom(helper.DefaultHeadroom) FlagHeadRoom = "head-room" EnvHeadRoom = "BPL_JVM_HEAD_ROOM" UsageHeadRoom = "percentage of total memory available which will be left unallocated to cover JVM overhead" )
View Source
const ( EnvJavaToolOptions = "JAVA_TOOL_OPTIONS" OptionsSeparator = " " )
View Source
const ( DefaultJVMCacerts = JVMCacerts("") FlagJVMCacerts = "jvm-cacerts" EnvJVMCacerts = "BPI_JVM_CACERTS" UsageJVMCacerts = "path to jvm cacerts, typically 'JAVA_HOME" + subPathCacerts + "'" )
View Source
const ( DefaultJVMClassAdj = JVMClassAdj("") FlagJVMClassAdj = "jvm-class-adj" EnvJVMClassAdj = "BPL_JVM_CLASS_ADJUSTMENT" UsageJVMClassAdj = "the adjustment for the number or percentage of JVM classes" )
View Source
const ( DefaultJVMClassCount = JVMClassCount(0) FlagJVMClassCount = "jvm-class-count" EnvJVMClassCount = "BPI_JVM_CLASS_COUNT" UsageJVMClassCount = "the number of JVM classes" )
View Source
const ( DefaultJVMOptions = JVMOptions("") FlagJVMOptions = "jvm-options" EnvJVMOptions = "JAVA_OPTS" UsageJVMOptions = "vm options, typically JAVA_OPTS" )
View Source
const ( DefaultLoadedClassCount = LoadedClassCount(0) FlagLoadedClassCount = "loaded-class-count" EnvLoadedClassCount = "BPL_JVM_LOADED_CLASS_COUNT" UsageLoadedClassCount = "the number of classes that will be loaded when the app is running" )
View Source
const ( DefaultThreadCount = ThreadCount(200) FlagThreadCount = "thread-count" EnvThreadCount = "BPL_JVM_THREAD_COUNT" UsageThreadCount = "the number of user threads" )
View Source
const ( DefaultVerbose = Verbose(false) FlagVerbose = "verbose" FlagShortVerbose = "v" EnvVerbose = "BP_LOG_LEVEL" UsageVerbose = "enable verbose output" )
Variables ¶
View Source
var ContributeOptions = []string{"-XX:+ExitOnOutOfMemoryError"}
ContributeOptions 固定要貢獻 jvm 的參數, 這些參數可能是 libjvm 在 build image 時加的而非計算出來的, 或是我們自己想要加上去的都可以放
Functions ¶
This section is empty.
Types ¶
type AppPath ¶
type AppPath string
func NewAppPath ¶
func NewAppPath() *AppPath
func (*AppPath) Contribute ¶
type Calculator ¶
type Calculator struct { // MemoryLimitPath 一般情境不需要調整, 開出來是讓 test 時可以設定細節 MemoryLimitPath *MemoryLimitPath JVMOptions *JVMOptions HeadRoom *HeadRoom ThreadCount *ThreadCount LoadedClassCount *LoadedClassCount JVMClassCount *JVMClassCount JVMClassAdj *JVMClassAdj JVMCacerts *JVMCacerts AppPath *AppPath EnableNmt *EnableNmt EnableJfr *EnableJfr EnableJmx *EnableJmx EnableJdwp *EnableJdwp Verbose *Verbose }
func NewCalculator ¶
func NewCalculator() Calculator
func (*Calculator) Execute ¶
func (c *Calculator) Execute() (*JavaToolOptions, error)
type Contributor ¶
type Contributor interface { // Contribute 在執行底層 libjbm 前, 所要貢獻的內容, 這會在執行前先被呼叫, 通常是一些參數的設定等 Contribute() error }
type EnableJdwp ¶
type EnableJdwp bool
func NewEnableJdwp ¶
func NewEnableJdwp() *EnableJdwp
func (*EnableJdwp) Contribute ¶
func (jdwp *EnableJdwp) Contribute() error
func (*EnableJdwp) Set ¶
func (jdwp *EnableJdwp) Set(s string) error
func (*EnableJdwp) String ¶
func (jdwp *EnableJdwp) String() string
func (*EnableJdwp) Type ¶
func (jdwp *EnableJdwp) Type() string
type EnableJfr ¶
type EnableJfr bool
func NewEnableJfr ¶
func NewEnableJfr() *EnableJfr
func (*EnableJfr) Contribute ¶
type EnableJmx ¶
type EnableJmx bool
func NewEnableJmx ¶
func NewEnableJmx() *EnableJmx
func (*EnableJmx) Contribute ¶
type EnableNmt ¶
type EnableNmt bool
func NewEnableNmt ¶
func NewEnableNmt() *EnableNmt
func (*EnableNmt) Contribute ¶
type HeadRoom ¶
type HeadRoom int
func NewHeadRoom ¶
func NewHeadRoom() *HeadRoom
func (*HeadRoom) Contribute ¶
type JVMCacerts ¶
type JVMCacerts string
func NewJVMCacerts ¶
func NewJVMCacerts() *JVMCacerts
func (*JVMCacerts) Contribute ¶
func (j *JVMCacerts) Contribute() error
func (*JVMCacerts) Set ¶
func (j *JVMCacerts) Set(s string) error
func (*JVMCacerts) String ¶
func (j *JVMCacerts) String() string
func (*JVMCacerts) Type ¶
func (j *JVMCacerts) Type() string
type JVMClassAdj ¶
type JVMClassAdj string
func NewJVMClassAdj ¶
func NewJVMClassAdj() *JVMClassAdj
func (*JVMClassAdj) Contribute ¶
func (j *JVMClassAdj) Contribute() error
func (*JVMClassAdj) Set ¶
func (j *JVMClassAdj) Set(s string) error
func (*JVMClassAdj) String ¶
func (j *JVMClassAdj) String() string
func (*JVMClassAdj) Type ¶
func (j *JVMClassAdj) Type() string
type JVMClassCount ¶
type JVMClassCount int
func NewJVMClassCount ¶
func NewJVMClassCount() *JVMClassCount
func (*JVMClassCount) Contribute ¶
func (lcc *JVMClassCount) Contribute() error
func (*JVMClassCount) Set ¶
func (lcc *JVMClassCount) Set(s string) error
func (*JVMClassCount) String ¶
func (lcc *JVMClassCount) String() string
func (*JVMClassCount) Type ¶
func (lcc *JVMClassCount) Type() string
type JVMOptions ¶
type JVMOptions string
func NewJVMOptions ¶
func NewJVMOptions() *JVMOptions
func (*JVMOptions) Contribute ¶
func (j *JVMOptions) Contribute() error
func (*JVMOptions) Set ¶
func (j *JVMOptions) Set(s string) error
func (*JVMOptions) String ¶
func (j *JVMOptions) String() string
func (*JVMOptions) Type ¶
func (j *JVMOptions) Type() string
type JavaToolOptions ¶
type JavaToolOptions string
func BuildJavaToolOptions ¶
func BuildJavaToolOptions() *JavaToolOptions
func (*JavaToolOptions) Print ¶
func (j *JavaToolOptions) Print()
func (*JavaToolOptions) String ¶
func (j *JavaToolOptions) String() string
func (*JavaToolOptions) WriteFile ¶
func (j *JavaToolOptions) WriteFile(file string) error
type LoadedClassCount ¶
type LoadedClassCount int
func NewLoadedClassCount ¶
func NewLoadedClassCount() *LoadedClassCount
func (*LoadedClassCount) Contribute ¶
func (lcc *LoadedClassCount) Contribute() error
func (*LoadedClassCount) HasValue ¶
func (lcc *LoadedClassCount) HasValue() bool
func (*LoadedClassCount) Set ¶
func (lcc *LoadedClassCount) Set(s string) error
func (*LoadedClassCount) String ¶
func (lcc *LoadedClassCount) String() string
func (*LoadedClassCount) Type ¶
func (lcc *LoadedClassCount) Type() string
type MemoryLimitPath ¶
func NewMemoryLimitPath ¶
func NewMemoryLimitPath() *MemoryLimitPath
type ThreadCount ¶
type ThreadCount int
func NewThreadCount ¶
func NewThreadCount() *ThreadCount
func (*ThreadCount) Contribute ¶
func (tc *ThreadCount) Contribute() error
func (*ThreadCount) Set ¶
func (tc *ThreadCount) Set(s string) error
func (*ThreadCount) String ¶
func (tc *ThreadCount) String() string
func (*ThreadCount) Type ¶
func (tc *ThreadCount) Type() string
type Verbose ¶
type Verbose bool
func NewVerbose ¶
func NewVerbose() *Verbose
func (*Verbose) Contribute ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.