github.com/mier85/go-sensor@v1.30.1-0.20220920111756-9bf41b3bc7e0/autoprofile/internal/profile_test.go (about) 1 // (c) Copyright IBM Corp. 2021 2 // (c) Copyright Instana Inc. 2020 3 4 package internal_test 5 6 import ( 7 "testing" 8 9 "github.com/instana/testify/assert" 10 "github.com/mier85/go-sensor/autoprofile/internal" 11 ) 12 13 func TestCallSite_Increment(t *testing.T) { 14 root := internal.NewCallSite("root", "", 0) 15 16 root.Increment(12.3, 1) 17 root.Increment(0, 0) 18 root.Increment(5, 2) 19 20 m, ns := root.Measurement() 21 assert.Equal(t, 17.3, m) 22 assert.EqualValues(t, 3, ns) 23 }