apibq

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Tricium BigQuery Schema

This includes the schema for rows in the Tricium BigQuery tables, as well as related scripts to update the table schemas and views.

Creating tables and updating table schemas.

All tables belong to a dataset, which has a name and description. Datasets can be created with the gcloud SDK bq command, which must be installed first.

Datasets can be created with command that look like:

bq --location=US mk --dataset --description "Analyzer runs" tricium-dev:analyzer

Schemas can be updated with bqschemaupdater. You should make sure you run an up-to-date bqschemaupdater:

go install go.chromium.org/luci/tools/cmd/bqschemaupdater

This tool takes a proto message and table and updates the schema based on the compiled proto message. Proto messages should be compiled by running go generate. The commands to update the schemas look like this:

bqschemaupdater -message apibq.AnalysisRun -table tricium-dev.analyzer.results
bqschemaupdater -message apibq.FeedbackEvent -table tricium-dev.events.feedback

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FeedbackEvent_Type_name = map[int32]string{
		0: "NONE",
		1: "NOT_USEFUL",
		2: "COMMENT_POST",
	}
	FeedbackEvent_Type_value = map[string]int32{
		"NONE":         0,
		"NOT_USEFUL":   1,
		"COMMENT_POST": 2,
	}
)

Enum value maps for FeedbackEvent_Type.

View Source
var File_infra_tricium_api_bigquery_analyzer_results_proto protoreflect.FileDescriptor
View Source
var File_infra_tricium_api_bigquery_event_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AnalysisRun

type AnalysisRun struct {

	// The revision information for the Gerrit change being analyzed by this
	// analysis run.
	GerritRevision *v1.GerritRevision `protobuf:"bytes,1,opt,name=gerrit_revision,json=gerritRevision,proto3" json:"gerrit_revision,omitempty"`
	// The revision number. In Gerrit this is the change revision and is
	// displayed as the patchset number in PolyGerrit.
	RevisionNumber int32 `protobuf:"varint,2,opt,name=revision_number,json=revisionNumber,proto3" json:"revision_number,omitempty"`
	// All files in the change revision analyzed by the run.
	Files []*v1.Data_File `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"`
	// Time when the request was received.
	RequestedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=requested_time,json=requestedTime,proto3" json:"requested_time,omitempty"`
	// Platform for which the result applies.
	ResultPlatform v1.Platform_Name `` /* 131-byte string literal not displayed */
	// Overall state for the run result. As results are only sent after
	// completion PENDING and RUNNING would never be used.
	ResultState v1.State `protobuf:"varint,6,opt,name=result_state,json=resultState,proto3,enum=tricium.State" json:"result_state,omitempty"`
	// Comments added to Gerrit during this analysis run.
	Comments []*AnalysisRun_GerritComment `protobuf:"bytes,7,rep,name=comments,proto3" json:"comments,omitempty"`
	// contains filtered or unexported fields
}

func (*AnalysisRun) Descriptor deprecated

func (*AnalysisRun) Descriptor() ([]byte, []int)

Deprecated: Use AnalysisRun.ProtoReflect.Descriptor instead.

func (*AnalysisRun) GetComments

func (x *AnalysisRun) GetComments() []*AnalysisRun_GerritComment

func (*AnalysisRun) GetFiles

func (x *AnalysisRun) GetFiles() []*v1.Data_File

func (*AnalysisRun) GetGerritRevision

func (x *AnalysisRun) GetGerritRevision() *v1.GerritRevision

func (*AnalysisRun) GetRequestedTime

func (x *AnalysisRun) GetRequestedTime() *timestamppb.Timestamp

func (*AnalysisRun) GetResultPlatform

func (x *AnalysisRun) GetResultPlatform() v1.Platform_Name

func (*AnalysisRun) GetResultState

func (x *AnalysisRun) GetResultState() v1.State

func (*AnalysisRun) GetRevisionNumber

func (x *AnalysisRun) GetRevisionNumber() int32

func (*AnalysisRun) ProtoMessage

func (*AnalysisRun) ProtoMessage()

func (*AnalysisRun) ProtoReflect

func (x *AnalysisRun) ProtoReflect() protoreflect.Message

func (*AnalysisRun) Reset

func (x *AnalysisRun) Reset()

func (*AnalysisRun) String

func (x *AnalysisRun) String() string

type AnalysisRun_GerritComment

type AnalysisRun_GerritComment struct {

	// The comment generated by the analysis run.
	Comment *v1.Data_Comment `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"`
	// Comment creation time.
	//
	// Comment creation time in terms of when it is tracked in the service not
	// when it is created by the analyzer.
	CreatedTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"`
	// Analyzer function name.
	//
	// e.g., "ClangTidy".
	Analyzer string `protobuf:"bytes,3,opt,name=analyzer,proto3" json:"analyzer,omitempty"`
	// Platforms this comment applies to.
	Platforms []v1.Platform_Name `protobuf:"varint,4,rep,packed,name=platforms,proto3,enum=tricium.Platform_Name" json:"platforms,omitempty"`
	// Has this comment been selected to be displayed on the review?
	// For example, comments outside of the changed lines are not included
	// (i.e. selected) in the results posted to the Gerrit change.
	Selected bool `protobuf:"varint,5,opt,name=selected,proto3" json:"selected,omitempty"`
	// contains filtered or unexported fields
}

func (*AnalysisRun_GerritComment) Descriptor deprecated

func (*AnalysisRun_GerritComment) Descriptor() ([]byte, []int)

Deprecated: Use AnalysisRun_GerritComment.ProtoReflect.Descriptor instead.

func (*AnalysisRun_GerritComment) GetAnalyzer

func (x *AnalysisRun_GerritComment) GetAnalyzer() string

func (*AnalysisRun_GerritComment) GetComment

func (x *AnalysisRun_GerritComment) GetComment() *v1.Data_Comment

func (*AnalysisRun_GerritComment) GetCreatedTime

func (x *AnalysisRun_GerritComment) GetCreatedTime() *timestamppb.Timestamp

func (*AnalysisRun_GerritComment) GetPlatforms

func (x *AnalysisRun_GerritComment) GetPlatforms() []v1.Platform_Name

func (*AnalysisRun_GerritComment) GetSelected

func (x *AnalysisRun_GerritComment) GetSelected() bool

func (*AnalysisRun_GerritComment) ProtoMessage

func (*AnalysisRun_GerritComment) ProtoMessage()

func (*AnalysisRun_GerritComment) ProtoReflect

func (*AnalysisRun_GerritComment) Reset

func (x *AnalysisRun_GerritComment) Reset()

func (*AnalysisRun_GerritComment) String

func (x *AnalysisRun_GerritComment) String() string

type FeedbackEvent

type FeedbackEvent struct {

	// Type of event.
	Type FeedbackEvent_Type `protobuf:"varint,1,opt,name=type,proto3,enum=apibq.FeedbackEvent_Type" json:"type,omitempty"`
	// Time when the event occurred.
	Time *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
	// Related comments. For comment post events, this will be the comments
	// sent; for a "not useful" click, this would be the one related comment.
	Comments []*v1.Data_Comment `protobuf:"bytes,3,rep,name=comments,proto3" json:"comments,omitempty"`
	// contains filtered or unexported fields
}

FeedbackEvent represents one event such as sending comments or a "not useful" click.

The purpose of recording these events is to be able to track the feedback on comments -- for example, what's the proportion "not useful" clicks to comments produced for each analyzer or category?

func (*FeedbackEvent) Descriptor deprecated

func (*FeedbackEvent) Descriptor() ([]byte, []int)

Deprecated: Use FeedbackEvent.ProtoReflect.Descriptor instead.

func (*FeedbackEvent) GetComments

func (x *FeedbackEvent) GetComments() []*v1.Data_Comment

func (*FeedbackEvent) GetTime

func (x *FeedbackEvent) GetTime() *timestamppb.Timestamp

func (*FeedbackEvent) GetType

func (x *FeedbackEvent) GetType() FeedbackEvent_Type

func (*FeedbackEvent) ProtoMessage

func (*FeedbackEvent) ProtoMessage()

func (*FeedbackEvent) ProtoReflect

func (x *FeedbackEvent) ProtoReflect() protoreflect.Message

func (*FeedbackEvent) Reset

func (x *FeedbackEvent) Reset()

func (*FeedbackEvent) String

func (x *FeedbackEvent) String() string

type FeedbackEvent_Type

type FeedbackEvent_Type int32

Types of event.

const (
	FeedbackEvent_NONE         FeedbackEvent_Type = 0
	FeedbackEvent_NOT_USEFUL   FeedbackEvent_Type = 1
	FeedbackEvent_COMMENT_POST FeedbackEvent_Type = 2
)

func (FeedbackEvent_Type) Descriptor

func (FeedbackEvent_Type) Enum

func (FeedbackEvent_Type) EnumDescriptor deprecated

func (FeedbackEvent_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use FeedbackEvent_Type.Descriptor instead.

func (FeedbackEvent_Type) Number

func (FeedbackEvent_Type) String

func (x FeedbackEvent_Type) String() string

func (FeedbackEvent_Type) Type

Jump to

Keyboard shortcuts

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