goappmonitor: github.com/wgliang/goappmonitor Index | Files | Directories

package goappmonitor

import "github.com/wgliang/goappmonitor"


Package Files

config.go debug.go http.go httplib.go metrics.go pusher.go runtime.go struct.go version.go


const (
    // Gauge const
const (
    // VERSION goappmonitor
    VERSION = "0.0.2"

func CollectDebugGCStats Uses

func CollectDebugGCStats(r metrics.Collectry, d time.Duration)

Collect denug gc stats and it will run a goroutine.

func CollectRuntimeMemStats Uses

func CollectRuntimeMemStats(r metrics.Collectry, d time.Duration)

Collect runtime memeory-data:CollectRuntimeMemStats.

func Counter Uses

func Counter(name string, count int64)

Counter Actions

func Gauge Uses

func Gauge(name string, value int64)

Gauge Actions

func GaugeFloat64 Uses

func GaugeFloat64(name string, value float64)


func GetCounter Uses

func GetCounter(name string) int64

GetCounter from name

func GetGauge Uses

func GetGauge(name string) float64

GetGauge from name.

func GetHistogram Uses

func GetHistogram(name string) int64

GetHistogram from name.

func GetHistogram50th Uses

func GetHistogram50th(name string) float64

GetHistogram50th from name.

func GetHistogram75th Uses

func GetHistogram75th(name string) float64

GetHistogram75th from name.

func GetHistogram95th Uses

func GetHistogram95th(name string) float64

GetHistogram95th from name.

func GetHistogram999th Uses

func GetHistogram999th(name string) float64

GetHistogram999th form name.

func GetHistogram99th Uses

func GetHistogram99th(name string) float64

GetHistogram99th from name.

func GetHistogramMax Uses

func GetHistogramMax(name string) int64

GetHistogramMax from name.

func GetHistogramMean Uses

func GetHistogramMean(name string) float64

GetHistogramMean from name.

func GetHistogramMin Uses

func GetHistogramMin(name string) int64

GetHistogramMin from name.

func GetHistogramStdDev Uses

func GetHistogramStdDev(name string) float64

GetHistogramStdDev from name.

func GetHistogramSum Uses

func GetHistogramSum(name string) int64

GetHistogramSum from name.

func GetMeter Uses

func GetMeter(name string) int64

GetMeter from name.

func GetMeterRate1 Uses

func GetMeterRate1(name string) float64

GetMeterRate1 from name.

func GetMeterRate15 Uses

func GetMeterRate15(name string) float64

GetMeterRate15 from name.

func GetMeterRate5 Uses

func GetMeterRate5(name string) float64

GetMeterRate5 from name.

func GetMeterRateMean Uses

func GetMeterRateMean(name string) float64

GetMeterRateMean from name.

func GetMeterRateStep Uses

func GetMeterRateStep(name string) float64

GetMeterRateStep from name.

func Histogram Uses

func Histogram(name string, count int64)

Histogram Actions

func InfluxDBJson Uses

func InfluxDBJson(w http.ResponseWriter, data interface{})

Render json

func InfluxDBString Uses

func InfluxDBString(w http.ResponseWriter, msg string)

Render string

func Meter Uses

func Meter(name string, count int64)

Meter Actions

func RenderJson Uses

func RenderJson(w http.ResponseWriter, data interface{})

RenderJson json

func RenderString Uses

func RenderString(w http.ResponseWriter, msg string)

RenderString string

func SetCounter Uses

func SetCounter(name string, count int64)

SetCounter name and value.

func SetDefaultSetting Uses

func SetDefaultSetting(setting BeegoHttpSettings)

SetDefaultSetting Overwrite default settings

func SetGauge Uses

func SetGauge(name string, value float64)


func SetHistogram Uses

func SetHistogram(name string, count int64)

SetHistogram from name and value.

func SetMeter Uses

func SetMeter(name string, count int64)


func TimeoutDialer Uses

func TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(net, addr string) (c net.Conn, err error)

TimeoutDialer returns functions of connection dialer with timeout settings for http.Transport Dial field.

type BeegoHttpRequest Uses

type BeegoHttpRequest struct {
    // contains filtered or unexported fields

BeegoHttpRequest provides more useful methods for requesting one url than http.Request.

func Delete Uses

func Delete(url string) *BeegoHttpRequest

Delete returns *BeegoHttpRequest DELETE method.

func Get Uses

func Get(url string) *BeegoHttpRequest

Get returns *BeegoHttpRequest with GET method.

func Head(url string) *BeegoHttpRequest

Head returns *BeegoHttpRequest with HEAD method.

func Post Uses

func Post(url string) *BeegoHttpRequest

Post returns *BeegoHttpRequest with POST method.

func Put Uses

func Put(url string) *BeegoHttpRequest

Put returns *BeegoHttpRequest with PUT method.

func (*BeegoHttpRequest) Body Uses

func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest

Body adds request raw body. it supports string and []byte.

func (*BeegoHttpRequest) Bytes Uses

func (b *BeegoHttpRequest) Bytes() ([]byte, error)

Bytes returns the body []byte in response. it calls Response inner.

func (*BeegoHttpRequest) Debug Uses

func (b *BeegoHttpRequest) Debug(isdebug bool) *BeegoHttpRequest

Debug sets show debug or not when executing request.

func (*BeegoHttpRequest) Header Uses

func (b *BeegoHttpRequest) Header(key, value string) *BeegoHttpRequest

Header add header item string in request.

func (*BeegoHttpRequest) Param Uses

func (b *BeegoHttpRequest) Param(key, value string) *BeegoHttpRequest

Param adds query param in to request. params build query string as ?key1=value1&key2=value2...

func (*BeegoHttpRequest) PostFile Uses

func (b *BeegoHttpRequest) PostFile(formname, filename string) *BeegoHttpRequest

func (*BeegoHttpRequest) Response Uses

func (b *BeegoHttpRequest) Response() (*http.Response, error)

Response executes request client gets response mannually.

func (*BeegoHttpRequest) SetBasicAuth Uses

func (b *BeegoHttpRequest) SetBasicAuth(username, password string) *BeegoHttpRequest

SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.

func (*BeegoHttpRequest) SetCookie Uses

func (b *BeegoHttpRequest) SetCookie(cookie *http.Cookie) *BeegoHttpRequest

SetCookie add cookie into request.

func (*BeegoHttpRequest) SetEnableCookie Uses

func (b *BeegoHttpRequest) SetEnableCookie(enable bool) *BeegoHttpRequest

SetEnableCookie sets enable/disable cookiejar

func (*BeegoHttpRequest) SetProtocolVersion Uses

func (b *BeegoHttpRequest) SetProtocolVersion(vers string) *BeegoHttpRequest

Set the protocol version for incoming requests. Client requests always use HTTP/1.1.

func (*BeegoHttpRequest) SetProxy Uses

func (b *BeegoHttpRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *BeegoHttpRequest

Set http proxy example:

func(req *http.Request) (*url.URL, error) {
    u, _ := url.ParseRequestURI("")
    return u, nil

func (*BeegoHttpRequest) SetTLSClientConfig Uses

func (b *BeegoHttpRequest) SetTLSClientConfig(config *tls.Config) *BeegoHttpRequest

SetTLSClientConfig sets tls connection configurations if visiting https url.

func (*BeegoHttpRequest) SetTimeout Uses

func (b *BeegoHttpRequest) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *BeegoHttpRequest

SetTimeout sets connect time out and read-write time out for BeegoRequest.

func (*BeegoHttpRequest) SetTransport Uses

func (b *BeegoHttpRequest) SetTransport(transport http.RoundTripper) *BeegoHttpRequest

Set transport to

func (*BeegoHttpRequest) SetUserAgent Uses

func (b *BeegoHttpRequest) SetUserAgent(useragent string) *BeegoHttpRequest

SetUserAgent sets User-Agent header field

func (*BeegoHttpRequest) Setting Uses

func (b *BeegoHttpRequest) Setting(setting BeegoHttpSettings) *BeegoHttpRequest

Setting Change request settings

func (*BeegoHttpRequest) String Uses

func (b *BeegoHttpRequest) String() (string, error)

String returns the body string in response. it calls Response inner.

func (*BeegoHttpRequest) ToFile Uses

func (b *BeegoHttpRequest) ToFile(filename string) error

ToFile saves the body data in response to one file. it calls Response inner.

func (*BeegoHttpRequest) ToJson Uses

func (b *BeegoHttpRequest) ToJson(v interface{}) error

ToJson returns the map that marshals from the body bytes as json in response . it calls Response inner.

func (*BeegoHttpRequest) ToXml Uses

func (b *BeegoHttpRequest) ToXml(v interface{}) error

ToXml returns the map that marshals from the body bytes as xml in response . it calls Response inner.

type BeegoHttpSettings Uses

type BeegoHttpSettings struct {
    ShowDebug        bool
    UserAgent        string
    ConnectTimeout   time.Duration
    ReadWriteTimeout time.Duration
    TlsClientConfig  *tls.Config
    Proxy            func(*http.Request) (*url.URL, error)
    Transport        http.RoundTripper
    EnableCookie     bool

BeegoHttpSettings struct

type DebugMetrics Uses

type DebugMetrics struct {
    GCStats struct {
        LastGC     metrics.Gauge     `json:"lastGC"`
        NumGC      metrics.Gauge     `json:"numGC"`
        Pause      metrics.Histogram `json:"pause"`
        PauseTotal metrics.Gauge     `json:"pauseTotal"`
    ReadGCStats metrics.Histogram `json:"readGCStats"`

DebugMetrics ,Monitoring index of application in debug environment.

type GlobalConfig Uses

type GlobalConfig struct {
    Debug    bool        `json:"debug"`
    Hostname string      `json:"hostname"`
    Tags     string      `json:"tags"`
    Step     int64       `json:"step"`
    Bases    []string    `json:"bases"`
    Push     *PushConfig `json:"push"`
    Http     *HttpConfig `json:"http"`

GlobalConfig of goappmonitor, and you can config it in cfg.json.

type HttpConfig Uses

type HttpConfig struct {
    Enabled bool   `json:"enabled"`
    Listen  string `json:"listen"`

HttpConfig about whether open local server and server address.

type InfluxDBResponse Uses

type InfluxDBResponse struct {
    Msg     string      `json:"msg"`
    Name    string      `json:"name"`
    Columns []string    `json:"columns"`
    Points  interface{} `json:"points"`

type InfluxDBx Uses

type InfluxDBx struct {
    Enabled  bool   `json:"enabled"`
    Addr     string `json:"addr"`
    Username string `json:"username"`
    Password string `json:"password"`

type MetricValue Uses

type MetricValue struct {
    Endpoint  string      `json:"endpoint"`
    Metric    string      `json:"metric"`
    Value     interface{} `json:"value"`
    Step      int64       `json:"step"`
    Type      string      `json:"counterType"`
    Tags      string      `json:"tags"`
    Timestamp int64       `json:"timestamp"`

Data MetricValue struct.

func (*MetricValue) String Uses

func (mv *MetricValue) String() string

Transfer to string.

type OpenFalconx Uses

type OpenFalconx struct {
    Enabled bool   `json:"enabled"`
    Api     string `json:"api"`

type Point Uses

type Point []interface{}

type PushConfig Uses

type PushConfig struct {
    OpenFalcon OpenFalconx `json:"open-falcon"`
    InfluxDB   InfluxDBx   `json:"influxDB"`

PushConfig of pushing address and switcher.

type Response Uses

type Response struct {
    Msg  string      `json:"msg"`
    Data interface{} `json:"data"`

Response http struct

type RuntimeMetrics Uses

type RuntimeMetrics struct {
    MemStats struct {
        Alloc         metrics.Gauge        `json:"alloc"`
        BuckHashSys   metrics.Gauge        `json:"buckHashSys"`
        DebugGC       metrics.Gauge        `json:"debugGC"`
        EnableGC      metrics.Gauge        `json:"enableGC"`
        Frees         metrics.Gauge        `json:"frees"`
        HeapAlloc     metrics.Gauge        `json:"heapAlloc"`
        HeapIdle      metrics.Gauge        `json:"heapIdle"`
        HeapInuse     metrics.Gauge        `json:"heapInuse"`
        HeapObjects   metrics.Gauge        `json:"heapObjects"`
        HeapReleased  metrics.Gauge        `json:"heapReleased"`
        HeapSys       metrics.Gauge        `json:"heapSys"`
        LastGC        metrics.Gauge        `json:"lastGC"`
        Lookups       metrics.Gauge        `json:"lookups"`
        Mallocs       metrics.Gauge        `json:"mallocs"`
        MCacheInuse   metrics.Gauge        `json:"mCacheInuse"`
        MCacheSys     metrics.Gauge        `json:"mCacheSys"`
        MSpanInuse    metrics.Gauge        `json:"mSpanInuse"`
        MSpanSys      metrics.Gauge        `json:"mSpanSys"`
        NextGC        metrics.Gauge        `json:"nextGC"`
        NumGC         metrics.Gauge        `json:"numGC"`
        GCCPUFraction metrics.GaugeFloat64 `json:"gCCPUFraction"`
        PauseNs       metrics.Histogram    `json:"pauseNs"`
        PauseTotalNs  metrics.Gauge        `json:"pauseTotalNs"`
        StackInuse    metrics.Gauge        `json:"stackInuse"`
        StackSys      metrics.Gauge        `json:"stackSys"`
        Sys           metrics.Gauge        `json:"sys"`
        TotalAlloc    metrics.Gauge        `json:"totalAlloc"`
    NumCgoCall   metrics.Gauge     `json:"numCgoCall"`
    NumGoroutine metrics.Gauge     `json:"numGoroutine"`
    ReadMemStats metrics.Histogram `json:"readMemStats"`

RuntimeMetrics ,Monitoring index of application in production environment.



Package goappmonitor imports 23 packages (graph) and is imported by 1 packages. Updated 2017-10-25. Refresh now. Tools for package owners.