435c0d9fc8
This PR switches the Nomad repository from using govendor to Go modules for managing dependencies. Aspects of the Nomad workflow remain pretty much the same. The usual Makefile targets should continue to work as they always did. The API submodule simply defers to the parent Nomad version on the repository, keeping the semantics of API versioning that currently exists.
39 lines
777 B
Go
39 lines
777 B
Go
package lint
|
|
|
|
import (
|
|
"time"
|
|
|
|
"golang.org/x/tools/go/analysis"
|
|
)
|
|
|
|
const (
|
|
StateInitializing = 0
|
|
StateGraph = 1
|
|
StateProcessing = 2
|
|
StateCumulative = 3
|
|
)
|
|
|
|
type Stats struct {
|
|
State uint32
|
|
|
|
InitialPackages uint32
|
|
TotalPackages uint32
|
|
ProcessedPackages uint32
|
|
ProcessedInitialPackages uint32
|
|
Problems uint32
|
|
ActiveWorkers uint32
|
|
TotalWorkers uint32
|
|
PrintAnalyzerMeasurement func(*analysis.Analyzer, *Package, time.Duration)
|
|
}
|
|
|
|
type AnalysisMeasurementKey struct {
|
|
Analysis string
|
|
Pkg string
|
|
}
|
|
|
|
func (s *Stats) MeasureAnalyzer(analysis *analysis.Analyzer, pkg *Package, d time.Duration) {
|
|
if s.PrintAnalyzerMeasurement != nil {
|
|
s.PrintAnalyzerMeasurement(analysis, pkg, d)
|
|
}
|
|
}
|