News features and improvements (#8)
* added config file implementation, refactoring * add gitignore * improved test * preperations for more metrics * added resource metrics * added first bgp metrics * added asn as label for bgp metrics * added prefix and message counts to bgp metrics * simplified * Update README.md * added yaml dependency * fixed go routine call * added timeout * clean up * added TLS support * set default api port for TLS * added routes metric * added missing log information
This commit is contained in:
committed by
Steve Brunton
parent
c37abb638f
commit
f2866a3a2f
26
vendor/github.com/sirupsen/logrus/hooks/test/test_test.go
generated
vendored
26
vendor/github.com/sirupsen/logrus/hooks/test/test_test.go
generated
vendored
@@ -1,6 +1,7 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -8,7 +9,6 @@ import (
|
||||
)
|
||||
|
||||
func TestAllHooks(t *testing.T) {
|
||||
|
||||
assert := assert.New(t)
|
||||
|
||||
logger, hook := NewNullLogger()
|
||||
@@ -35,5 +35,27 @@ func TestAllHooks(t *testing.T) {
|
||||
assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level)
|
||||
assert.Equal("Hello error", hook.LastEntry().Message)
|
||||
assert.Equal(1, len(hook.Entries))
|
||||
|
||||
}
|
||||
|
||||
func TestLoggingWithHooksRace(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
logger, hook := NewNullLogger()
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(100)
|
||||
|
||||
for i := 0; i < 100; i++ {
|
||||
go func() {
|
||||
logger.Info("info")
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
|
||||
assert.Equal(logrus.InfoLevel, hook.LastEntry().Level)
|
||||
assert.Equal("info", hook.LastEntry().Message)
|
||||
|
||||
wg.Wait()
|
||||
|
||||
entries := hook.AllEntries()
|
||||
assert.Equal(100, len(entries))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user