本文整理匯總了Golang中github.com/cockroachdb/cockroach/roachpb.StoreID類的典型用法代碼示例。如果您正苦於以下問題:Golang StoreID類的具體用法?Golang StoreID怎麽用?Golang StoreID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了StoreID類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewStoreStatusMonitor
// NewStoreStatusMonitor constructs a StoreStatusMonitor with the given ID.
func NewStoreStatusMonitor(id roachpb.StoreID, metaRegistry *metric.Registry) *StoreStatusMonitor {
registry := metric.NewRegistry()
// Format as `cr.store.<metric>.<id>` in output, in analogy to the time
// series data written.
metaRegistry.MustAdd(storeTimeSeriesPrefix+"%s."+id.String(), registry)
return &StoreStatusMonitor{
ID: id,
registry: registry,
rangeCount: registry.Counter("ranges"),
leaderRangeCount: registry.Gauge("ranges.leader"),
replicatedRangeCount: registry.Gauge("ranges.replicated"),
availableRangeCount: registry.Gauge("ranges.available"),
liveBytes: registry.Gauge("livebytes"),
keyBytes: registry.Gauge("keybytes"),
valBytes: registry.Gauge("valbytes"),
intentBytes: registry.Gauge("intentbytes"),
liveCount: registry.Gauge("livecount"),
keyCount: registry.Gauge("keycount"),
valCount: registry.Gauge("valcount"),
intentCount: registry.Gauge("intentcount"),
intentAge: registry.Gauge("intentage"),
gcBytesAge: registry.Gauge("gcbytesage"),
lastUpdateNanos: registry.Gauge("lastupdatenanos"),
capacity: registry.Gauge("capacity"),
available: registry.Gauge("capacity.available"),
}
}
示例2: MakeStoreKey
// MakeStoreKey returns the gossip key for the given store.
func MakeStoreKey(storeID roachpb.StoreID) string {
return MakeKey(KeyStorePrefix, storeID.String())
}
示例3: MakeDeadReplicasKey
// MakeDeadReplicasKey returns the dead replicas gossip key for the given store.
func MakeDeadReplicasKey(storeID roachpb.StoreID) string {
return MakeKey(KeyDeadReplicasPrefix, storeID.String())
}