metric

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(interim bool, projPath ...string) (note.CommitNote, error)

Process events for last git commit and save time spent as a git note If interim is true, process events for the current working and staged files

Types

type FileMetric

type FileMetric struct {
	Updated    bool // Updated signifies if we need to save the metric file
	SourceFile string
	TimeSpent  int
	Timeline   map[int64]int
}

FileMetric contains the source file and it's time metrics

func (*FileMetric) AddTimeSpent

func (f *FileMetric) AddTimeSpent(ep int64, t int)

AddTimeSpent accumulates time spent for a source file

func (*FileMetric) Downsample

func (f *FileMetric) Downsample()

Downsample return timeline by hour

func (*FileMetric) SortEpochs

func (f *FileMetric) SortEpochs() []int64

SortEpochs returns sorted timeline epochs

type FileMetricByTime

type FileMetricByTime []FileMetric

FileMetricByTime is an array of FileMetrics

func (FileMetricByTime) Len

func (a FileMetricByTime) Len() int

func (FileMetricByTime) Less

func (a FileMetricByTime) Less(i, j int) bool

func (FileMetricByTime) Swap

func (a FileMetricByTime) Swap(i, j int)

Jump to

Keyboard shortcuts

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