-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(experiments): New running time calculator (1/2) #41862
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
Conversation
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.
10 files reviewed, 4 comments
| if (!baselineValue) { | ||
| return { currentExposures: null, recommendedSampleSize: null, exposureRate: null, estimatedRemainingDays: null } | ||
| } |
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.
logic: baselineValue of 0 is a valid value (e.g., 0% conversion rate), but here it's treated as falsy and returns null
| if (!baselineValue) { | |
| return { currentExposures: null, recommendedSampleSize: null, exposureRate: null, estimatedRemainingDays: null } | |
| } | |
| if (baselineValue === null) { | |
| return { currentExposures: null, recommendedSampleSize: null, exposureRate: null, estimatedRemainingDays: null } | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/scenes/experiments/RunningTimeCalculatorNew/calculations.ts
Line: 264:266
Comment:
**logic:** `baselineValue` of 0 is a valid value (e.g., 0% conversion rate), but here it's treated as falsy and returns null
```suggestion
if (baselineValue === null) {
return { currentExposures: null, recommendedSampleSize: null, exposureRate: null, estimatedRemainingDays: null }
}
```
How can I resolve this? If you propose a fix, please make it concise.
frontend/src/scenes/experiments/RunningTimeCalculatorNew/calculations.ts
Show resolved
Hide resolved
frontend/src/scenes/experiments/RunningTimeCalculatorNew/calculations.ts
Outdated
Show resolved
Hide resolved
frontend/src/scenes/experiments/ExperimentView/RunningTimeNew.tsx
Outdated
Show resolved
Hide resolved
|
Size Change: +56 B (0%) Total Size: 3.43 MB ℹ️ View Unchanged
|
rodrigoi
left a comment
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.
This is a much better UX. A list of non-blocking things for now, or the future 😉 :
- Divisions by zero. This was a problem that plagued the old calculator. I would recommend adding checks and tests to
calculations.ts. - Modal Logic. Instead of adding to
modalsLogic.ts, create a tiny logic to control the modal, like metricSourceModalLogic.tsx. Or search for*ModalLogic.tsin the codebase. - Running time logic. For
RunningTimeNew.tsx, add logic because you have an effect.
…lations.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…lations.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…new-running-time-calculator

Feature flag:
experiments-new-calculatorProblem
Our running time calculator
sucksisn't great.Changes
https://www.loom.com/share/96cce3083fa54eb7b3ad782ac0308e00
This is part 1 - automatic calculation based on results, which will be good enough for most users. Part 2 will add the option to calculate sample size using fully manual inputs (an “advanced” mode for experienced users).
How did you test this code?
Added unit tests for the new methods that replicate the kea logic tests of the existing calculator.