stats

package
v0.0.0-...-c7609e9 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 4 Imported by: 0

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

Functions

func AddCount

func AddCount(stat CountStat, diff int)

AddCount adds the provided diff to the count of the provided CountStat

func AddFile

func AddFile(filename string)

AddFile counts the existence of a file and updates the values of StatFiles and StatTestFiles

func Clear

func Clear()

Clear resets all stores statistics to zero.

func CountMissingTestFiles

func CountMissingTestFiles() int

CountMissingTestFiles counts the number of files which don't have an associated test.

func FlushStats

func FlushStats(writer *csv.Writer, owner, repo string)

FlushStats flushes the current set of collected statistics to the provided csv writer.

func GetCount

func GetCount(stat CountStat) int

GetCount retrieves the current count of the provided CountStat so far.

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
)

func (CountStat) String

func (c CountStat) String() string

Jump to

Keyboard shortcuts

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