metric

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metric provides functionality for collecting / computing metrics on different Phobos resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAggregatedMetricStatisticsInput

type GetAggregatedMetricStatisticsInput struct {
	OrganizationID  *string
	ProjectID       *string
	ReleaseID       *string
	PipelineID      *string
	EnvironmentName *string
	Tags            map[models.MetricTagName]string
	BucketPeriod    db.MetricBucketPeriod
	MetricName      models.MetricName
	BucketCount     int
}

GetAggregatedMetricStatisticsInput is the input for getting aggregated statistics for a metric.

type GetMetricStatisticsInput

type GetMetricStatisticsInput struct {
	TimeRangeStart  time.Time
	TimeRangeEnd    *time.Time
	OrganizationID  *string
	ProjectID       *string
	ReleaseID       *string
	PipelineID      *string
	EnvironmentName *string
	Tags            map[models.MetricTagName]string
	MetricName      models.MetricName
}

GetMetricStatisticsInput is the input for getting statistics for a metric.

type GetMetricsInput

type GetMetricsInput struct {
	Sort              *db.MetricSortableField
	PaginationOptions *pagination.Options
	TimeRangeStart    time.Time
	TimeRangeEnd      *time.Time
	OrganizationID    *string
	ProjectID         *string
	ReleaseID         *string
	PipelineID        *string
	EnvironmentName   *string
	Tags              map[models.MetricTagName]string
	MetricName        models.MetricName
}

GetMetricsInput is the input for retrieving metrics.

type Service

type Service interface {
	GetMetrics(ctx context.Context, input *GetMetricsInput) (*db.MetricsResult, error)
	GetAggregatedMetricStatistics(ctx context.Context, input *GetAggregatedMetricStatisticsInput) ([]*db.AggregatedMetric, error)
	GetMetricStatistics(ctx context.Context, input *GetMetricStatisticsInput) (*db.MetricStatistics, error)
}

Service encapsulates the logic for accessing and creating metrics.

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
) Service

NewService creates a new Service instance.

Jump to

Keyboard shortcuts

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