monitor

package
v1.8.0-dev-20240908 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestDiskID1 = "fsid"

	TestOrphanedReplicaDirectoryName = "test-volume-r-000000000"
)
View Source
const (
	NodeMonitorSyncPeriod = 30 * time.Second
)

Variables

This section is empty.

Functions

func DeleteDisk added in v1.5.0

func DeleteDisk(diskType longhorn.DiskType, diskName, diskUUID, diskPath, diskDriver string, client *engineapi.DiskService) error

DeleteDisk deletes the disk with the given name, uuid, path and driver

func GetDiskNamesFromDiskMap

func GetDiskNamesFromDiskMap(diskInfoMap map[string]*CollectedDiskInfo) []string

Types

type CollectedDiskInfo

type CollectedDiskInfo struct {
	Path                      string
	NodeOrDiskEvicted         bool
	DiskStat                  *lhtypes.DiskStat
	DiskName                  string
	DiskUUID                  string
	DiskDriver                longhorn.DiskDriver
	Condition                 *longhorn.Condition
	OrphanedReplicaDataStores map[string]string
	InstanceManagerName       string
}

func NewDiskInfo

func NewDiskInfo(diskName, diskUUID, diskPath string, diskDriver longhorn.DiskDriver, nodeOrDiskEvicted bool, stat *lhtypes.DiskStat,
	orphanedReplicaDataStores map[string]string, instanceManagerName string, errorReason, errorMessage string) *CollectedDiskInfo

type DiskServiceClient added in v1.6.0

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

type GenerateDiskConfigHandler added in v1.5.0

type GenerateDiskConfigHandler func(longhorn.DiskType, string, string, string, string, *DiskServiceClient) (*util.DiskConfig, error)

type GetDiskConfigHandler added in v1.5.0

type GetReplicaDataStoresHandler added in v1.7.0

type GetReplicaDataStoresHandler func(longhorn.DiskType, *longhorn.Node, string, string, string, string, *DiskServiceClient) (map[string]string, error)

type Monitor

type Monitor interface {
	Start()
	Close()
	UpdateConfiguration(map[string]interface{}) error
	GetCollectedData() (interface{}, error)
	RunOnce() error
}

type NodeMonitor

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

func NewDiskMonitor added in v1.4.0

func NewDiskMonitor(logger logrus.FieldLogger, ds *datastore.DataStore, nodeName string, syncCallback func(key string)) (*NodeMonitor, error)

func NewFakeNodeMonitor

func NewFakeNodeMonitor(logger logrus.FieldLogger, ds *datastore.DataStore, nodeName string, syncCallback func(key string)) (*NodeMonitor, error)

func (*NodeMonitor) Close

func (m *NodeMonitor) Close()

func (*NodeMonitor) GetCollectedData

func (m *NodeMonitor) GetCollectedData() (interface{}, error)

func (*NodeMonitor) RunOnce added in v1.4.0

func (m *NodeMonitor) RunOnce() error

func (*NodeMonitor) Start

func (m *NodeMonitor) Start()

func (*NodeMonitor) UpdateConfiguration added in v1.4.0

func (m *NodeMonitor) UpdateConfiguration(map[string]interface{}) error

type SnapshotChangeEvent added in v1.4.0

type SnapshotChangeEvent struct {
	VolumeName   string
	SnapshotName string
}

type SnapshotMonitor added in v1.4.0

type SnapshotMonitor struct {
	sync.RWMutex

	SnapshotMonitorStatus
	// contains filtered or unexported fields
}

func NewSnapshotMonitor added in v1.4.0

func NewSnapshotMonitor(logger logrus.FieldLogger, ds *datastore.DataStore, nodeName string, eventRecorder record.EventRecorder,
	snapshotChangeEventQueue workqueue.TypedInterface[any], syncCallback func(key string)) (*SnapshotMonitor, error)

func (*SnapshotMonitor) Close added in v1.4.0

func (m *SnapshotMonitor) Close()

func (*SnapshotMonitor) GetCollectedData added in v1.4.0

func (m *SnapshotMonitor) GetCollectedData() (interface{}, error)

func (*SnapshotMonitor) RunOnce added in v1.4.0

func (m *SnapshotMonitor) RunOnce() error

func (*SnapshotMonitor) Start added in v1.4.0

func (m *SnapshotMonitor) Start()

func (*SnapshotMonitor) UpdateConfiguration added in v1.4.0

func (m *SnapshotMonitor) UpdateConfiguration(map[string]interface{}) error

type SnapshotMonitorStatus added in v1.4.0

type SnapshotMonitorStatus struct {
	LastSnapshotPeriodicCheckedAt metav1.Time
}

Jump to

Keyboard shortcuts

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