cryostatio / cryostatio/cryostat
[Request] Models should use types like `Instant` rather than raw timestamp `long`s
- Dominant language
- Java
- Stars
- 57
- Forks
- 17
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 42
Description
### Describe the feature
We currently represent things like [recording start times](https://github.com/cryostatio/cryostat3/blob/29e7abe95caab3321d5a1dc203ec0babd1ad7f8b/src/main/java/io/cryostat/recordings/ActiveRecording.java#L76) as raw `long` Unix epoch timestamps in our data models. This should instead use a nicer data type like [Instant](https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html) to better convey what the field actually represents and provide a nicer internal interface for working with this data.
We can configure the (de)serialization layer to continue working with epoch timestamps to preserve compatibility: https://quarkus.io/guides/rest-json#json
### Anything other information?
_No response_
Contributor guide
Research direction
Start with src/main/java/io/cryostat/recordings/ActiveRecording.java, especially the recording start-time field, and identify the other data-model timestamp fields that need the same treatment. Review the linked Quarkus REST JSON serialization guidance to verify how epoch timestamps remain compatible. Done means the models use Instant while the existing serialized timestamp format is preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100