Skip to content

Commit

Permalink
gofmt fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmbauer committed Dec 23, 2020
1 parent e35fea3 commit 3cfdb82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions profiler/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func heapProfile(cfg *config) (*profile, error) {
cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1)
return &profile{
name: "heap",
data: buf.Bytes(),
data: buf.Bytes(),
}, nil
}

Expand All @@ -124,7 +124,7 @@ func cpuProfile(cfg *config) (*profile, error) {
cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1)
return &profile{
name: "cpu",
data: buf.Bytes(),
data: buf.Bytes(),
}, nil
}

Expand All @@ -149,7 +149,7 @@ func blockProfile(cfg *config) (*profile, error) {
cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1)
return &profile{
name: "block",
data: buf.Bytes(),
data: buf.Bytes(),
}, nil
}

Expand All @@ -164,7 +164,7 @@ func mutexProfile(cfg *config) (*profile, error) {
cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1)
return &profile{
name: "mutex",
data: buf.Bytes(),
data: buf.Bytes(),
}, nil
}

Expand All @@ -179,7 +179,7 @@ func goroutineProfile(cfg *config) (*profile, error) {
cfg.statsd.Timing("datadog.profiler.go.collect_time", end.Sub(start), tags, 1)
return &profile{
name: "goroutines",
data: buf.Bytes(),
data: buf.Bytes(),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion profiler/profiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (p *profiler) collect(ticker <-chan time.Time) {
// record the actual start and end timestamps for the batch,
// it is how the backend understands the client-side
// configured CPU profile duration: (start-end).
end: now.Add(p.cfg.cpuDuration),
end: now.Add(p.cfg.cpuDuration),
}
for t := range p.cfg.types {
prof, err := p.runProfile(t)
Expand Down
12 changes: 6 additions & 6 deletions profiler/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ var testBatch = batch{
profiles: []*profile{
{
name: "cpu",
data: []byte("my-cpu-profile"),
data: []byte("my-cpu-profile"),
},
{
name: "heap",
data: []byte("my-heap-profile"),
data: []byte("my-heap-profile"),
},
},
}
Expand Down Expand Up @@ -80,10 +80,10 @@ func TestTryUpload(t *testing.T) {
fmt.Sprintf("runtime-id:%s", globalconfig.RuntimeID()),
}, tags)
for k, v := range map[string]string{
"version": "3",
"family": "go",
"version": "3",
"family": "go",
"data[cpu.pprof]": "my-cpu-profile",
"data[heap.pprof]": "my-heap-profile",
"data[heap.pprof]": "my-heap-profile",
} {
assert.Equal(v, fields[k], k)
}
Expand Down Expand Up @@ -162,7 +162,7 @@ func BenchmarkDoRequest(b *testing.B) {
defer srv.Close()
prof := profile{
name: "heap",
data: []byte("my-heap-profile"),
data: []byte("my-heap-profile"),
}
bat := batch{
start: time.Now().Add(-10 * time.Second),
Expand Down

0 comments on commit 3cfdb82

Please sign in to comment.