Skip to content
Permalink
Browse files

Added threadcreate profile type

The threadcreate was not a supported profile type.

Closed #40

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
  • Loading branch information
gianarb committed Dec 3, 2019
1 parent 63d6a08 commit 2550865fbe64a2ae4f15dbb6dbad9d85b5fc3a6b
Showing with 8 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −1 README.md
  3. +5 −0 pkg/profile/profile_type.go
  4. +1 −0 pkg/profile/profile_type_test.go
@@ -1 +1,2 @@
BUILD/
data
@@ -113,7 +113,7 @@ body pprof.pb.gz

- `service` — service name (string)
- `instance_id` — an identifier of running instance (string) (*TODO: why do we still need instance_id?*)
- `type` — profile type (cpu, heap, block, mutex, goroutine, or other)
- `type` — profile type (cpu, heap, block, mutex, goroutine, threadcreate or other)
- `labels` — a set of key-value pairs, e.g. "region=europe-west3,dc=fra,ip=1.2.3.4,version=1.0" (Optional)

### Query saved meta information
@@ -14,6 +14,7 @@ const (
BlockProfile
MutexProfile
GoroutineProfile
ThreadcreateProfile

OtherProfile = 127
)
@@ -31,6 +32,8 @@ func (ptype *ProfileType) FromString(s string) error {
*ptype = MutexProfile
case "goroutine":
*ptype = GoroutineProfile
case "threadcreate":
*ptype = ThreadcreateProfile
case "other":
*ptype = OtherProfile
default:
@@ -53,6 +56,8 @@ func (ptype ProfileType) String() string {
return "mutex"
case GoroutineProfile:
return "goroutine"
case ThreadcreateProfile:
return "threadcreate"
case OtherProfile:
return "other"
}
@@ -14,6 +14,7 @@ func TestProfileType_FromString(t *testing.T) {
}{
{"cpu", CPUProfile},
{"heap", HeapProfile},
{"threadcreate", ThreadcreateProfile},
{"blah", UnknownProfile},
}

0 comments on commit 2550865

Please sign in to comment.
You can’t perform that action at this time.