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

[CLC-426]: Show Overall Remaining Time and Completion Percentage #423

Merged
merged 10 commits into from
Nov 7, 2023

Conversation

kutluhanmetin
Copy link
Contributor

No description provided.

@kutluhanmetin kutluhanmetin changed the base branch from main to dmt November 1, 2023 09:53
@kutluhanmetin kutluhanmetin requested review from yuce and srknzl November 1, 2023 09:53
Copy link
Member

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

can't we test this change 🤔 ?

@kutluhanmetin
Copy link
Contributor Author

can't we test this change 🤔 ?

I think it is a bit hard to test it, because values are changing constantly. And it is very easy to detect with manual tests that it wouldn't worth the effort IMO.

@kutluhanmetin kutluhanmetin requested a review from srknzl November 2, 2023 11:15
@srknzl
Copy link
Member

srknzl commented Nov 2, 2023

I was talking about maybe running dmt estimate and checking the output has the "remaining time x seconds" text. (via regex) @kutluhanmetin

but it's not too important if it's difficult

Copy link
Collaborator

@yuce yuce left a comment

Choose a reason for hiding this comment

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

A few ideas...

base/commands/migration/migration_stages.go Outdated Show resolved Hide resolved
base/commands/migration/migration_stages.go Outdated Show resolved Hide resolved
Comment on lines 255 to 259
// single iteration is enough that we are reading single result for a single migration
row, err := it.Next()
if err != nil {
return 0, 0, err
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought you've introduced a function to query SQL and return a single result

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are referring to querySingleRow that only uses row.Get(0) to fetch single result. But in here I have two values to read that I could not reuse it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe querySingleRow could be changed to return the row, not the first column.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other functions use that function in common, so it is re-used a couple of times. Shall we keep it as is?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's not too hard to make that change, I would change function I've described and change the code where it is called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't mean to say it is hard, I think it is not very useful.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are only 4 places querySingleRow is used, so not much code will be changed with that refactoring, and it will be more generic, so it can also be used ^.
You can also change its return value to return []any to return all column values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

base/commands/migration/migration_stages.go Outdated Show resolved Hide resolved
@kutluhanmetin kutluhanmetin requested a review from yuce November 3, 2023 08:34
Comment on lines 84 to 87
status.SetText("Unable to calculate remaining duration and progress")
} else {
status.SetProgress(cp)
status.SetRemainingDuration(rt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if the progress status is received after setting the ""Unable to calculate remaining duration and progress" text? Is it changed to "XXX is in progress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a bit hard to run this scenario on my local environment. I was expecting it to be updated with the stage's ProgressMsg. Is it wrong?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, progress message is set once, before the stage starts executing, see: clc/ux/stage/stage.go:152

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, this commit fixes it: 465a2e0

Comment on lines 255 to 259
// single iteration is enough that we are reading single result for a single migration
row, err := it.Next()
if err != nil {
return 0, 0, err
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's not too hard to make that change, I would change function I've described and change the code where it is called.

@kutluhanmetin kutluhanmetin requested a review from yuce November 4, 2023 17:32
@kutluhanmetin kutluhanmetin merged commit ead4607 into hazelcast:dmt Nov 7, 2023
5 checks passed
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.

3 participants