stats

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package stats is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogStreamStat

type LogStreamStat struct {
	// contains filtered or unexported fields
}

LogStreamStat represents the aggregated information of the log stream that is collected by Repository.

func (*LogStreamStat) Copy

func (lss *LogStreamStat) Copy() LogStreamStat

Copy returns clone of the log stream statistics.

func (*LogStreamStat) Replica

Replica returns the replica stored by the storage node that is identified by the argument snid.

func (*LogStreamStat) Replicas

Replicas returns replicas of the log stream.

func (*LogStreamStat) Status

func (lss *LogStreamStat) Status() varlogpb.LogStreamStatus

Status returns status of the log stream.

type MockRepository

type MockRepository struct {
	// contains filtered or unexported fields
}

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) GetLogStream

func (m *MockRepository) GetLogStream(arg0 types.LogStreamID) *LogStreamStat

GetLogStream mocks base method.

func (*MockRepository) GetStorageNode

func (m *MockRepository) GetStorageNode(arg0 types.StorageNodeID) (*vmspb.StorageNodeMetadata, bool)

GetStorageNode mocks base method.

func (*MockRepository) ListStorageNodes

func (m *MockRepository) ListStorageNodes() map[types.StorageNodeID]*vmspb.StorageNodeMetadata

ListStorageNodes mocks base method.

func (*MockRepository) RemoveStorageNode

func (m *MockRepository) RemoveStorageNode(arg0 types.StorageNodeID)

RemoveStorageNode mocks base method.

func (*MockRepository) Report

Report mocks base method.

func (*MockRepository) SetLogStreamStatus

func (m *MockRepository) SetLogStreamStatus(arg0 types.LogStreamID, arg1 varlogpb.LogStreamStatus)

SetLogStreamStatus mocks base method.

type MockRepositoryMockRecorder

type MockRepositoryMockRecorder struct {
	// contains filtered or unexported fields
}

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) GetLogStream

func (mr *MockRepositoryMockRecorder) GetLogStream(arg0 interface{}) *gomock.Call

GetLogStream indicates an expected call of GetLogStream.

func (*MockRepositoryMockRecorder) GetStorageNode

func (mr *MockRepositoryMockRecorder) GetStorageNode(arg0 interface{}) *gomock.Call

GetStorageNode indicates an expected call of GetStorageNode.

func (*MockRepositoryMockRecorder) ListStorageNodes

func (mr *MockRepositoryMockRecorder) ListStorageNodes() *gomock.Call

ListStorageNodes indicates an expected call of ListStorageNodes.

func (*MockRepositoryMockRecorder) RemoveStorageNode

func (mr *MockRepositoryMockRecorder) RemoveStorageNode(arg0 interface{}) *gomock.Call

RemoveStorageNode indicates an expected call of RemoveStorageNode.

func (*MockRepositoryMockRecorder) Report

func (mr *MockRepositoryMockRecorder) Report(arg0, arg1, arg2 interface{}) *gomock.Call

Report indicates an expected call of Report.

func (*MockRepositoryMockRecorder) SetLogStreamStatus

func (mr *MockRepositoryMockRecorder) SetLogStreamStatus(arg0, arg1 interface{}) *gomock.Call

SetLogStreamStatus indicates an expected call of SetLogStreamStatus.

type Repository

type Repository interface {
	// Report reports metadata of the storage node with timestamp when the
	// metadata is fetched. It updates the statistics of the storage nodes
	// and log streams by using the arguments snmd and ts. If a storage
	// node or log streams are not included in the cluster metadata, they
	// are ignored.
	Report(ctx context.Context, snmd *snpb.StorageNodeMetadataDescriptor, ts time.Time)

	// SetLogStreamStatus sets status of the log stream specified by the
	// argument lsid.
	SetLogStreamStatus(lsid types.LogStreamID, status varlogpb.LogStreamStatus)

	// GetLogStream returns statistics of the log stream specified by the
	// argument lsid.
	GetLogStream(lsid types.LogStreamID) *LogStreamStat

	// GetStorageNode returns a metadata of storage node specified by the
	// argument snid. The snm result contains the last heartbeat time
	// collected by the repository. The ok result indicates whether the
	// metadata is found in the repository.
	GetStorageNode(snid types.StorageNodeID) (snm *vmspb.StorageNodeMetadata, ok bool)

	// ListStorageNodes returns a map that maps storage node ID to the
	// metadata for each storage node.
	ListStorageNodes() map[types.StorageNodeID]*vmspb.StorageNodeMetadata

	// RemoveStorageNode removes the metadata for the storage node
	// specified by the snid.
	RemoveStorageNode(snid types.StorageNodeID)
}

Repository is a repository to maintain statistics of log streams to manage the cluster.

func NewRepository

func NewRepository(ctx context.Context, cmview mrmanager.ClusterMetadataView) Repository

Jump to

Keyboard shortcuts

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