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

UI: Node drain and eligibility #4353

Merged
merged 10 commits into from May 30, 2018
Merged

UI: Node drain and eligibility #4353

merged 10 commits into from May 30, 2018

Conversation

DingoEatingFuzz
Copy link
Contributor

Changes to clients list:

  1. Address and Port columns are now merged
  2. New drain column with blue text when a node is draining
  3. New eligibility column with orange text when a node is ineligible for scheduling

Changes to client detail:

  1. New orange status light when a node is ineligible for scheduling
  2. Drain and eligibility status in the Client Details information strip
  3. New Drain information strip when a node is draining, includes states for
    1. Drain with a deadline
    2. Drain with no deadline
    3. Forced drain

Clients list with a client that is draining
screen shot 2018-05-30 at 12 44 09 am

Client detail for a client that is draining with a deadline
screen shot 2018-05-30 at 12 50 03 am

Client detail for client that is force-draining (rare to see given the nature of a forced drain)
screen shot 2018-05-30 at 11 24 28 am

Copy link
Member

@alisdair alisdair left a comment

Choose a reason for hiding this comment

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

This is great! 👍 Just one thought about clarity in the format-duration util.

} else if (units === 'mms') {
durationParts.microseconds = duration % 1000;
duration = Math.floor(duration / 1000);
}
Copy link
Member

Choose a reason for hiding this comment

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

I found this part a little tricky to follow. My reading is that the unit of duration can be one of nanoseconds, microseconds, or milliseconds, and for the former two cases we're normalizing it back to milliseconds here.

If that's correct, it might also be clearer to mutate the units argument in these blocks also, rather than in the dense ternary on the following line. And perhaps some commentary explaining this might also help?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Units can be any unit moment supports (ms, s, m, h, days, months, years) as well as microseconds and nanoseconds, which moment doesn't support.

So this ternary:

  const momentDuration = moment.duration(duration, ['ns', 'mms'].includes(units) ? 'ms' : units);

Uses units as is unless units is either microseconds or nanoseconds, in which case nanos and micros need to be calculated upfront and duration needs to be normalized as milliseconds.

But your suggestion to reassign units to ms is still valid. Also point taken about needing comments.

@@ -75,6 +76,18 @@ test('/clients/:id should list additional detail for the node below the title',
.includes(node.httpAddr),
'Address is in additional details'
);
assert.ok(
Copy link
Contributor

Choose a reason for hiding this comment

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

Not that you need another testing framework, but qunit-dom has been nice to use for tests like this (and you don't need to do all of the trim / includes stuff).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My testing backlog includes

  1. qunit-dom
  2. ember-cli-page-object
  3. testing unification
  4. async/await
  5. refactoring how I use mirage now that I know it better

Some day!

@DingoEatingFuzz DingoEatingFuzz merged commit 400ca29 into master May 30, 2018
@DingoEatingFuzz DingoEatingFuzz deleted the f-ui-node-drain branch May 30, 2018 21:40
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants