Skip to content

Convert gc duration metrics to seconds#12244

Merged
trask merged 1 commit into
open-telemetry:mainfrom
laurit:gc-metrics-seconds
Sep 13, 2024
Merged

Convert gc duration metrics to seconds#12244
trask merged 1 commit into
open-telemetry:mainfrom
laurit:gc-metrics-seconds

Conversation

@laurit

@laurit laurit commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

#12084 changed the unit to seconds but forgot to convert the value from millis to seconds

@trask trask merged commit 521109e into open-telemetry:main Sep 13, 2024
@egahlin

egahlin commented Sep 14, 2024

Copy link
Copy Markdown

> DurationUtil.millisToSeconds(ev.getLong(Constants.DURATION))

This looks strange. The raw value of the "duration" field is in ticks and the conversion factor depends on the platform and machine. The reasonable thing is to do ev.getDuration().toMillis() and let JFR do the conversion.

@laurit laurit deleted the gc-metrics-seconds branch September 15, 2024 10:34
@laurit

laurit commented Sep 15, 2024

Copy link
Copy Markdown
Contributor Author

> DurationUtil.millisToSeconds(ev.getLong(Constants.DURATION))

This looks strange. The raw value of the "duration" field is in ticks and the conversion factor depends on the platform and machine. The reasonable thing is to do ev.getDuration().toMillis() and let JFR do the conversion.

@egahlin Thanks for reporting this. I have created #12256 to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants