Skip to content

Conversation

@jianyun8023
Copy link

Fix smart attributes query to use limit() instead of tail() for fetching recent entries

  • Updated the aggregation logic in aggregateSmartAttributesQuery to utilize limit() for retrieving the newest entries after sorting, ensuring correct data retrieval.
  • Adjusted subquery construction to improve clarity and maintainability.
  • Enhanced comments for better understanding of the changes made.

I am implementing prometheus metrics using this interface, and found that the description of this method differs from the actual implementation, which caused me to be unable to obtain the latest attribute using smarts, err := deviceRepo.GetSmartAttributeHistory(ctx, w, "forever", 1, 0, nil).

…fetching recent entries

- Updated the aggregation logic in `aggregateSmartAttributesQuery` to utilize `limit()` for retrieving the newest entries after sorting, ensuring correct data retrieval.
- Adjusted subquery construction to improve clarity and maintainability.
- Enhanced comments for better understanding of the changes made.

(cherry picked from commit c1f70ff)
Starosdev added a commit to Starosdev/scrutiny that referenced this pull request Nov 30, 2025
Starosdev pushed a commit to Starosdev/scrutiny that referenced this pull request Nov 30, 2025
## [1.1.0](v1.0.0...v1.1.0) (2025-11-30)

### Features

* Add "day" as resolution for temperature graph ([2670af2](2670af2))
* add day resolution for temperature graph (upstream PR [AnalogJ#823](https://github.com/Starosdev/scrutiny/issues/823)) ([2d6ffa7](2d6ffa7))
* add setting to enable/disable SCT temperature history (upstream PR [AnalogJ#557](https://github.com/Starosdev/scrutiny/issues/557)) ([c3692ac](c3692ac))
* Implement device-wise notification mute/unmute ([925e86d](925e86d))
* implement device-wise notification mute/unmute (upstream PR [AnalogJ#822](https://github.com/Starosdev/scrutiny/issues/822)) ([ea7102e](ea7102e))
* implement Prometheus metrics support (upstream PR [AnalogJ#830](https://github.com/Starosdev/scrutiny/issues/830)) ([7384f7d](7384f7d))
* support SAS temperature (upstream PR [AnalogJ#816](https://github.com/Starosdev/scrutiny/issues/816)) ([f954cc8](f954cc8))

### Bug Fixes

* better handling of ata_sct_temperature_history (upstream PR [AnalogJ#825](https://github.com/Starosdev/scrutiny/issues/825)) ([d134ad7](d134ad7))
* **database:** add missing temperature parameter in SCSI migration ([df7da88](df7da88))
* support transient SMART failures (upstream PR [AnalogJ#375](https://github.com/Starosdev/scrutiny/issues/375)) ([601775e](601775e))
* **ui:** fix temperature conversion in temperature.pipe.ts (upstream PR [AnalogJ#815](https://github.com/Starosdev/scrutiny/issues/815)) ([e0f2781](e0f2781))

### Refactoring

* use limit() instead of tail() for fetching smart attributes (upstream PR [AnalogJ#829](https://github.com/Starosdev/scrutiny/issues/829)) ([2849531](2849531))
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.

1 participant