Expect an Update Soon — Earnings Extension
Assumption is the mother of all fuckups

With the latest update, I wanted to go out with a bang this year. It didn’t exactly prove to be the best fireworks, however. It did feature a couple of explosions. They went off right in my face.
I came out relatively unscathed, and, more importantly, more determined to deliver some quality this time.
The upcoming update will fix a few things that had crept into the release due to some of my assumptions:
- better performance
- correct earnings
- correct filtering
- a couple of small bonuses
Performance
First things first. Performance. It sucked in the last update. I knew this could be a problem, but the extension did well on my machine and there weren’t any issues coming out of the beta, so I assumed I’d be alright.
Assumption is the mother of all fuckups.
— Steven Seagal, a great philosopher
Being a man of culture, I knew the saying.
And I assumed I wouldn’t fall victim to it.
There is a lot of data involved if you want to display earnings. There’s data for each and every day you gain views or earnings. This easily accumulates into thousands (if you’re new to Medium, like me) or tens of thousands of data points (if you’re a Medium veteran).
My assumption: a computer is designed to handle data. So what are a few thousand data points in computation time? Nothing, right?
Boy, I was wrong.
Anthony Lawrence (Pcunix), our most precious resident beta-tester contacted me with a troubling issue: “Loading takes about 9 minutes”.
Nine minutes! I’ve had sex in less than that!
There’s no way to make this long story short. It really took a long time. On his Mac and on my computer as well. With over 500 stories and more than a year on Medium there was a lot of data to process.
Together we sat down to find the culprit. We took some measurements, did some tests, fiddled around. I silently did some cursing while he patiently awaited the results.
- Loading the data was really fast. 1.8 seconds
- Parsing the table too longer than I wanted, but more or less within limits at 17 seconds.
- The newly introduced graph was the culprit. An explosive entry at 9 minutes.
Ouch! It worked on my machine is all I can say.
So, what to do about it?
I can optimize the graph by compressing data. Merging data to, let’s say weeks instead of days. This will help somewhat, but J feel that would make the plot next to useless. So I did the only thing I could do: remove the graph in its entirety.
I have replaced the line graph with a spiffy new bar graph I was working on. Nothing too fancy, but useful nonetheless: your earnings per month.

I am not sure I will feature a new graph in the upcoming release. I want to launch it fast as there are probably a lot more people out there that want their fix.
Showing the correct earnings
When I created the extension, this is what I assumed:
- on any given day, you can get views for a story
- if medium members read the story, you can get earnings
Oh, how I was wrong.
In the previous versions of the extension, I did not take the following into account:
- a non-medium member reads a story
- she decides to become a member at a later date
- the story she has read didn't get any views that day
- but you did get earnings at the time she became a member
The missing earnings had me puzzled for some time. I knew what was going on, but I was sure medium did some magic trick to boost the earnings using another mechanism. Today I crushed that assumption by doing a better analysis.
Your earnings in the extension should now match the earnings on the MPP dashboard.
Marie A. Rebelle notified me of discrepancies between the extension and what Medium gives back to you. She was the one that prompted me to look into the matter. Thanks, Marie!
̶B̶e̶t̶t̶e̶r̶ Correct filtering
As I punched in the code for the filter to select a date range, I wanted to get it to work before I optimized it. I assumed to remember to fix some minor stuff later.
Sigh.
The filter didn’t work correctly. I didn’t take the end date of the range into account while I displayed the results. It does so now. Sorry for all the confusion!
Small bonuses
The upcoming release features a few bonuses that aren’t worth mentioning. I do, however, want to give a heads up on this one:
- The csv-export now exports the dates with leading zeroes. This isn’t for everyone, but it it makes automatic parsing of data easier for those that use the csv.
Release Date
I have fixed the performance issue by removing the graph. I have fixed the earnings. I have fixed the filter. So, the release is good to go, you assume?
Well, I’m done assuming. I’m just going to go ahead and assume I need to do some more testing, ok?
I want to include the graph I have shown above. Expect an update somewhere early next year.
Sorry for the wait. In the meantime: have a great New Year’s Eve everyone!





