Skip to content

Commit

Permalink
Added threadcreate profile type
Browse files Browse the repository at this point in the history
The threadcreate was not a supported profile type.

Closed #40

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
  • Loading branch information
Gianluca Arbezzano committed Dec 3, 2019
1 parent 63d6a08 commit 2550865
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
BUILD/
data
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pkg/profile/profile_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
BlockProfile
MutexProfile
GoroutineProfile
ThreadcreateProfile

OtherProfile = 127
)
Expand All @@ -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:
Expand All @@ -53,6 +56,8 @@ func (ptype ProfileType) String() string {
return "mutex"
case GoroutineProfile:
return "goroutine"
case ThreadcreateProfile:
return "threadcreate"
case OtherProfile:
return "other"
}
Expand Down
1 change: 1 addition & 0 deletions pkg/profile/profile_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestProfileType_FromString(t *testing.T) {
}{
{"cpu", CPUProfile},
{"heap", HeapProfile},
{"threadcreate", ThreadcreateProfile},
{"blah", UnknownProfile},
}

Expand Down

0 comments on commit 2550865

Please sign in to comment.