getPort returns the JMX port
()
| 113 | |
| 114 | // getPort returns the JMX port |
| 115 | func (j *jmxConfig) getPort() int { |
| 116 | // Check BPL_JMX_PORT first (Cloud Native Buildpacks convention) |
| 117 | bplPort := os.Getenv("BPL_JMX_PORT") |
| 118 | if bplPort != "" { |
| 119 | if port, err := strconv.Atoi(bplPort); err == nil && port > 0 { |
| 120 | return port |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | return j.Port |
| 125 | } |
| 126 | |
| 127 | type jmxConfig struct { |
| 128 | Enabled bool `yaml:"enabled"` |