collection

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

collection package provides the interface for collection implementation and the actual collection execution

collection module deals with specific k8s cluster level data collection

collection package provides the interface for collection implementation and the actual collection execution

collection package provides the interface for collection implementation and the actual collection execution

collection package provides the interface for collection implementation and the actual collection execution

Index

Constants

This section is empty.

Variables

View Source
var DirPerms fs.FileMode = 0750

Functions

func ClusterK8sExecute

func ClusterK8sExecute(hook shutdown.CancelHook, namespace string, cs CopyStrategy, ddfs helpers.Filesystem) error

func Execute

func Execute(c Collector, s CopyStrategy, collectionArgs Args, hook shutdown.Hook, clusterCollection ...func([]string)) error

func FindClusterID

func FindClusterID(outputDir string) (clusterStatsList []clusterstats.ClusterStats, err error)

func GetClusterLogs

func GetClusterLogs(hook shutdown.CancelHook, namespace string, cs CopyStrategy, ddfs helpers.Filesystem, pods []string) error

func StartCapture

func StartCapture(c HostCaptureConfiguration, localDDCPath, localDDCYamlPath string, skipRESTCollect bool, disableFreeSpaceCheck bool, minFreeSpaceGB int) error

Capture collects diagnostics, conf files and log files from the target hosts. Failures are permissive and are first logged and then returned at the end with the reason for the failure.

func TransferCapture

func TransferCapture(c HostCaptureConfiguration, hook shutdown.Hook, outputLoc string) (int64, string, error)

Types

type Args

type Args struct {
	DDCfs                 helpers.Filesystem
	OutputLoc             string
	CopyStrategy          CopyStrategy
	DremioPAT             string
	TransferDir           string
	DDCYamlLoc            string
	Disabled              []string
	Enabled               []string
	DisableFreeSpaceCheck bool
	MinFreeSpaceGB        int
	CollectionMode        string
	TransferThreads       int
}

type ClusterInfo

type ClusterInfo struct {
	NumberNodesContacted int `json:"numberNodesContacted"`
	TotalNodesAttempted  int `json:"totalNodesAttempted"`
}

type Collector

type Collector interface {
	CopyFromHost(hostString string, source, destination string) (out string, err error)
	CopyToHost(hostString string, source, destination string) (out string, err error)
	GetCoordinators() (podName []string, err error)
	GetExecutors() (podName []string, err error)
	HostExecute(mask bool, hostString string, args ...string) (stdOut string, err error)
	HostExecuteAndStream(mask bool, hostString string, output cli.OutputHandler, pat string, args ...string) error
	HelpText() string
	Name() string
	SetHostPid(host, pidFile string)
	CleanupRemote() error
}

type CopyStrategy

type CopyStrategy interface {
	CreatePath(fileType, source, nodeType string) (path string, err error)
	ArchiveDiag(o string, outputLoc string) error
	GetTmpDir() string
}

type FindErr

type FindErr struct {
	Cmd string
}

func (FindErr) Error

func (fe FindErr) Error() string

type HostCaptureConfiguration

type HostCaptureConfiguration struct {
	IsCoordinator  bool
	Collector      Collector
	Host           string
	CopyStrategy   CopyStrategy
	DDCfs          helpers.Filesystem
	DremioPAT      string
	TransferDir    string
	CollectionMode string
}

type NodeCaptureStats

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

NodeCaptureStats represents stats for a node capture.

func (*NodeCaptureStats) Update

func (n *NodeCaptureStats) Update(node string, secondsElapsed int, status string)

Update updates the NodeCaptureStats fields in a thread-safe manner.

type Stats

type Stats struct {
	TransfersComplete int
	// contains filtered or unexported fields
}

Stats represents stats for a collection.

var CollectionStatsGlobal *Stats

func (*Stats) PrintState

func (c *Stats) PrintState()

func (*Stats) UpdateDDCVersion

func (c *Stats) UpdateDDCVersion(ddcVersion, logFile, ddcYaml, collectionType string, ddcYamlIsValid bool, transfersComplete, totalTransfers int)

Update updates the CollectionStats fields in a thread-safe manner.

func (*Stats) UpdateNodeState

func (c *Stats) UpdateNodeState(node string, secondsElapsed int, status string)

Update updates the CollectionStats fields in a thread-safe manner.

type SummaryInfo

type SummaryInfo struct {
	ClusterInfo         ClusterInfo             `json:"clusterInfo"`
	CollectedFiles      []helpers.CollectedFile `json:"collectedFiles"`
	FailedFiles         []string                `json:"failedFiles"`
	SkippedFiles        []string                `json:"skippedFiles"`
	StartTimeUTC        time.Time               `json:"startTimeUTC"`
	EndTimeUTC          time.Time               `json:"endTimeUTC"`
	TotalRuntimeSeconds int64                   `json:"totalRuntimeSeconds"`
	TotalBytesCollected int64                   `json:"totalBytesCollected"`
	Executors           []string                `json:"executors"`
	Coordinators        []string                `json:"coordinators"`
	DremioVersion       map[string]string       `json:"dremioVersion"`
	ClusterID           map[string]string       `json:"clusterID"`
	DDCVersion          string                  `json:"ddcVersion"`
	CollectionsEnabled  []string                `json:"collectionsEnabled"`
	CollectionsDisabled []string                `json:"collectionsDisabled"`
}

func (SummaryInfo) String

func (summary SummaryInfo) String() (string, error)

type SummaryInfoWriterError

type SummaryInfoWriterError struct {
	SummaryInfo SummaryInfo
	Err         error
}

func (SummaryInfoWriterError) Error

func (w SummaryInfoWriterError) Error() string

Jump to

Keyboard shortcuts

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