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

fix NR: use elvis instead of null operator #1720

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

jamestranovich-noaa
Copy link
Collaborator

@jamestranovich-noaa jamestranovich-noaa commented Sep 9, 2024

What does this PR do? πŸ› οΈ

Send timestamps to New Relic properly.

Before:

[{"metrics":[{"name":"wx.observation","type":"gauge","value":2127.3710043474975,"timestamp":false,"attributes":{"withinGridCell":false,"stationIndex":0,"obsStation":"LBNL1","distance":2127.3710043474975,"usesReferencePoint":true,"applicationName":"local"}}]}]

After:

[{"metrics":[{"name":"wx.observation","type":"gauge","value":2127.3710043474975,"timestamp":1725906130,"attributes":{"withinGridCell":false,"stationIndex":0,"obsStation":"LBNL1","distance":2127.3710043474975,"usesReferencePoint":true,"applicationName":"local"}}]}]

What does the reviewer need to know? πŸ€”

The Elvis operator is a shorthand for ternary operator and is so called because it looks like Elvis with his signature hairstyle. (Wikipedia)

Addresses #1447

Copy link
Collaborator

@greg-does-weather greg-does-weather left a comment

Choose a reason for hiding this comment

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

I've never heard of the "Elvis operator" before. πŸ˜‚ Still, looking into how this works, this looks like it's definitely the right way to go.

@jamestranovich-noaa jamestranovich-noaa merged commit 4211cd8 into main Sep 9, 2024
16 of 17 checks passed
@jamestranovich-noaa jamestranovich-noaa deleted the jt/fix-new-relic-timestamps branch September 9, 2024 18:52
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.

2 participants