-
Notifications
You must be signed in to change notification settings - Fork 119
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
Flank needs to respect the timeout value as that's a cap for billing purposes. #865
Conversation
Hey, this is not a correct description of the problem. FTL does round to the nearest minute and that's how they bill. The problem is that Flank needs to respect the timeout value as that's a cap for billing purposes.
|
Thanks for fast feedback! I check rounding time strategy and flank rounding time always up. Now if we have 1m 7s flank round it to 2 mins. I think this is problem too because flank should round 1m 7s to 1m right? |
Firebase will bill us for 2m if a shard runs for 1m 7s. The only exception is if there's a timeout for 1m, then we'll only ever be billed up to the timeout. |
agreed, flank needs to take timeout value under consideration. |
1d7944d
to
522ffbf
Compare
Description updated |
Feedback from Paul Davis via Slack:
if (!execution.attempts().isEmpty()) {
Attempt lastAttempt = execution.attempts().get(execution.attempts().size() - 1);
if (lastAttempt.getAttemptStatus() != AttemptStatus.ERROR && execution.state() != TestState.ERROR) {
// do rounding/timeout calculations as described in the pull request
}
} |
@bootstraponline |
…f lower than timeout
bf58fa6
to
e80131f
Compare
we should probably document clearly in the Kotlin file what the business rules for billing are. 🙂 |
@@ -27,7 +29,7 @@ class SavedMatrix(matrix: TestMatrix) { | |||
|
|||
var billableVirtualMinutes: Long = 0 | |||
private set | |||
var billablePhysicalMinutes: Long = 0 | |||
var billablePhysicalSecondsMinutes: Long = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we think about other name, because I am confused if we use seconds or minutes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, definitely. We have yet another round of refactor ahead of us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, its my fail. Its should be billablePhysicalMinutes
.setResultStorage(createResultsStorage()) | ||
.setState(MatrixState.FINISHED) | ||
.setTestMatrixId("123") | ||
.setTestExecutions( | ||
listOf( | ||
createStepExecution(executionId, "") | ||
) | ||
) | ||
), | ||
testTimeout = defaultTestTimeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe make it as a default parameter value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are thinking about default value for SavedMatrix
constructor I don't think it's good idea. That would lead us to 2 places where default value (common args and SavedMatrix
constructor) is hold, easy to forget about one when changing/updating second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we get testTimeout from api response so we don't need pass them by constructor.
According to Paul Davis, we can check just
Description updated Another comment:
In theory we could use |
I'd like to support both Spark plan and the paid plan. It's useful to know what Flank runs will cost. We probably need to setup a paid FTL account to verify |
Therefor
I might have access to the project with paid plan -- will check it |
@bootstraponline With 'error check' we would have correct numbers as well |
So this is plan:
|
That sounds good. The FTL API is often completely broken so it's good that we always double check. 🙂 |
2f4997e
Fixes #836
Flank billing calculation rules:
3m 22s
4m
15m 01s
16m
5m 00s
5m
ERROR
flank should skip billing calculation and assume$0.00
Examples:
13m 24s
and timeout is default (15m
), execution time is smaller then timeout therefor is rounded up to14m
and used in billing calculations20m 13s
and timeout is set to18m
, execution time is bigger then timeout therefor timeout value (18m
) is used in billing calculationsTest Plan
Flank needs to respect the timeout value as that's a cap for billing purposes, and round time to nearest minutes.
flank should return cost report with 2 min
flank should return cost report with 1 min
flank should return cost report with 2 min
Checklist