Skip to content

Reimplement baseline stashing metrics on top of last prod release - #7470

Merged
outofambit merged 29 commits into
releases/1.6.6from
baseline-stashing-metrics2
May 9, 2019
Merged

outofambit merged 29 commits into
releases/1.6.6from
baseline-stashing-metrics2

Conversation

@iAmWillShepherd

@iAmWillShepherd iAmWillShepherd commented May 6, 2019 •

Copy link
Copy Markdown
Contributor

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 changes

The stashEntriesCreatedOutsideDesktop metric 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

Comment thread app/package.json Resolved
@outofambit
outofambit changed the base branch from releases/1.6.5 to releases/1.6.6 May 6, 2019 20:13
@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 7, 2019
@iAmWillShepherd
iAmWillShepherd requested a review from a team May 7, 2019 16:54
@iAmWillShepherd iAmWillShepherd removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 7, 2019
@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

Removed ready-for-review label to figure out why tests are now broken.

@shiftkey shiftkey added this to the 1.6.6 milestone May 8, 2019
Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/stores/app-store.ts Resolved
@outofambit outofambit added the epic:stashing Tracking label for work related to the stashing flow label May 8, 2019
Comment thread app/src/lib/stores/app-store.ts Resolved
@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 8, 2019
Comment thread app/src/lib/git/core.ts Resolved
@shiftkey

shiftkey commented May 9, 2019

Copy link
Copy Markdown
Member

I've tested both interactions related to the metric:

  • selecting a repository to check the last stash update (and maybe update a metric)
  • triggering a checkout which would overwrite working directory changes (and fails as expected) increments a metric

As I've been involved closely with this PR, I'd love another pair of eyes on this review.

@shiftkey
shiftkey requested a review from a team May 9, 2019 12:34
Comment thread app/src/lib/git/core.ts Resolved
Co-Authored-By: Brendan Forster <[email protected]>

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this looks good to me!

@outofambit outofambit self-assigned this May 9, 2019
@outofambit
outofambit merged commit 40cd573 into releases/1.6.6 May 9, 2019
@iAmWillShepherd
iAmWillShepherd deleted the baseline-stashing-metrics2 branch May 9, 2019 17:07
return Promise.resolve(null)
}

this.updateStashEntryCountMetric(repository)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@iAmWillShepherd iAmWillShepherd May 14, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

epic:stashing Tracking label for work related to the stashing flow ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants