forked from TrueCloudLab/frostfs-node
[#948] metrics: Set actual value for shard_id
after restart
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
6a5769d1da
commit
0bd030507e
8 changed files with 27 additions and 1 deletions
|
@ -146,3 +146,7 @@ func (c *cache) Close() error {
|
|||
c.metrics.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *cache) GetMetrics() Metrics {
|
||||
return c.metrics
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ const (
|
|||
)
|
||||
|
||||
type Metrics interface {
|
||||
SetShardID(string)
|
||||
Get(d time.Duration, success bool, st StorageType)
|
||||
Delete(d time.Duration, success bool, st StorageType)
|
||||
Put(d time.Duration, success bool, st StorageType)
|
||||
|
@ -35,6 +36,8 @@ func DefaultMetrics() Metrics { return metricsStub{} }
|
|||
|
||||
type metricsStub struct{}
|
||||
|
||||
func (metricsStub) SetShardID(string) {}
|
||||
|
||||
func (metricsStub) Get(time.Duration, bool, StorageType) {}
|
||||
|
||||
func (metricsStub) Delete(time.Duration, bool, StorageType) {}
|
||||
|
|
|
@ -41,6 +41,7 @@ type Cache interface {
|
|||
Init() error
|
||||
Open(ctx context.Context, mode mode.Mode) error
|
||||
Close() error
|
||||
GetMetrics() Metrics
|
||||
}
|
||||
|
||||
// MainStorage is the interface of the underlying storage of Cache implementations.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue