Git Product home page Git Product logo

vimebu's Introduction

Hi ! I'm Teddy ๐Ÿ‘‹

  • ๐Ÿ”ง Backend Developer at Batch
  • ๐ŸŒ Lyon, France
  • ๐Ÿง‘ 25 years old
  • โŒจ๏ธ Keyboard junkie

vimebu's People

Contributors

bdronneau avatar dependabot[bot] avatar vrischmann avatar wazazaby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vrischmann

vimebu's Issues

bug when generating metric names in parallel

The following test fails:

func TestParallel(t *testing.T) {
	var wg sync.WaitGroup
	wg.Add(200)

	for i := 0; i < 200; i++ {
		i := i

		go func() {
			defer wg.Done()

			Metric(fmt.Sprintf("foobar%d", i)).
				Label("host", "foobar").
				Label("compressed", "false").
				GetOrCreateCounter().
				Add(300)
		}()
	}

	wg.Wait()
}

with this panic:

=== RUN   TestParallel
panic: BUG: invalid metric name "foobar117{host=\"foobar\",compressed=\"false\"": missing closing curly brace at the end of "foobar117"

goroutine 101 [running]:
github.com/VictoriaMetrics/metrics.(*Set).GetOrCreateCounter(0x105162a20, {0xc0000a80c0, 0x2a})
	/Users/vincent/go/pkg/mod/github.com/!victoria!metrics/[email protected]/set.go:167 +0x4d0
github.com/VictoriaMetrics/metrics.GetOrCreateCounter(...)
	/Users/vincent/go/pkg/mod/github.com/!victoria!metrics/[email protected]/counter.go:85
github.com/wazazaby/vimebu.(*Builder).GetOrCreateCounter(0xc000315f90)
	/Users/vincent/dev/devtools/vimebu/victoria_metrics.go:11 +0x54
github.com/wazazaby/vimebu.TestParallel.func1()
	/Users/vincent/dev/devtools/vimebu/vimebu_test.go:404 +0x178
created by github.com/wazazaby/vimebu.TestParallel in goroutine 38
	/Users/vincent/dev/devtools/vimebu/vimebu_test.go:398 +0x70
FAIL	github.com/wazazaby/vimebu	0.139s
FAIL

It works fine with vimebu v1.2.1 but fails with v1.3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.