concurrency

package
v0.0.0-...-6807ca1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 2 Imported by: 0

README

  • Run tests with go test .
  • Run benchmarks with go test -bench=. or specific benchmark with go test -test.bench=SumConcurrency

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(data []int, split int) int

func SumIt

func SumIt(n int, concurrency int) int

Types

type Counter

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

func NewCounter

func NewCounter(close <-chan bool) *Counter

func (*Counter) Close

func (c *Counter) Close()

func (*Counter) Get

func (c *Counter) Get(key string) int

func (*Counter) Incr

func (c *Counter) Incr(key string)

func (*Counter) Report

func (c *Counter) Report()

type Metric

type Metric struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics() *Metric

func (*Metric) Get

func (m *Metric) Get(key string) int

func (*Metric) Incr

func (m *Metric) Incr(key string)

func (*Metric) Report

func (m *Metric) Report()

Jump to

Keyboard shortcuts

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