Skip to content

Commit

Permalink
bring back StartTime and EndTime for a smoother transition with contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Nov 21, 2024
1 parent c0fefe0 commit 3306d59
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pdata/internal/cmd/pdatagen/internal/pprofile_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ var profile = &messageValueStruct{
testVal: "1234567890",
},
},
&primitiveTypedField{
fieldName: "StartTime",
originFieldName: "TimeNanos",
returnType: &primitiveType{
structName: "Timestamp",
packageName: "pcommon",
rawType: "int64",
defaultVal: "0",
testVal: "1234567890",
},
},
&messageValueField{
fieldName: "PeriodType",
returnMessage: valueType,
Expand Down
12 changes: 12 additions & 0 deletions pdata/pprofile/generated_profile.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions pdata/pprofile/generated_profile_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions pdata/pprofile/profile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile"

import "go.opentelemetry.io/collector/pdata/pcommon"

// EndTime returns the end time associated with this Profile.
//
// Deprecated: This field has been removed, and replaced with Duration
func (ms Profile) EndTime() pcommon.Timestamp {
return pcommon.Timestamp(0)

Check warning on line 12 in pdata/pprofile/profile.go

View check run for this annotation

Codecov / codecov/patch

pdata/pprofile/profile.go#L11-L12

Added lines #L11 - L12 were not covered by tests
}

// SetEndTime replaces the end time associated with this Profile.
//
// Deprecated: This field has been removed, and replaced with Duration
func (ms Profile) SetEndTime(pcommon.Timestamp) {

Check warning on line 18 in pdata/pprofile/profile.go

View check run for this annotation

Codecov / codecov/patch

pdata/pprofile/profile.go#L18

Added line #L18 was not covered by tests
}

0 comments on commit 3306d59

Please sign in to comment.