Skip to content

Commit

Permalink
model/profile: remove profile.id
Browse files Browse the repository at this point in the history
Not needed for now, and will get in the way of storage
optimisations (aggregating multiple profiles) later.
  • Loading branch information
axw committed Nov 27, 2019
1 parent e4e9fb4 commit be3eec8
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 272 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"profile": {
"alloc_objects.count": 65536,
"alloc_space.bytes": 524292,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -101,7 +100,6 @@
"profile": {
"alloc_objects.count": 16384,
"alloc_space.bytes": 524304,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -218,7 +216,6 @@
"profile": {
"alloc_objects.count": 2979,
"alloc_space.bytes": 524376,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -323,7 +320,6 @@
"profile": {
"alloc_objects.count": 4096,
"alloc_space.bytes": 524352,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -428,7 +424,6 @@
"profile": {
"alloc_objects.count": 16384,
"alloc_space.bytes": 524304,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -479,7 +474,6 @@
"profile": {
"alloc_objects.count": 10923,
"alloc_space.bytes": 524312,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -578,7 +572,6 @@
"profile": {
"alloc_objects.count": 5461,
"alloc_space.bytes": 524336,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -629,7 +622,6 @@
"profile": {
"alloc_objects.count": 2,
"alloc_space.bytes": 666237,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -704,7 +696,6 @@
"profile": {
"alloc_objects.count": 1,
"alloc_space.bytes": 924248,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -773,7 +764,6 @@
"profile": {
"alloc_objects.count": 2,
"alloc_space.bytes": 695248,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -896,7 +886,6 @@
"profile": {
"alloc_objects.count": 4096,
"alloc_space.bytes": 524352,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -983,7 +972,6 @@
"profile": {
"alloc_objects.count": 16384,
"alloc_space.bytes": 524304,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1100,7 +1088,6 @@
"profile": {
"alloc_objects.count": 10923,
"alloc_space.bytes": 524312,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1187,7 +1174,6 @@
"profile": {
"alloc_objects.count": 1820,
"alloc_space.bytes": 524432,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1262,7 +1248,6 @@
"profile": {
"alloc_objects.count": 2,
"alloc_space.bytes": 2425393,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1313,7 +1298,6 @@
"profile": {
"alloc_objects.count": 2,
"alloc_space.bytes": 2000678,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1364,7 +1348,6 @@
"profile": {
"alloc_objects.count": 5,
"alloc_space.bytes": 579337,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1445,7 +1428,6 @@
"profile": {
"alloc_objects.count": 1820,
"alloc_space.bytes": 524432,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1496,7 +1478,6 @@
"profile": {
"alloc_objects.count": 16,
"alloc_space.bytes": 540842,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1715,7 +1696,6 @@
"profile": {
"alloc_objects.count": 128,
"alloc_space.bytes": 526338,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1772,7 +1752,6 @@
"profile": {
"alloc_objects.count": 5461,
"alloc_space.bytes": 524336,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1841,7 +1820,6 @@
"profile": {
"alloc_objects.count": 4,
"alloc_space.bytes": 1390497,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -1982,7 +1960,6 @@
"profile": {
"alloc_objects.count": 128,
"alloc_space.bytes": 526338,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2039,7 +2016,6 @@
"profile": {
"alloc_objects.count": 32768,
"alloc_space.bytes": 524296,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2174,7 +2150,6 @@
"profile": {
"alloc_objects.count": 8192,
"alloc_space.bytes": 524320,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2219,7 +2194,6 @@
"profile": {
"alloc_objects.count": 5461,
"alloc_space.bytes": 524336,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2288,7 +2262,6 @@
"profile": {
"alloc_objects.count": 33,
"alloc_space.bytes": 1647743,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2363,7 +2336,6 @@
"profile": {
"alloc_objects.count": 5461,
"alloc_space.bytes": 524336,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2522,7 +2494,6 @@
"profile": {
"alloc_objects.count": 1820,
"alloc_space.bytes": 524432,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2687,7 +2658,6 @@
"profile": {
"alloc_objects.count": 1820,
"alloc_space.bytes": 524432,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -2900,7 +2870,6 @@
"profile": {
"alloc_objects.count": 1820,
"alloc_space.bytes": 524432,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3023,7 +2992,6 @@
"profile": {
"alloc_objects.count": 13,
"alloc_space.bytes": 545034,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3116,7 +3084,6 @@
"profile": {
"alloc_objects.count": 1820,
"alloc_space.bytes": 524432,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3257,7 +3224,6 @@
"profile": {
"alloc_objects.count": 2521,
"alloc_space.bytes": 524392,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3386,7 +3352,6 @@
"profile": {
"alloc_objects.count": 819,
"alloc_space.bytes": 524608,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3497,7 +3462,6 @@
"profile": {
"alloc_objects.count": 16,
"alloc_space.bytes": 540842,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3698,7 +3662,6 @@
"profile": {
"alloc_objects.count": 4,
"alloc_space.bytes": 1390497,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3821,7 +3784,6 @@
"profile": {
"alloc_objects.count": 1638,
"alloc_space.bytes": 524448,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -3944,7 +3906,6 @@
"profile": {
"alloc_objects.count": 21,
"alloc_space.bytes": 2317349,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -4031,7 +3992,6 @@
"profile": {
"alloc_objects.count": 16,
"alloc_space.bytes": 1738012,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down Expand Up @@ -4118,7 +4078,6 @@
"profile": {
"alloc_objects.count": 64,
"alloc_space.bytes": 528394,
"id": "60991a59361853df",
"inuse_objects.count": 64,
"inuse_space.bytes": 528394,
"stack": [
Expand Down Expand Up @@ -4229,7 +4188,6 @@
"profile": {
"alloc_objects.count": 1024,
"alloc_space.bytes": 524544,
"id": "60991a59361853df",
"inuse_objects.count": 0,
"inuse_space.bytes": 0,
"stack": [
Expand Down
10 changes: 0 additions & 10 deletions docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1115,16 +1115,6 @@ Profiling-specific data for APM.
*`profile.id`*::
+
--
The unique ID of the profile.
type: keyword
--
*`profile.cpu.ns`*::
+
Expand Down
2 changes: 1 addition & 1 deletion include/fields.go

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions model/profile/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
type: group
dynamic: false
fields:

- name: id
type: keyword
description: >
The unique ID of the profile.
- name: cpu
type: group
fields:
Expand Down
9 changes: 0 additions & 9 deletions model/profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,9 @@ func (pp PprofProfile) Transform(tctx *transform.Context) []beat.Event {
valueFieldNames[i] = sampleType.Type + "." + sampleUnit
}

// Generate a unique ID for all samples in the profile.
var profileID string
if idBytes, err := common.RandomBytes(8); err == nil {
profileID = fmt.Sprintf("%x", idBytes)
}

samples := make([]beat.Event, len(pp.Profile.Sample))
for i, sample := range pp.Profile.Sample {
profileFields := common.MapStr{}
if profileID != "" {
profileFields["id"] = profileID
}
if pp.Profile.DurationNanos > 0 {
profileFields["duration"] = pp.Profile.DurationNanos
}
Expand Down
8 changes: 0 additions & 8 deletions model/profile/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ func TestPprofProfileTransform(t *testing.T) {
require.Len(t, output, 2)
assert.Equal(t, output[0], output[1])

// Each profile is assigned a random ID; all samples within a
// document share the same random ID, which is checked by the
// equality assertion above.
profileField, ok := output[0].Fields["profile"].(common.MapStr)
require.True(t, ok)
assert.NotEmpty(t, profileField["id"])
delete(profileField, "id")

assert.Equal(t, beat.Event{
Timestamp: timestamp,
Fields: common.MapStr{
Expand Down

0 comments on commit be3eec8

Please sign in to comment.