analytics

package
v0.0.0-...-3c039c4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package analytics defines all analytics tooling.

Index

Constants

View Source
const Fail = "FAIL"
View Source
const Panic = "PANIC"
View Source
const Start = "START"
View Source
const Success = "SUCCESS"

Variables

This section is empty.

Functions

func CtpAnalyticsBQClient

func CtpAnalyticsBQClient(ctx context.Context) *bigquery.Client

CtpAnalyticsBQClient will build the client for the CTP BQ tables, using the default CTP SA

func InsertCTPMetrics

func InsertCTPMetrics(c *bigquery.Client, data []*BqData) error

InsertCTPMetrics will insert the CTP Analytics Data into the CTPv2Metrics Table.

func InsertCTPTaskMetrics

func InsertCTPTaskMetrics(c *bigquery.Client, data []*TaskData) error

InsertCTPTaskMetrics will insert the CTP Analytics Data into the CTPv2TaskMetrics Table.

func ReadDurationMetrics

func ReadDurationMetrics(c *bigquery.Client, harness string, ctx context.Context) (map[string]float64, error)

ReadDurationMetrics will query the duration cache table, and return a map of the test results. If a board is provided and not "", it will limit the results to that board.

func SoftInsertStepWCtp2Req

func SoftInsertStepWCtp2Req(ctx context.Context, BQClient *bigquery.Client, data *BqData, ctpv2Req *api.CTPv2Request, build *build.State, v1Req *api.CTPRequest)

SoftInsertStepWCtp2Req insert a step info to BQl built from the CTPv2Request req. Do not fail on errors.

func SoftInsertStepWInternalPlan

func SoftInsertStepWInternalPlan(ctx context.Context, BQClient *bigquery.Client, data *BqData, req *api.InternalTestplan, build *build.State)

SoftInsertStepWInternalPlan insert a step info to BQl built from the InternalTestPlan req. Do not fail on errors.

func SoftInsertStepWTrReq

func SoftInsertStepWTrReq(ctx context.Context, BQClient *bigquery.Client, data *TaskData, req *data.TrRequest, suiteInfo *api.SuiteInfo, build *build.State)

SoftInsertStepWTrReq insert a step info to BQ built from the Trreq. Do not fail on errors.

func SoftInsertStepWTrReqBulk

func SoftInsertStepWTrReqBulk(ctx context.Context, BQClient *bigquery.Client, td []*TaskData)

SoftInsertStepWTrReqBulk insert a step info to BQ built from the Trreq. Do not fail on errors.

Types

type BqData

type BqData struct {
	SuiteName     string
	AnalyticsName string
	BBID          string
	Build         string
	Step          string
	Freeform      string
	Pool          string
	Status        string
	Duration      float32
	Date          civil.DateTime
}

type TaskData

type TaskData struct {
	SuiteName     string
	Date          civil.DateTime
	AnalyticsName string
	BBID          string
	Build         string
	Step          string
	Freeform      string
	Pool          string
	Status        string
	Duration      float32
	DisplayName   string
	TrTaskID      string
	SchedukeID    string
	Board         string
	Model         string
	Deps          []string
}

func CreateTrReqData

func CreateTrReqData(ctx context.Context, BQClient *bigquery.Client, data *TaskData, req *data.TrRequest, suiteInfo *api.SuiteInfo, build *build.State) *TaskData

Jump to

Keyboard shortcuts

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