Documentation ¶
Overview ¶
Package operational contains types and methods for monitoring the operations of the blobby cluster. It includes a HTTP server for serving raft/prometheus metrics.
Index ¶
- Variables
- func InitialiseGRPC(port int, register func(*grpc.Server)) (*grpc.Server, net.Listener, error)
- func NewContext() context.Context
- func NewServer(port int, rs RaftStats) *http.Server
- func RunAll(fns ...func() error) (err error)
- func WithBackoff(attempts int, duration time.Duration, fn func() error) func() error
- type RaftStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LogsApplied is the prometheus metric that counts the number of // types of raft logs that have been applied. LogsApplied = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: namespace, Name: "logs_applied", Help: "Number of raft logs that have been applied", }, []string{"op"}) // BytesWritten is the prometheus metric that counts the number // of bytes written to the file system by clients. BytesWritten = prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: namespace, Name: "bytes_written", Help: "Number of bytes written to the file system", }) // BytesRead is the prometheus metric that counts the number // of bytes read from the file system by clients. BytesRead = prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: namespace, Name: "bytes_read", Help: "Number of bytes read from the file system", }) // GRPC is a collection of prometheus metrics for the gRPC // server. GRPC = grpc_prometheus.NewServerMetrics() )
Functions ¶
func InitialiseGRPC ¶
InitialiseGRPC returns a *grpc.Server instance and a net.Listener instance of the given port. The 'register' parameter should be used to perform any operations on the server, like registering contracts etc.
func NewContext ¶
NewContext creates a new context.Context implementation that returns done when the program receives an os.Interrupt or syscall.SIGTERM call.
Types ¶
Click to show internal directories.
Click to hide internal directories.