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

NAS-131317 / 25.04 / Replaced Lifetime with Power On Hours #10845

Merged
merged 7 commits into from
Oct 14, 2024
Merged

Conversation

aiden3c
Copy link
Contributor

@aiden3c aiden3c commented Oct 10, 2024

I replaced the "Lifetime" value in our smart test results with "Power On Hours Ago". This reports how many "power on hours" ago a test happened.
Power on hours are how many hours a disk has been on, the "hours ago" is the disks' total POH - the disks' POH when the test was initiated.

It would be really nice if we could track the actual timestamp of test starts, but smartctl doesn't supply that information. We could track it ourselves, but that becomes very complicated after tests overwrite their own history (scsi only reports the most recent 20 for example). I've thought of some ways to maybe track the actual "hours ago" a test was performed, but it always balloons out. After discussion with Caleb we decided that POH would be the best bet.
Regardless, it's more useful and readable than the raw disk lifetime value.

This has to be paired with this middleware PR, otherwise the key won't exist when getting the results.

@aiden3c aiden3c requested a review from a team as a code owner October 10, 2024 16:04
@aiden3c aiden3c requested review from bvasilenko and a team and removed request for a team October 10, 2024 16:04
@bugclerk bugclerk changed the title NAS-131317: Replaced Lifetime with Power On Hours NAS-131317 / 25.04 / Replaced Lifetime with Power On Hours Oct 10, 2024
@bugclerk
Copy link
Contributor

@aiden3c
Copy link
Contributor Author

aiden3c commented Oct 10, 2024

Oh another thing I added was a "toolTip" property to our ColumnComponent, and the ix table header will use that in place of the default tooltip (just reiterating the title) if it exists.

There's some public facing verbiage so it's worth reviewing that too. Just the explanation of what POH are

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.80%. Comparing base (f777b2f) to head (8dc5247).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10845   +/-   ##
=======================================
  Coverage   81.79%   81.80%           
=======================================
  Files        1588     1588           
  Lines       55082    55083    +1     
  Branches     5805     5805           
=======================================
+ Hits        45055    45059    +4     
+ Misses      10027    10024    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@undsoft undsoft left a comment

Choose a reason for hiding this comment

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

So, I don't think it's going to be obvious to the user that there is a tooltip available over table header. I'd rather we make headerTooltip an optional property and when supplied show tooltip circle (ix-tooltip) in the header.

@@ -5,6 +5,7 @@ import { DataProvider } from 'app/modules/ix-table/interfaces/data-provider.inte
export abstract class ColumnComponent<T> {
propertyName?: keyof T;
title?: string;
toolTip?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better call it headerTooltip.

@@ -84,6 +89,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: 0,
poh_ago: 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add at least one value, so that it appears in the table below.

propertyName: 'lifetime',
title: this.translate.instant('Power On Hours Ago'),
propertyName: 'poh_ago',
toolTip: '"Power On Hours" are how many hours have passed while the disk has been powered on. "Power On Hours Ago" is how many power on hours have passed since each test.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please wrap string with this.translate.instant so that it gets extracted into translation messages.

@@ -52,6 +52,7 @@ export interface SmartTestResult {
status: SmartTestResultStatus;
status_verbose: string;
segment_number: number;
poh_ago: number;
Copy link
Collaborator

Choose a reason for hiding this comment

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

poh_ago, such a descriptive name 😅

@aiden3c aiden3c requested a review from undsoft October 11, 2024 14:57
Copy link
Collaborator

@undsoft undsoft left a comment

Choose a reason for hiding this comment

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

Looks good, tested via mocks. As long as middleware has power_on_hours_ago in the response, it'll be shown correctly.

Let's make the following adjustments:

  1. Add (click)="$event.stopPropagation()" to ix-tooltip in ix-table-head, so that it doesn't trigger column sorting when tooltip is opened.
  2. Align it vertically to be inline with the text.
  3. Test fails in part because code picks up test in the tooltip. You can replace Power On Hours Ago in expect block with expect.stringContaining('Power On Hours Ago') for now.

@aiden3c aiden3c requested a review from undsoft October 14, 2024 13:15
Copy link
Collaborator

@undsoft undsoft left a comment

Choose a reason for hiding this comment

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

Looks good, tests need fixing.

@aiden3c aiden3c merged commit ac4f960 into master Oct 14, 2024
13 checks passed
@aiden3c aiden3c deleted the NAS-131317 branch October 14, 2024 18:50
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants