Documentation ¶
Index ¶
- Constants
- func GenerateUUID() string
- func GrabEphemeralPort() (port uint16, err error)
- func LocalIP() (string, error)
- func Register(c *VcapComponent, mbusClient yagnats.NATSClient)
- func StartComponent(c *VcapComponent)
- type Duration
- type GenericVarz
- type Healthz
- type Lockable
- type LogCounter
- type ProcessStatus
- type RouterStart
- type Time
- type Varz
- type VcapComponent
Constants ¶
View Source
const RefreshInterval time.Duration = time.Second * 1
Variables ¶
This section is empty.
Functions ¶
func GenerateUUID ¶
func GenerateUUID() string
func GrabEphemeralPort ¶
func Register ¶
func Register(c *VcapComponent, mbusClient yagnats.NATSClient)
func StartComponent ¶
func StartComponent(c *VcapComponent)
Types ¶
type GenericVarz ¶
type GenericVarz struct { // Static common metrics NumCores int `json:"num_cores"` // Dynamic common metrics MemStat int64 `json:"mem"` Cpu float64 `json:"cpu"` Uptime Duration `json:"uptime"` LogCounts *LogCounter `json:"log_counts"` }
type Healthz ¶
type Healthz struct {
LockableObject Lockable
}
func UpdateHealthz ¶
func UpdateHealthz() *Healthz
type LogCounter ¶
func NewLogCounter ¶
func NewLogCounter() *LogCounter
func (*LogCounter) AddRecord ¶
func (lc *LogCounter) AddRecord(record *steno.Record)
func (*LogCounter) Flush ¶
func (lc *LogCounter) Flush()
func (*LogCounter) GetCodec ¶
func (lc *LogCounter) GetCodec() steno.Codec
func (*LogCounter) GetCount ¶
func (lc *LogCounter) GetCount(key string) int
func (*LogCounter) MarshalJSON ¶
func (lc *LogCounter) MarshalJSON() ([]byte, error)
func (*LogCounter) SetCodec ¶
func (lc *LogCounter) SetCodec(codec steno.Codec)
type ProcessStatus ¶
type ProcessStatus struct { sync.Mutex CpuUsage float64 MemRss int64 // contains filtered or unexported fields }
func NewProcessStatus ¶
func NewProcessStatus() *ProcessStatus
func (*ProcessStatus) StopUpdate ¶
func (p *ProcessStatus) StopUpdate()
func (*ProcessStatus) Update ¶
func (p *ProcessStatus) Update()
type RouterStart ¶
type Varz ¶
type Varz struct { sync.Mutex GenericVarz UniqueVarz interface{} // Every component's unique metrics }
func UpdateVarz ¶
func UpdateVarz() *Varz
func (*Varz) MarshalJSON ¶
type VcapComponent ¶
type VcapComponent struct { // These fields are from individual components Type string `json:"type"` Index uint `json:"index"` Host string `json:"host"` Credentials []string `json:"credentials"` Config interface{} `json:"config"` Varz *Varz `json:"-"` Healthz *Healthz `json:"-"` InfoRoutes map[string]json.Marshaler `json:"-"` Logger *steno.Logger `json:"-"` // These fields are automatically generated UUID string `json:"uuid"` Start Time `json:"start"` Uptime Duration `json:"uptime"` }
var Component VcapComponent
func (*VcapComponent) ListenAndServe ¶
func (c *VcapComponent) ListenAndServe()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.