sparkapi

package
v0.0.0-...-c6cf6ad Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoApp   = errors.New("metrics: application to register can not be nil")
	ErrNoAppID = errors.New("metrics: application to register has to have an application id specified")
)
View Source
var ErrApiNotAvailable = errors.New("spark api not available")
View Source
var GetManager = func(clientSet kubernetes.Interface, driverPod *corev1.Pod, logger logr.Logger) (Manager, error) {
	client, err := getSparkApiClient(clientSet, driverPod, logger)
	if err != nil {
		return nil, fmt.Errorf("could not get spark api client, %w", err)
	}
	return manager{
		client: client,
		logger: logger,
	}, nil
}

Functions

func IsApiNotAvailableError

func IsApiNotAvailableError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsServiceUnavailableError

func IsServiceUnavailableError(err error) bool

Types

type ApplicationInfo

type ApplicationInfo struct {
	ID                      string
	ApplicationName         string
	SparkProperties         map[string]string
	TotalNewInputBytes      int64
	TotalNewOutputBytes     int64
	TotalNewExecutorCpuTime int64
	Attempts                []sparkapiclient.Attempt
	Executors               []sparkapiclient.Executor
	WorkloadType            WorkloadType
	Metrics                 sparkapiclient.Metrics
}

type ApplicationRegistry

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

ApplicationRegistry contains all registered application collectors indexed by ID

func NewApplicationRegistry

func NewApplicationRegistry(timeProvider func() time.Time) *ApplicationRegistry

func (*ApplicationRegistry) Register

Register creates a prometheus metrics collector for the specified application in the case the application has already been registered the collector is updated with the current application information

type Manager

type Manager interface {
	GetApplicationInfo(applicationID string) (*ApplicationInfo, error)
}

type WorkloadType

type WorkloadType string
const (
	SparkDriverContainerName = "spark-kubernetes-driver"

	SparkStreaming WorkloadType = "spark-streaming"
)

Directories

Path Synopsis
mock_client
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.
transport/mock_transport
Package mock_transport is a generated GoMock package.
Package mock_transport is a generated GoMock package.
Package mock_sparkapi is a generated GoMock package.
Package mock_sparkapi is a generated GoMock package.

Jump to

Keyboard shortcuts

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