Documentation ¶
Overview ¶
Package stats implements a global statistics store for instrumenting code to count the occurrence of important events. The stats store is not thread-safe in the slightest.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllStats []CountStat = []CountStat{ StatSloc, StatSlocTest, StatSlocVendored, StatFuncDecl, StatFuncCalls, StatRangeLoops, StatFiles, StatTestFile, StatVendoredFile, StatUnaryReferenceExpr, StatLoopclosureHits, StatLooppointerHits, StatPtrFuncStartsGoroutine, StatPtrFuncWritesPtr, StatPtrDeclCallsThirdPartyCode, StatLooppointerReportsWritePtr, StatLooppointerReportsAsync, StatLooppointerReportsThirdParty, StatLooppointerReportsPointerReassigned, StatLooppointerReportsCompositeLit, }
Functions ¶
func AddFile ¶
func AddFile(filename string)
AddFile counts the existence of a file and updates the values of StatFiles and StatTestFiles
func CountMissingTestFiles ¶
func CountMissingTestFiles() int
CountMissingTestFiles counts the number of files which don't have an associated test.
func FlushStats ¶
FlushStats flushes the current set of collected statistics to the provided csv writer.
Types ¶
type CountStat ¶
type CountStat uint8
const ( StatSloc CountStat = iota StatSlocTest StatSlocVendored StatFuncDecl StatFuncCalls StatRangeLoops StatFiles StatTestFile StatVendoredFile StatUnaryReferenceExpr StatLoopclosureHits StatLooppointerHits StatPtrFuncStartsGoroutine StatPtrFuncWritesPtr StatPtrDeclCallsThirdPartyCode StatLooppointerReportsWritePtr StatLooppointerReportsAsync StatLooppointerReportsThirdParty StatLooppointerReportsPointerReassigned StatLooppointerReportsCompositeLit )
Click to show internal directories.
Click to hide internal directories.