data

package
v0.0.0-...-d1fb2f6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDetailedCycleTimeQuery

func BuildDetailedCycleTimeQuery(weeks []string, team *int64) string

Types

type AggregatedCycleTimeStatistics

type AggregatedCycleTimeStatistics = OverallWeeklyData[CycleTimeStatistics]

type AggregatedStatistics

type AggregatedStatistics = OverallWeeklyData[Statistics]

func ScanAggregatedStatisticsRows

func ScanAggregatedStatisticsRows(rows *sql.Rows, weeks []string) (*AggregatedStatistics, error)

type AggregatedStatisticsQuery

type AggregatedStatisticsQuery = string

func BuildCodingTimeQuery

func BuildCodingTimeQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildCycleTimeQuery

func BuildCycleTimeQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildDeployTimeQuery

func BuildDeployTimeQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildHandoverQuery

func BuildHandoverQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildMRSizeQuery

func BuildMRSizeQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildPickupTimeQuery

func BuildPickupTimeQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildReviewDepthQuery

func BuildReviewDepthQuery(weeks []string, team *int64) AggregatedStatisticsQuery

func BuildTimeToMergeQuery

func BuildTimeToMergeQuery(weeks []string, team *int64) AggregatedStatisticsQuery

type AggregatedValues

type AggregatedValues = OverallWeeklyData[Value]

type AggregatedValuesQuery

type AggregatedValuesQuery = string

func BuildCodeChangeQuery

func BuildCodeChangeQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildCommitsQuery

func BuildCommitsQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildDeployFrequencyQuery

func BuildDeployFrequencyQuery(weeks []string) AggregatedValuesQuery

func BuildMRsMergedWithoutReviewQuery

func BuildMRsMergedWithoutReviewQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildMRsOpenedQuery

func BuildMRsOpenedQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildMergeFrequencyQuery

func BuildMergeFrequencyQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildReviewQuery

func BuildReviewQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildReviewTimeQuery

func BuildReviewTimeQuery(weeks []string, team *int64) AggregatedValuesQuery

func BuildSmallMRsQuery

func BuildSmallMRsQuery(weeks []string, team *int64) AggregatedValuesQuery

type CycleTimeStatistics

type CycleTimeStatistics struct {
	CodingTime Statistics `json:"coding_time"`
	PickupTime Statistics `json:"pickup_time"`
	ReviewTime Statistics `json:"review_time"`
	DeployTime Statistics `json:"deploy_time"`
}

type DB

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

func NewDB

func NewDB(ctx context.Context, tenantRepo TenantRepo) (DB, error)

func (DB) GetAggregatedStatistics

func (d DB) GetAggregatedStatistics(ctx context.Context, query AggregatedStatisticsQuery, namespace string, repository string, weeks []string, team *int64) (*AggregatedStatistics, error)

func (DB) GetAggregatedValues

func (d DB) GetAggregatedValues(ctx context.Context, query AggregatedValuesQuery, namespace string, repository string, weeks []string, team *int64) (*AggregatedValues, error)

func (DB) GetDetailedCycleTime

func (d DB) GetDetailedCycleTime(ctx context.Context, query string, namespace string, repository string, weeks []string, team *int64) (*AggregatedCycleTimeStatistics, error)

func (DB) GetTeams

func (d DB) GetTeams(ctx context.Context) ([]Team, error)

type OverallWeeklyData

type OverallWeeklyData[T any] struct {
	Overall T               `json:"overall"`
	Weekly  []WeeklyData[T] `json:"weekly"`
}

type Repo

type Repo struct {
	Organization       string `json:"organization"`
	Repository         string `json:"repository"`
	ProjectName        string `json:"projectName"`
	ProjectDescription string `json:"projectDescription"`
}

func GetRepos

func GetRepos(ctx context.Context, db *sql.DB) ([]Repo, error)

type Statistics

type Statistics struct {
	Average      *float64 `json:"average"`
	Median       *float64 `json:"median"`
	Percentile75 *float64 `json:"percentile75"`
	Percentile95 *float64 `json:"percentile95"`
	Total        *float64 `json:"total"`
	Count        *float64 `json:"count"`
}

type Team

type Team struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type TenantRepo

type TenantRepo struct {
	DbUrl        string
	Organization string
	Repository   string
}

func GetTenantRepo

func GetTenantRepo(ctx context.Context, db *sql.DB, org string, repo string) (TenantRepo, error)

type Value

type Value struct {
	Value *int `json:"value"`
}

type WeeklyCycleTimeStatistics

type WeeklyCycleTimeStatistics = WeeklyData[CycleTimeStatistics]

type WeeklyData

type WeeklyData[T any] struct {
	Week string `json:"week"`
	Data T      `json:"data"`
}

type WeeklyStatisticsData

type WeeklyStatisticsData = WeeklyData[Statistics]

type WeeklyValueData

type WeeklyValueData = WeeklyData[Value]

Jump to

Keyboard shortcuts

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