collect

package
v0.0.0-...-f0bd5fd Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package collect throughput and response times using Go-Kit Metrics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Measure

func Measure(h *generic.Histogram, d time.Duration)

// Measure adds a measurement to a histogram collection

func Measure(h *generic.Histogram, d time.Duration) {
	if h != nil && archaius.Conf.Collect {
		if d > maxHistObservable {
			h.Observe(float64(maxHistObservable))
		} else {
			h.Observe(float64(d))
		}
		sampleLock.Lock()
		s := sampleMap[h]
		if s != nil && len(s) < sampleCount {
			sampleMap[h] = append(s, int64(d))
			sampleLock.Unlock()
		}
	}
}

func NewHist

func NewHist(name string) *generic.Histogram

NewHist creates a new histogram

func Save

func Save()

Save currently does nothing

func SaveAllGuesses

func SaveAllGuesses(name string)

SaveAllGuesses writes guesses to a file

func SaveHist

func SaveHist(h *generic.Histogram, name, suffix string)

SaveHist passes in name because metrics.Histogram blocks expvar.Histogram.Name()

func Serve

func Serve(port int)

Serve on a port

Types

type ArchObject

type ArchObject struct {
	Arch     string `json:"arch"`
	Version  string `json:"version"`
	Args     string `json:"args"`
	Services []struct {
		Name                 string   `json:"name"`
		Package              string   `json:"package"`
		Regions              int      `json:"regions"`
		Count                int      `json:"count"`
		Dependencies         []string `json:"dependencies"`
		UseCustomGuesstimate bool     `json:"useCustomGuesstimate,omitempty"`
		GuesstimateType      string   `json:"guesstimateType,omitempty"`
		GuesstimateValue     string   `json:"guesstimateValue,omitempty"`
	} `json:"services"`
}

Jump to

Keyboard shortcuts

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