Documentation ¶
Index ¶
- Constants
- Variables
- func AssignRequest()
- func BytesIn(val int64)
- func BytesOut(val int64)
- func ConnectionClose()
- func ConnectionOpen()
- func DeleteCollectionMetrics(collection string)
- func DeleteRequest()
- func LoopPushingMetric(name, instance, addr string, intervalSeconds int)
- func MemStat() *volume_server_pb.MemStatus
- func NewDiskStatus(path string) (disk *volume_server_pb.DiskStatus)
- func ReadRequest()
- func RequestClose()
- func RequestOpen()
- func SourceName(port uint32) string
- func StartMetricsServer(port int)
- func WriteRequest()
- type Channels
- type DurationCounter
- type RoundRobinCounter
- type ServerStats
- type TimedValue
Constants ¶
View Source
const ( IsReadOnly = "IsReadOnly" NoWriteOrDelete = "noWriteOrDelete" NoWriteCanDelete = "noWriteCanDelete" IsDiskSpaceLow = "isDiskSpaceLow" )
Readonly volume types
View Source
const ( // volume server ErrorSizeMismatchOffsetSize = "errorSizeMismatchOffsetSize" ErrorSizeMismatch = "errorSizeMismatch" ErrorCRC = "errorCRC" ErrorIndexOutOfRange = "errorIndexOutOfRange" // master topology ErrorWriteToLocalDisk = "errorWriteToLocalDisk" ErrorUnmarshalPairs = "errorUnmarshalPairs" ErrorWriteToReplicas = "errorWriteToReplicas" // master client FailedToKeepConnected = "failedToKeepConnected" FailedToSend = "failedToSend" FailedToReceive = "failedToReceive" RedirectedToleader = "redirectedToleader" OnPeerUpdate = "onPeerUpdate" Failed = "failed" // filer handler ErrorReadNotFound = "read.notfound" ErrorReadInternal = "read.internalerror" ErrorWriteEntry = "write.entry.failed" ErrorReadCache = "read.cache.failed" ErrorReadStream = "read.stream.failed" )
This file contains metric names for all errors The naming convention is ErrorSomeThing = "error.some.thing"
Variables ¶
View Source
var ( Gather = prometheus.NewRegistry() MasterClientConnectCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "wdclient", Name: "connect_updates", Help: "Counter of master client leader updates.", }, []string{"type"}) MasterRaftIsleader = prometheus.NewGauge( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "master", Name: "is_leader", Help: "is leader", }) MasterReceivedHeartbeatCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "master", Name: "received_heartbeats", Help: "Counter of master received heartbeat.", }, []string{"type"}) MasterReplicaPlacementMismatch = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "master", Name: "replica_placement_mismatch", Help: "replica placement mismatch", }, []string{"collection", "id"}) MasterLeaderChangeCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "master", Name: "leader_changes", Help: "Counter of master leader changes.", }, []string{"type"}) FilerRequestCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "filer", Name: "request_total", Help: "Counter of filer requests.", }, []string{"type"}) FilerRequestHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "SeaweedFS", Subsystem: "filer", Name: "request_seconds", Help: "Bucketed histogram of filer request processing time.", Buckets: prometheus.ExponentialBuckets(0.0001, 2, 24), }, []string{"type"}) FilerServerLastSendTsOfSubscribeGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "filer", Name: "last_send_timestamp_of_subscribe", Help: "The last send timestamp of the filer subscription.", }, []string{"sourceFiler", "clientName", "path"}) FilerStoreCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "filerStore", Name: "request_total", Help: "Counter of filer store requests.", }, []string{"store", "type"}) FilerStoreHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "SeaweedFS", Subsystem: "filerStore", Name: "request_seconds", Help: "Bucketed histogram of filer store request processing time.", Buckets: prometheus.ExponentialBuckets(0.0001, 2, 24), }, []string{"store", "type"}) FilerSyncOffsetGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "filerSync", Name: "sync_offset", Help: "The offset of the filer synchronization service.", }, []string{"sourceFiler", "targetFiler", "clientName", "path"}) VolumeServerRequestCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "request_total", Help: "Counter of volume server requests.", }, []string{"type"}) VolumeServerRequestHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "request_seconds", Help: "Bucketed histogram of volume server request processing time.", Buckets: prometheus.ExponentialBuckets(0.0001, 2, 24), }, []string{"type"}) VolumeServerVolumeCounter = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "volumes", Help: "Number of volumes or shards.", }, []string{"collection", "type"}) VolumeServerReadOnlyVolumeGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "read_only_volumes", Help: "Number of read only volumes.", }, []string{"collection", "type"}) VolumeServerMaxVolumeCounter = prometheus.NewGauge( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "max_volumes", Help: "Maximum number of volumes.", }) VolumeServerDiskSizeGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "total_disk_size", Help: "Actual disk size used by volumes.", }, []string{"collection", "type"}) VolumeServerResourceGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "SeaweedFS", Subsystem: "volumeServer", Name: "resource", Help: "Resource usage", }, []string{"name", "type"}) S3RequestCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "SeaweedFS", Subsystem: "s3", Name: "request_total", Help: "Counter of s3 requests.", }, []string{"type", "code", "bucket"}) S3RequestHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "SeaweedFS", Subsystem: "s3", Name: "request_seconds", Help: "Bucketed histogram of s3 request processing time.", Buckets: prometheus.ExponentialBuckets(0.0001, 2, 24), }, []string{"type", "bucket"}) )
Functions ¶
func AssignRequest ¶
func AssignRequest()
func ConnectionClose ¶
func ConnectionClose()
func ConnectionOpen ¶
func ConnectionOpen()
func DeleteCollectionMetrics ¶
func DeleteCollectionMetrics(collection string)
todo - can be changed to DeletePartialMatch when https://github.com/prometheus/client_golang/pull/1013 gets released
func DeleteRequest ¶
func DeleteRequest()
func LoopPushingMetric ¶
func MemStat ¶
func MemStat() *volume_server_pb.MemStatus
func NewDiskStatus ¶
func NewDiskStatus(path string) (disk *volume_server_pb.DiskStatus)
func ReadRequest ¶
func ReadRequest()
func RequestClose ¶
func RequestClose()
func RequestOpen ¶
func RequestOpen()
func SourceName ¶
func StartMetricsServer ¶
func StartMetricsServer(port int)
func WriteRequest ¶
func WriteRequest()
Types ¶
type Channels ¶
type Channels struct { Connections chan *TimedValue Requests chan *TimedValue AssignRequests chan *TimedValue ReadRequests chan *TimedValue WriteRequests chan *TimedValue DeleteRequests chan *TimedValue BytesIn chan *TimedValue BytesOut chan *TimedValue }
var (
Chan *Channels
)
type DurationCounter ¶
type DurationCounter struct { MinuteCounter *RoundRobinCounter HourCounter *RoundRobinCounter DayCounter *RoundRobinCounter WeekCounter *RoundRobinCounter }
func NewDurationCounter ¶
func NewDurationCounter() *DurationCounter
func (*DurationCounter) Add ¶
func (sc *DurationCounter) Add(tv *TimedValue)
Add is for cumulative counts
type RoundRobinCounter ¶
func NewRoundRobinCounter ¶
func NewRoundRobinCounter(slots int) *RoundRobinCounter
func (*RoundRobinCounter) Add ¶
func (rrc *RoundRobinCounter) Add(index int, val int64)
func (*RoundRobinCounter) Count ¶
func (rrc *RoundRobinCounter) Count() (cnt int64)
func (*RoundRobinCounter) Max ¶
func (rrc *RoundRobinCounter) Max() (max int64)
func (*RoundRobinCounter) Sum ¶
func (rrc *RoundRobinCounter) Sum() (sum int64)
func (*RoundRobinCounter) ToList ¶
func (rrc *RoundRobinCounter) ToList() (ret []int64)
type ServerStats ¶
type ServerStats struct { Requests *DurationCounter Connections *DurationCounter AssignRequests *DurationCounter ReadRequests *DurationCounter WriteRequests *DurationCounter DeleteRequests *DurationCounter BytesIn *DurationCounter BytesOut *DurationCounter }
func NewServerStats ¶
func NewServerStats() *ServerStats
func (*ServerStats) Start ¶
func (ss *ServerStats) Start()
type TimedValue ¶
type TimedValue struct {
// contains filtered or unexported fields
}
func NewTimedValue ¶
func NewTimedValue(t time.Time, val int64) *TimedValue
Click to show internal directories.
Click to hide internal directories.