Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consistent hash structure for process stats #3470

Merged

Conversation

philippthun
Copy link
Member

@philippthun philippthun commented Oct 10, 2023

The ProcessStatsPresenter distinguishes between down and found instances. For down instances it expects the uptime key in the given hash itself, for found instances, it is part of the stats hash. Although the ReporterMixin constructed down instances as expected, there were cases (e.g. placement errors) where a different hash was created. This resulted in a JSON response containing "uptime":null.

With this change a consistent hash structure is used for all cases, i.e. uptime is a key in stats.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun philippthun marked this pull request as ready for review October 11, 2023 14:05
The ProcessStatsPresenter distinguishes between 'down' and 'found'
instances. For 'down' instances it expects the 'uptime' key in the given
hash itself, for 'found' instances, it is part of the 'stats' hash.
Although the ReporterMixin constructed 'down' instances as expected,
there were cases (e.g. placement errors) where a different hash was
created. This resulted in a JSON response containing "uptime":null.

With this change a consistent hash structure is used for all cases, i.e.
'uptime' is a key in 'stats'.
Copy link
Contributor

@johha johha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@philippthun philippthun merged commit 779c887 into cloudfoundry:main Oct 17, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants