Skip to content

Commit

Permalink
chore: update diff benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Aug 21, 2024
1 parent f55caeb commit 95fa0d2
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 9 deletions.
2 changes: 1 addition & 1 deletion db/config_scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func PersistScrapeConfigFromCRD(ctx context.Context, scrapeConfig *v1.ScrapeConf
if existing.ID == uuid.Nil {
changed = true
} else {
change, err := generateDiff(ctx, existing.Spec, spec)
change, err := GenerateDiff(ctx, existing.Spec, spec)
if err != nil {
return changed, err
}
Expand Down
13 changes: 8 additions & 5 deletions db/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
// NormalizeJSON returns an indented json string.
// The keys are sorted lexicographically.
func NormalizeJSONOj(object any) (string, error) {

data := object
switch v := object.(type) {
case string:
Expand All @@ -34,7 +33,6 @@ func NormalizeJSONOj(object any) (string, error) {
}

func NormalizeJSONJQ(object any) (string, error) {

data := object
switch v := object.(type) {
case string:
Expand Down Expand Up @@ -74,19 +72,24 @@ func NormalizeJSON(object any) (string, error) {
}

// generateDiff calculates the diff (git style) between the given 2 configs.
func generateDiff(ctx dutyContext.Context, newConf, prevConfig string) (string, error) {
func GenerateDiff(ctx dutyContext.Context, newConf, prevConfig string) (string, error) {
if ctx.Properties().On(false, "scraper.diff.disable") {
return "", nil
}

return generateDiff(ctx.Properties().String("scraper.diff.normalizer", "go"), newConf, prevConfig)
}

func generateDiff(normalizerName, newConf, prevConfig string) (string, error) {

if newConf == prevConfig {
return "", nil
}

normalizer := NormalizeJSON
if name := ctx.Properties().String("scraper.diff.normalizer", "go"); name == "oj" {
if normalizerName == "oj" {
normalizer = NormalizeJSONOj
} else if name == "jq" {
} else if normalizerName == "jq" {
normalizer = NormalizeJSONJQ
}

Expand Down
2 changes: 1 addition & 1 deletion db/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func generateConfigChange(ctx api.ScrapeContext, newConf, prev models.ConfigItem
}
}

diff, err := generateDiff(ctx.Context, *newConf.Config, *prev.Config)
diff, err := GenerateDiff(ctx.Context, *newConf.Config, *prev.Config)
if err != nil {
return nil, fmt.Errorf("failed to generate diff: %w", err)
}
Expand Down
68 changes: 67 additions & 1 deletion db/update_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
package db

import (
"fmt"
"os"
"reflect"
"runtime"
"runtime/debug"
"testing"
"time"

"github.com/flanksource/config-db/db/models"
"github.com/google/go-cmp/cmp"
"github.com/google/uuid"
"github.com/samber/lo"
"github.com/shirou/gopsutil/v3/process"
)

func Test_generateDiff(t *testing.T) {
Expand Down Expand Up @@ -42,7 +46,7 @@ func Test_generateDiff(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := generateDiff(readFile(t, tt.args.newConf), readFile(t, tt.args.prev))
got, err := generateDiff("go", readFile(t, tt.args.newConf), readFile(t, tt.args.prev))
if err != nil {
t.Errorf("generateDiff() error = %v", err)
return
Expand Down Expand Up @@ -126,3 +130,65 @@ func Test_dedupChanges(t *testing.T) {
})
}
}

// go test -benchmem -run=^$ -bench ^BenchmarkDiffGenerator$ github.com/flanksource/config-db/db -count=5 -benchtime=10s -v -memprofile memprofile.out -cpuprofile profile.out
func BenchmarkDiffGenerator(b *testing.B) {
for _, c := range []struct {
gogc int
memlimit int64
normalizer string
}{
// {100, 1024 * 1024 * 1024, "go"},
// {50, 1024 * 1024 * 1024, "go"},
// {200, 1024 * 1024 * 1024, "go"},

{100, 1024 * 1024 * 1024, "oj"},
{50, 1024 * 1024 * 1024, "oj"},
{200, 1024 * 1024 * 1024, "oj"},

{100, 1024 * 1024 * 1024, "jq"},
{50, 1024 * 1024 * 1024, "jq"},
{200, 1024 * 1024 * 1024, "jq"},
} {

p, _ := process.NewProcess(int32(os.Getpid()))

_ = b.Run(fmt.Sprintf("GOMEMLIMIT=%dmb GOGC=%d, NORMALIZER=%s", c.memlimit/1024/1024, c.gogc, c.normalizer), func(b *testing.B) {

before, err := os.ReadFile("testdata/6mb.json")
if err != nil {
b.Fatalf("failed to open file echo-server.json: %v", err)
}

after, err := os.ReadFile("testdata/6mb-new.json")
if err != nil {
b.Fatalf("failed to open file echo-server.json: %v", err)
}

debug.SetGCPercent(c.gogc)
debug.SetMemoryLimit(c.memlimit)
debug.FreeOSMemory()

var start, end runtime.MemStats
runtime.ReadMemStats(&start)

b.ResetTimer()
b.ReportAllocs()

for i := 0; i < b.N; i++ {
_, _ = generateDiff(c.normalizer, string(before), string(after))
}

runtime.ReadMemStats(&end)

mem, _ := p.MemoryInfo()
load, _ := p.CPUPercent()

b.ReportMetric(float64(mem.RSS/1024/1024), "rssMB")
b.ReportMetric(load, "cpu%")
b.ReportMetric(float64(len(before)/1024), "jsonKB")
b.ReportMetric(float64(end.NumGC-start.NumGC)/float64(b.N), "gc/op")
})

}
}
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/samber/lo v1.46.0
github.com/sethvargo/go-retry v0.2.4
github.com/shirou/gopsutil/v3 v3.24.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
Expand Down Expand Up @@ -134,6 +135,7 @@ require (
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
Expand All @@ -159,32 +161,38 @@ require (
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lmittmann/tint v1.0.5 // indirect
github.com/lrita/cmap v0.0.0-20231108122212-cb084a67f554 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/orcaman/concurrent-map/v2 v2.0.1 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/sftp v1.13.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/robertkrimen/otto v0.3.0 // indirect
github.com/rodaine/table v1.1.0 // indirect
github.com/samber/oops v1.12.1 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.0.4 // indirect
github.com/timberio/go-datemath v0.1.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/vadimi/go-http-ntlm v1.0.3 // indirect
github.com/vadimi/go-http-ntlm/v2 v2.4.1 // indirect
github.com/vadimi/go-ntlm v1.2.1 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
Expand Down
20 changes: 20 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
Expand Down Expand Up @@ -1279,6 +1281,8 @@ github.com/lmittmann/tint v1.0.5 h1:NQclAutOfYsqs2F1Lenue6OoWCajs5wJcP3DfWVpePw=
github.com/lmittmann/tint v1.0.5/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
github.com/lrita/cmap v0.0.0-20231108122212-cb084a67f554 h1:a0+bIffIh/HdvvgtPQLRhOef1VDSxZ+8bQiyjQlJzqc=
github.com/lrita/cmap v0.0.0-20231108122212-cb084a67f554/go.mod h1:Cn9TaoncDT8Tt/aJ7CIZy+t48MaZWDEwhu1bBXwrzLI=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
Expand Down Expand Up @@ -1394,6 +1398,8 @@ github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
Expand Down Expand Up @@ -1462,6 +1468,12 @@ github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec=
github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw=
github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
Expand Down Expand Up @@ -1511,6 +1523,10 @@ github.com/tidwall/sjson v1.0.4 h1:UcdIRXff12Lpnu3OLtZvnc03g4vH2suXDXhBwBqmzYg=
github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y=
github.com/timberio/go-datemath v0.1.0 h1:1OUCvSIX1qXLJ57h12OWfgt6MNpJnsdNvrp8dLIUFtg=
github.com/timberio/go-datemath v0.1.0/go.mod h1:m7kjsbCuO4QKP3KLfnxiUZWiOiFXmxj30HeexjL3lc0=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg=
github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/uber-go/tally v3.3.17+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
Expand Down Expand Up @@ -1555,6 +1571,8 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t
github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
Expand Down Expand Up @@ -1838,6 +1856,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -1865,6 +1884,7 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
9 changes: 8 additions & 1 deletion utils/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package utils

import (
"fmt"
"os"
"runtime"
"time"

"github.com/flanksource/commons/logger"
"github.com/shirou/gopsutil/v3/process"
k8sDuration "k8s.io/apimachinery/pkg/util/duration"
)

Expand Down Expand Up @@ -40,6 +42,10 @@ func (m *MemoryTimer) End() string {
if m.start == nil {
return d
}

p, _ := process.NewProcess(int32(os.Getpid()))
mem, _ := p.MemoryInfo()

end := runtime.MemStats{}
runtime.ReadMemStats(&end)
allocs := end.Mallocs - m.start.Mallocs
Expand All @@ -48,11 +54,12 @@ func (m *MemoryTimer) End() string {
gc := end.NumGC - m.start.NumGC

return fmt.Sprintf(
"%s (allocs=%dk, heap_allocs=%dmb heap_increase=%dmb, gc_count=%d)",
"%s (allocs=%dk, heap_allocs=%dmb heap_increase=%dmb, gc_count=%d rss=%dmb)",
d,
allocs/1000,
totalheap/1024/1024,
heap/1024/1024,
gc,
mem.RSS/1024/1024,
)
}

0 comments on commit 95fa0d2

Please sign in to comment.