Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

fix stats #3730

Merged
merged 22 commits into from
Aug 31, 2015
Merged

fix stats #3730

merged 22 commits into from
Aug 31, 2015

Conversation

chadwhitacre
Copy link
Contributor

Closes #3446.

No longer necessary post-#3718.
The total users/volume charts provide little value because they can only
ever increase. The charges and withdrawals charts don't tell us much
that the weekly volume chart doesn't, especially after #1383.
Reflects the move away from individual no-strings-attached tip gifts in
1.0 to voluntary payments in 2.0.
@chadwhitacre chadwhitacre added this to the Refund Announcement milestone Aug 31, 2015
@chadwhitacre chadwhitacre force-pushed the fix-stats branch 2 times, most recently from ea73d1c to 1b752cf Compare August 31, 2015 13:20
That was mostly interesting early on when our time horizon was closer.
Now we don't care as much about intra-week changes to the system as a
whole.
Weekly volume is the crucial chart. That's the one I refer to when
telling people the story of Gratipay.
We were tracking all sorts of stuff that we never looked at. Let's pare
down to the numbers we actually care about: volume and nactive.
Having gotten rid of the other *_volume columns, we can simply the name
of this one.
@chadwhitacre
Copy link
Contributor Author

The next step I'm working on is to add a payday column to the transfers table, so that we can recompute volume and nactive in a similar way both pre- and post-Gratipocalypse. However, I have discovered a single record in the transfers table where the amount is negative. We have a positive check constraint now which is catching the error. I'm not sure how the record ended up in there in the first place. It happened in May of last year. The ~user in question has a balance, and the amount is only 33¢. I'm inclined to correct the error using the user's balance.

@chadwhitacre
Copy link
Contributor Author

The user in question was involved in a MassPay snafu: #2417.

@chadwhitacre
Copy link
Contributor Author

Alright, so we have this negative-amount record in transfers, and the bottom line for this ticket is that that record is not going way. I propose to work around it by relaxing the positive check constraint on amount, performing the update, and then reinstating the check constraint.

P.S. The way we ended up with the negative transfer is complicated: our 1.0 payroll implementation computed the amount to transfer to the last person taking as the remainder of the team's balance, and as a result of the MassPay snafu in #2417, the team had a negative balance, so therefore the last person's take was negative!

@chadwhitacre
Copy link
Contributor Author

Positive constraint is in #2723, btw.

@chadwhitacre
Copy link
Contributor Author

Okay, got it. Looks like we have 563 non-payday transfers (take-over, final-gift), and 523,762 payday transfers.

@chadwhitacre
Copy link
Contributor Author

Actually, we don't need to reset the pre-Gratipocalypse values, though we may as well add the payday column to transfers since I've got that ready now.

This is less interesting now that we have Teams in between. The original
question this was answering was whether Gratipay was just circulating
money around amongst the same few people.
They were doubled because we were counting both sides, payment and
payroll. We should just count payment.
@chadwhitacre
Copy link
Contributor Author

I'm seeing a volume spike in 159. What's that about?

screen shot 2015-08-31 at 12 14 53 pm

@chadwhitacre
Copy link
Contributor Author

What's that about?

It was a user with multiple Teams consolidating their funds in one Team as part of getting paid out for the first time.

https://gratipay.freshdesk.com/helpdesk/tickets/2090

@chadwhitacre
Copy link
Contributor Author

Okay! We have accurate volume and active user charts again! :-)

screen shot 2015-08-31 at 12 23 31 pm

@chadwhitacre
Copy link
Contributor Author

Winding down here, ready for review if anyone is around. :)

Properly i18n'd and no more stats.json
@chadwhitacre
Copy link
Contributor Author

screen shot 2015-08-31 at 1 29 50 pm
screen shot 2015-08-31 at 1 29 59 pm

@chadwhitacre
Copy link
Contributor Author

Ready?

chadwhitacre added a commit that referenced this pull request Aug 31, 2015
@chadwhitacre chadwhitacre merged commit 3a2eb68 into master Aug 31, 2015
@chadwhitacre chadwhitacre deleted the fix-stats branch August 31, 2015 20:02
@chadwhitacre chadwhitacre mentioned this pull request Aug 31, 2015
chadwhitacre added a commit that referenced this pull request Aug 31, 2015
This was referenced Aug 31, 2015
chadwhitacre added a commit that referenced this pull request Sep 13, 2015
We removed a number of payday stats fields, but were still trying to
populate those in fake data. This PR also makes db cleaning a little
more robust so we can recover from failure during `make fake`.
chadwhitacre added a commit that referenced this pull request Sep 13, 2015
We removed a number of payday stats fields, but were still trying to
populate those in fake data. This PR also makes db cleaning a little
more robust so we can recover from failure during `make fake`.
chadwhitacre added a commit that referenced this pull request Sep 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant