Documentation
¶
Overview ¶
Package summary our model that summarizes a Bazel Invocation or set of invocations.
The summary package contains functions to produce a summary from an event stream, and so it depends on pkg/events.
This package contains types to hold a summary in-memory. It is not responsible for persisting or viewing summary documents. Therefore, it should not have many dependencies except for pkg/events. It should not depend on libraries or frameworks related to databases, HTML, GraphQL, PDF, email, etc. Other packages can provide functions that take an in-memory summary & use those libraries to persist/render/display it.
Index ¶
- Constants
- func IsBuildEnvKey(k string) bool
- type AbortReason
- type ActionCacheStatistics
- type ActionData
- type ActionSummary
- type ArtifactMetrics
- type BazelCommandLine
- type Blob
- type BuildGraphMetrics
- type CumulativeMetrics
- type DynamicExecutionMetrics
- type EvaluationStat
- type ExecutionInfo
- type ExitCode
- type FilesMetric
- type GarbageMetrics
- type InvocationSummary
- type MemoryMetrics
- type Metrics
- type MissDetail
- type MissReason
- type NamedSetOfFiles
- type NetworkMetrics
- type OutputGroup
- type PackageLoadMetrics
- type PackageMetrics
- type RaceStatistics
- type ResourceUsage
- type RunnerCount
- type SourceControlData
- type Summarizer
- type Summary
- type SystemNetworkStats
- type TargetComplete
- type TargetConfigured
- type TargetMetrics
- type TargetPair
- type TestFile
- type TestResult
- type TestSize
- type TestStatus
- type TestSummary
- type TestsCollection
- type TimingBreakdown
- type TimingChild
- type TimingMetrics
Constants ¶
const ( ExitCodeSuccess = 0 ExitCodeInterrupted = 8 )
Exit Code constant.
Variables ¶
This section is empty.
Functions ¶
func IsBuildEnvKey ¶
IsBuildEnvKey checks if an environment variable key is a build-level environment variable - one that is expected to be the same for multiple invocations that occur as part of the same build.
In this context, "Build" refers to a CI build, like a Jenkins build, not a 'bazel build'.
Types ¶
type AbortReason ¶
type AbortReason int32
AbortReason enum.
const ( AbortedUNKNOWN AbortReason = 0 AbortedUSERINTERRUPTED AbortReason = 1 AbortedTIMEOUT AbortReason = 2 AbortedREMOTEENVIRONMENTFAILURE AbortReason = 3 AbortedINTERNAL AbortReason = 4 AbortedLOADINGFAILURE AbortReason = 5 AbortedANALYSISFAILURE AbortReason = 6 AbortedSKIPPED AbortReason = 7 AbortedNOANALYZE AbortReason = 8 AbortedNOBUILD AbortReason = 9 AbortedINCOMPLETE AbortReason = 10 AbortedOUTOFMEMORY AbortReason = 11 )
AbortReason struct set the order explicitly because of ordering mismatches!
type ActionCacheStatistics ¶
type ActionCacheStatistics struct { SizeInBytes uint64 SaveTimeInMs uint64 LoadTimeInMs int64 Hits int32 Misses int32 MissDetails []MissDetail }
ActionCacheStatistics struct
type ActionData ¶
type ActionData struct { Mnemonic string ActionsExecuted int64 FirstStartedMs int64 LastEndedMs int64 SystemTime int64 UserTime int64 }
ActionData struct
type ActionSummary ¶
type ActionSummary struct { ActionsCreated int64 ActionsCreatedNotIncludingAspects int64 ActionsExecuted int64 ActionData []ActionData RemoteCacheHits int64 RunnerCount []RunnerCount ActionCacheStatistics ActionCacheStatistics }
ActionSummary struct.
type ArtifactMetrics ¶
type ArtifactMetrics struct { SourceArtifactsRead FilesMetric OutputArtifactsSeen FilesMetric OutputArtifactsFromActionCache FilesMetric TopLevelArtifacts FilesMetric }
ArtifactMetrics struct
type BazelCommandLine ¶
type BazelCommandLine struct { Command string Executable string Residual string ExplicitCmdLine []string CmdLine []string StartUpOptions []string ExplicitStartupOptions []string }
BazelCommandLine struct.
type Blob ¶
Blob holds information about a blob in the CAS. Should be easily converted to/from the one in the cas package. Copied into here so this package does not have *any* dependencies except standard libraries.
type BuildGraphMetrics ¶
type BuildGraphMetrics struct { ActionLookupValueCount int32 ActionLookupValueCountNotIncludingAspects int32 ActionCount int32 InputFileConfiguredTargetCount int32 OutputFileConfiguredTargetCount int32 OtherConfiguredTargetCount int32 OutputArtifactCount int32 PostInvocationSkyframeNodeCount int32 DirtiedValues []EvaluationStat ChangedValues []EvaluationStat BuiltValues []EvaluationStat CleanedValues []EvaluationStat EvaluatedValues []EvaluationStat }
BuildGraphMetrics struct
type CumulativeMetrics ¶
CumulativeMetrics struct
type DynamicExecutionMetrics ¶
type DynamicExecutionMetrics struct {
RaceStatistics []RaceStatistics
}
DynamicExecutionMetrics struct
type EvaluationStat ¶
EvaluationStat struct
type ExecutionInfo ¶
type ExecutionInfo struct { Strategy string CachedRemotely bool ExitCode int32 Hostname string TimingBreakdown TimingBreakdown ResourceUsage []ResourceUsage }
ExecutionInfo struct
type GarbageMetrics ¶
GarbageMetrics struct
type InvocationSummary ¶
type InvocationSummary struct { EnvVars map[string]string ExitCode *ExitCode BazelVersion string BazelCommandLine BazelCommandLine }
InvocationSummary struct.
type MemoryMetrics ¶
type MemoryMetrics struct { UsedHeapSizePostBuild int64 PeakPostGcHeapSize int64 PeakPostGcTenuredSpaceHeapSize int64 GarbageMetrics []GarbageMetrics }
MemoryMetrics struct
type Metrics ¶
type Metrics struct { ActionSummary ActionSummary MemoryMetrics MemoryMetrics TargetMetrics TargetMetrics PackageMetrics PackageMetrics TimingMetrics TimingMetrics CumulativeMetrics CumulativeMetrics ArtifactMetrics ArtifactMetrics BuildGraphMetrics BuildGraphMetrics NetworkMetrics NetworkMetrics DynamicExecutionMetrics DynamicExecutionMetrics }
Metrics holds Build metrics details This aligngs with data found in the ent schema https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto#L900
type MissReason ¶
type MissReason int32
MissReason enum.
const ( MissReasonDIFFERENTACTIONKEY MissReason = iota + 1 MissReasonDIFFERENTDEPS MissReasonDIFFERENTENVIRONMENT MissReasonDIFFERENTFILES MissReasonCORRUPTEDCACHEENTRY MissReasonNOTCACHED MissReasonUNCONDITIONALEXECUTION )
MissReason enum.
type NamedSetOfFiles ¶
type NamedSetOfFiles struct { Files []TestFile FileSets *NamedSetOfFiles }
NamedSetOfFiles struct
type NetworkMetrics ¶
type NetworkMetrics struct {
SystemNetworkStats *SystemNetworkStats
}
NetworkMetrics struct
type OutputGroup ¶
type OutputGroup struct { Name string Incomplete bool InlineFiles []TestFile FileSets NamedSetOfFiles }
OutputGroup struct
type PackageLoadMetrics ¶
type PackageLoadMetrics struct { Name string LoadDuration int64 NumTargets uint64 ComputationSteps uint64 NumTransitiveLoads uint64 PackageOverhead uint64 }
PackageLoadMetrics struct
type PackageMetrics ¶
type PackageMetrics struct { PackagesLoaded int64 PackageLoadMetrics []PackageLoadMetrics }
PackageMetrics struct
type RaceStatistics ¶
type RaceStatistics struct { Mnemonic string LocalRunner string RemoteRunner string LocalWins int64 RemoteWins int64 }
RaceStatistics struct
type RunnerCount ¶
RunnerCount struct
type SourceControlData ¶
type SourceControlData struct { RepositoryURL string Branch string CommitSHA string Actor string Refs string RunID string Workflow string Action string Workspace string EventName string Job string RunnerName string RunnerArch string RunnerOs string }
SourceControlData for an invocation
type Summarizer ¶
type Summarizer struct {
// contains filtered or unexported fields
}
Summarizer struct.
func (Summarizer) FinishProcessing ¶
func (s Summarizer) FinishProcessing() (*Summary, error)
FinishProcessing function
func (Summarizer) ProcessEvent ¶
func (s Summarizer) ProcessEvent(buildEvent *events.BuildEvent) error
ProcessEvent function
type Summary ¶
type Summary struct { *InvocationSummary Problems []detectors.Problem RelatedFiles map[string]string EventFileURL string BEPCompleted bool StartedAt time.Time InvocationID string StepLabel string EndedAt *time.Time ChangeNumber int PatchsetNumber int BuildURL string BuildUUID uuid.UUID UserLDAP string UserEmail string BuildLogs strings.Builder Metrics Metrics Tests map[string]TestsCollection Targets map[string]TargetPair NumFetches int64 CPU string PlatformName string Hostname string IsCiWorker bool ProfileName string ConfigrationMnemonic string SkipTargetData bool EnrichTargetData bool SourceControlData SourceControlData }
Summary The Invocation Summary object holds details about an invocation.
type SystemNetworkStats ¶
type SystemNetworkStats struct { BytesSent uint64 BytesRecv uint64 PacketsSent uint64 PacketsRecv uint64 PeakBytesSentPerSec uint64 PeakBytesRecvPerSec uint64 PeakPacketsSentPerSec uint64 PeakPacketsRecvPerSec uint64 }
SystemNetworkStats struct
type TargetComplete ¶
type TargetComplete struct { Success bool TargetKind string TestSize TestSize OutputGroup OutputGroup ImportantOutput []TestFile DirectoryOutput []TestFile Tag []string TestTimeoutSeconds int64 TestTimeout int64 // adding this to track time // not ideal, TODO: can we somehow get a more accurate measure for this data EndTimeInMs int64 }
TargetComplete struct
type TargetConfigured ¶
type TargetConfigured struct { Tag []string TargetKind string TestSize TestSize // adding this to track time for a target // not ideal, TODO: can we somehow get a more accurate measure for this data StartTimeInMs int64 }
TargetConfigured struct
type TargetMetrics ¶
type TargetMetrics struct { TargetsLoaded int64 TargetsConfigured int64 TargetsConfiguredNotIncludingAspects int64 }
TargetMetrics struct
type TargetPair ¶
type TargetPair struct { Configuration TargetConfigured Completion TargetComplete DurationInMs int64 Success bool TargetKind string TestSize TestSize AbortReason AbortReason }
TargetPair struct summary object for a target.
type TestResult ¶
type TestResult struct { Status TestStatus StatusDetails string Label string Warning []string CachedLocally bool TestAttemptDuration int64 TestAttemptStart string // timestamp TestActionOutput []TestFile ExecutionInfo ExecutionInfo }
TestResult struct
type TestSize ¶
type TestSize int32
TestSize Enum.
type TestStatus ¶
type TestStatus int32
TestStatus ENUM.
const ( TestStatuNOSTATUS TestStatus = iota + 1 TestStatuPASSED TestStatuFLAKY TestStatuTIMEOUT TestStatuFAILED TestStatuINCOMPLETE TestStatuREMOTEFAILURE TestStatuFAILEDTOBUILD TestStatuTOOLHALTEDBEFORETESTING )
TestStatus enum.
type TestSummary ¶
type TestSummary struct { Label string Status TestStatus TotalRunCount int32 RunCount int32 AttemptCount int32 ShardCount int32 TotalNumCached int32 FirstStartTime int64 LastStopTime int64 TotalRunDuration int64 Passed []TestFile Failed []TestFile }
TestSummary struct
type TestsCollection ¶
type TestsCollection struct { TestSummary TestSummary TestResults []TestResult OverallStatus TestStatus Strategy string CachedLocally bool CachedRemotely bool DurationMs int64 FirstSeen time.Time }
TestsCollection struct summary object for a test.
type TimingBreakdown ¶
type TimingBreakdown struct { Name string Time string Child []TimingChild }
TimingBreakdown struct