nitro – github.com/spf13/nitro Index | Files

package nitro

import "github.com/spf13/nitro"

Quick and Easy Performance Analyzer Useful for comparing A/B against different drafts of functions or different functions Loosely inspired by the go benchmark package

Example:

import "github.com/spf13/nitro"
timer := nitro.Initialize()
prepTemplates()
timer.Step("initialize & template prep")
CreatePages()
timer.Step("import pages")

Index

Variables

var AnalysisOn = false

Types

type B

type B struct {
	// contains filtered or unexported fields
}

func Initalize

func Initalize() *B

Simple wrapper for Initialize Maintain for legacy purposes

func Initialize

func Initialize() *B

Call this first to get the performance object Should be called at the top of your function.

func (*B) Step

func (b *B) Step(str string)

Call perf.Step("step name") at each step in your application you want to benchmark Measures time spent since last Step call.

type R

type R struct {
	C         time.Duration // Cumulative time taken
	T         time.Duration // The total time taken.
	MemAllocs uint64        // The total number of memory allocations.
	MemBytes  uint64        // The total number of bytes allocated.
}

Source Files

perf.go

Version
v0.0.0-20131003134307-24d7ef30a12d (latest)
Published
Oct 3, 2013
Platform
js/wasm
Imports
5 packages
Last checked
3 weeks ago

Tools for package owners.