common

package
v0.0.0-...-8ab5ff9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2016 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const RefreshInterval time.Duration = time.Second * 1

Variables

This section is empty.

Functions

func GenerateUUID

func GenerateUUID() (string, error)

func UnixToTime

func UnixToTime(unixTime string) (time.Time, error)

Types

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type GenericVarz

type GenericVarz struct {
	// These fields are from individual components
	Type        string   `json:"type"`
	Index       uint     `json:"index"`
	Host        string   `json:"host"`
	Credentials []string `json:"credentials"`

	// These fields are automatically generated
	UUID      string `json:"uuid"`
	StartTime Time   `json:"start"`

	// 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 {
}

func (*Healthz) Value

func (v *Healthz) Value() string

type LogCounter

type LogCounter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLogCounter

func NewLogCounter() *LogCounter

func (*LogCounter) GetCount

func (lc *LogCounter) GetCount(key string) int

func (*LogCounter) Log

func (lc *LogCounter) Log(log lager.LogFormat)

func (*LogCounter) MarshalJSON

func (lc *LogCounter) MarshalJSON() ([]byte, error)

type ProcessStatus

type ProcessStatus struct {
	sync.RWMutex

	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 RouterStart struct {
	Id                               string   `json:"id"`
	Hosts                            []string `json:"hosts"`
	MinimumRegisterIntervalInSeconds int      `json:"minimumRegisterIntervalInSeconds"`
	PruneThresholdInSeconds          int      `json:"pruneThresholdInSeconds"`
}

type Time

type Time time.Time

func (Time) Elapsed

func (t Time) Elapsed() Duration

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type Varz

type Varz struct {
	sync.Mutex
	GenericVarz
	UniqueVarz interface{} // Every component's unique metrics
}

func (*Varz) MarshalJSON

func (v *Varz) MarshalJSON() ([]byte, error)

type VcapComponent

type VcapComponent struct {
	Config     interface{}               `json:"-"`
	Varz       *Varz                     `json:"-"`
	Healthz    *Healthz                  `json:"-"`
	InfoRoutes map[string]json.Marshaler `json:"-"`
	Logger     lager.Logger              `json:"-"`
	// contains filtered or unexported fields
}

func (*VcapComponent) ListenAndServe

func (c *VcapComponent) ListenAndServe()

func (*VcapComponent) Register

func (c *VcapComponent) Register(mbusClient *nats.Conn) error

func (*VcapComponent) Start

func (c *VcapComponent) Start() error

func (*VcapComponent) Stop

func (c *VcapComponent) Stop()

func (*VcapComponent) UpdateVarz

func (c *VcapComponent) UpdateVarz()

Directories

Path Synopsis
fakes
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL