airbyte

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorCount added in v2.1.0

type ActorCount struct {
	ActorConnector string `db:"actor"`
	Tombstone      bool   `db:"tombstone"`
	Count          uint   `db:"count"`
}

ActorCount holds a count of Airbyte actors, grouped by actor connector and status.

type ConnectionCount

type ConnectionCount struct {
	DestinationConnector string `db:"destination"`
	SourceConnector      string `db:"source"`
	Status               string `db:"status"`
	Count                uint   `db:"count"`
}

ConnectionCount holds a count of Airbyte connections, grouped by destination connector, source connector and status.

type ConnectionSyncAge added in v2.1.0

type ConnectionSyncAge struct {
	ID                   string  `db:"id"`
	DestinationConnector string  `db:"destination"`
	SourceConnector      string  `db:"source"`
	ScheduleType         string  `db:"connection_schedule_type"`
	Hours                float64 `db:"hours"` // no Scanner for time.Duration, storing as a raw value
}

ConnectionSyncAge holds the age of the last job attempt for a single Airbyte Connection.

func (*ConnectionSyncAge) Age added in v2.1.0

func (csa *ConnectionSyncAge) Age() (time.Duration, error)

Age returns the duration since the last job attempt.

type JobCount

type JobCount struct {
	DestinationConnector string `db:"destination"`
	SourceConnector      string `db:"source"`
	ScheduleType         string `db:"connection_schedule_type"`
	Type                 string `db:"config_type"`
	Status               string `db:"status"`
	Count                uint   `db:"count"`
}

JobCount holds a count of Airbyte jobs, grouped by destination connector, source connector, type and status.

type Metrics

type Metrics struct {
	// Airbyte connections
	Connections                       []ConnectionCount
	ConnectionsLastSuccessfulSyncAges []ConnectionSyncAge

	// Airbyte connectors
	Sources      []ActorCount
	Destinations []ActorCount

	// Airbyte jobs
	JobsCompleted []JobCount
	JobsPending   []JobCount
	JobsRunning   []JobCount
}

Metrics represents available Airbyte metrics.

type Repository

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

Repository provides an abstraction layer to perform SQL queries against the Airbyte PostgreSQL database.

func NewRepository

func NewRepository(pool *pgxpool.Pool) *Repository

NewRepository initializes and returns an Airbyte Repository.

func (*Repository) ConnectionsCount

func (r *Repository) ConnectionsCount() ([]ConnectionCount, error)

ConnectionsCount returns the count of Airbyte connections, grouped by destination, source and status.

func (*Repository) ConnectionsLastSuccessfulSyncAge added in v2.1.0

func (r *Repository) ConnectionsLastSuccessfulSyncAge() ([]ConnectionSyncAge, error)

ConnectionsLastSuccessfulSyncAge returns the age of the last successful sync job attempt for active connections.

func (*Repository) DestinationsCount added in v2.1.0

func (r *Repository) DestinationsCount() ([]ActorCount, error)

DestinationsCount returns the count of Airbyte sources, grouped by actor connector and status.

func (*Repository) JobsCompletedCount

func (r *Repository) JobsCompletedCount() ([]JobCount, error)

JobsCompletedCount returns the count of completed Airbyte jobs, grouped by destination, source, type and status.

func (*Repository) JobsPendingCount

func (r *Repository) JobsPendingCount() ([]JobCount, error)

JobsPendingCount returns the count of pending Airbyte jobs, grouped by destination, source and type.

func (*Repository) JobsRunningCount

func (r *Repository) JobsRunningCount() ([]JobCount, error)

JobsRunningCount returns the count of running Airbyte jobs, grouped by destination, source and type.

func (*Repository) SourcesCount added in v2.1.0

func (r *Repository) SourcesCount() ([]ActorCount, error)

SourcesCount returns the count of Airbyte sources, grouped by actor connector and status.

type Service

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

Service handles domain operations for gathering metrics from Airbyte's PostgreSQL database.

func NewService

func NewService(r *Repository) *Service

NewService initializes and returns an Airbyte Service.

func (*Service) GatherMetrics

func (s *Service) GatherMetrics() (*Metrics, error)

GatherMetrics gathers and returns metrics from Airbyte's PostgreSQL database.

Jump to

Keyboard shortcuts

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