Repository navigation
Reimplement baseline stashing metrics on top of last prod release - #7470
Conversation
Co-Authored-By: Mathieu Dutour <[email protected]>
Co-Authored-By: Mathieu Dutour <[email protected]>
This is useful because it means there is no need to worry about the last stash check date
Co-Authored-By: iAmWillShepherd <[email protected]>
|
Removed |
tests need to use the databass
Co-Authored-By: iAmWillShepherd <[email protected]>
…ng-metrics Adds some cache to improve baseline metrics performance
|
I've tested both interactions related to the metric:
As I've been involved closely with this PR, I'd love another pair of eyes on this review. |
Co-Authored-By: Brendan Forster <[email protected]>
outofambit
left a comment
There was a problem hiding this comment.
this looks good to me!
| return Promise.resolve(null) | ||
| } | ||
|
|
||
| this.updateStashEntryCountMetric(repository) |
There was a problem hiding this comment.
Hey @iAmWillShepherd, me and @billygriffin just looked through this today in our sync-up and noticed that there's a key difference between this and what's being proposed for 1.7 (#7438) in that the 1.7 release will trigger updateStashEntryCountMetric from _refreshRepository whereas this is called from _selectRepository.
The potential problem that we see with this is for the subset of our users that have a workflow similar to my own, i.e. they work primarily in one repository (rarely switch) and they keep their desktop instances running for a long time (weeks in my case) this approach will lead to us checking and incrementing the count pretty infrequently whereas the proposed solution for 1.7 we will check once every 24 hours regardless of whether they switch or not.
The end result here could be that if the segment we're talking about isn't trivial in size (I would personally guess that it's a decent chunk of our user base) we'd see a spike in stashes created outside of desktop once we ship 1.7 which would be the opposite of what we'd want.
I would propose we amend the 1.6.6 branch with a change that moves this check to the same place as it will be in 1.7 in an effort to avoid collection inconsistencies between versions.
There was a problem hiding this comment.
I would propose we amend the 1.6.6 branch with a change that moves this check to the same place as it will be in 1.7 in an effort to avoid collection inconsistencies between versions.
I'd rather move the check in the 1.7 PR to selecectRepository. For context, the PR from 1.6.6 initially had the check in refreshRepository, but I moved it because that code path gets ran a lot and doing DB queries isn't all that fast.
I'm going to link this comment in the PR for 1.7 to make sure I make this change.
There was a problem hiding this comment.
@iAmWillShepherd It doesn't seem like you addressed @niik's feedback here.
The potential problem that we see with this is for the subset of our users that have a workflow similar to my own, i.e. they work primarily in one repository (rarely switch) and they keep their desktop instances running for a long time (weeks in my case) this approach will lead to us checking and incrementing the count pretty infrequently whereas the proposed solution for 1.7 we will check once every 24 hours regardless of whether they switch or not.
The end result here could be that if the segment we're talking about isn't trivial in size (I would personally guess that it's a decent chunk of our user base) we'd see a spike in stashes created outside of desktop once we ship 1.7 which would be the opposite of what we'd want.
Get's metrics in place so we have a baseline for future metrics that will be added to address #7246.
This PR adds two new metrics:
stashEntriesCreatedOutsideDesktop- the number of stash entries we know about for the day.errorWhenSwitchingBranchesWithUncommmittedChanges- incremented when the user experiences an error trying to check out a new branch with uncommitted changesThe
stashEntriesCreatedOutsideDesktopmetric is a bit lazy because its value depends on which repositories a user opens during the day. So if you have 100 stashed in your-favorite-repo, but you never open that repo, those stash entries are not counted towards this metric. I chose this approach to limit the amount of background work we do. I'm open to changing the behaviour of this function if needed.Review checklist
Testing - #7438 (comment).
Related PR: #7438