search – wolfram alpha going live – part 2

See part 1 for the background of this webcast or part 3 for my impressions after cutover.  Cnet also has an article on the last minute delays.

Interesting tidbits from the live webcast.  I’ll be updating this post as I watch.

8:55 CST:

  • They commented about all the traffic they are getting now through the backdoor they left open.  That should give them more!
  • Changing usership from academic to the general public.
  • And I’m out for the night.  Two hours of watching a deployment is about my limit unless I’m actually part of the project.  We had a five hour deployment at JavaRanch and have gone significantly longer than that where I work at a bank.  But those were projects I was on.
  • Good luck to the Wolfram Alpha team.  I hope things go smoothly and you don’t have too long a night.  I look forward to reading about it tomorrow.

8:50 CST:

  • Talking about how Wolfram Alpha relates to Mathematica

8:45 CST:

  • Back to interrupting the guy doing the testing.
  • There was some sort of connectivity problem.  They are deploying a patch now.
  • Among the many dashboards is a weather display in case they have to watch for weather

8:40 CST:

  • I lost my video for a couple minutes, but it looks like they are still showing the control room with background noise
  • A deployment doesn’t have every minute filled with excitement!

8:35 CST:

  • Just showing control room now.
  • People are sharing links in chat which do work even if you can’t do a new query from your area.  For example, what is a noreaster and area of california

8:30 CST:

  • Some people in chat seem to be able to get through to do queries.  I can’t though.  I wonder if it is IP address based to limit load until they are ready?
  • I just saw a comment “Yeah – it’s working in Massachusetts”

8:25 CST:

  • They are getting feedback from viewers via Twitter and through the software itself.
  • Someone is moderating chat in the software.  Quite frequently at the moment.  You have to be on the justin.tv version of the feed to contribute to chat.  Which unfortunately caused a reload of the video and I missed some.    There are a few relevant comments, but it’s mostly “chat spam.”

8:20 CST:

  • Cut to interviews with developers about mathematics behind the system along with how it relates to Mathematica.  Also talked about how they envision people integrating Wolfram Alpha into their own site along with as a search engine.  They also expressed interest in seeing what people come up with on their own.
  • The interview also covered the beginning – that they did unit conversion first.

8:15 CST:

  • More details of rac tour including the decisions of managing the physical cables.
  • Red is visible on the monitoring screen in the background.
  • They think the live webcast affected the bandwidth available for the load test.
  • Pointed out how the things that get you are always the little unexpected things.  (Of course – the expected things were planned for!)
  • Also pointed out how the nasty problems tend to come up towards the end for big projects.

8:10 CST:

  • Showed command line screen of load tester.  You can’t read it from the webcast, but it’s still there.
  • I would think it would be annoying to have a camera questioning you as you are trying to run a load test – but that’s just me.
  • Cut to tour of supercomputer.  At least now they are letting the load tester work!

8:05 CST:

  • Showed stream of data from queries.  They expressed that they did in fact take precautions that no personally identifiable information will be in the feed.
  • Don’t want too many people using system at once at first so not overwhelmed.
  • They are now doing a load test from a simulated “real” location to make sure the system won’t fall apart.

8:00 CST:

  • Showed monitoring graphs including queries per second along with discussion on what is desired state – growing but not beyond capacity.
  • They also showed the computer cluster graph and plan to show more throughout the night.

7:55 CST:

  • Cut to pre-recorded video of control room
  • Cut to pre-recorded video showing server topology along with cooling fans and server rack.  They also discussed failover – if one machine fails, another just takes over.

7:45 CST:

  • “We’re launching a product and not a TV show” – I like this quote.  it shows where priorities are.  Sharing cutover with the world is quite ambitious I must say.
  • Cut to tour of backup generator/uninterruptible power supply.  The UPS is good for 30-70 minutes.  It wouldn’t be needed that long of course as they pointed out the backup generator would go on within a few minutes.  I assume this piece was pre-recorder.

7:40 CST:

  • It’s a very large, distributed project.
  • They have two “webcast guides” to narrate things so “the guy in charge” can do work.
  • They explained the background noise – it includes thunder.  They are listening to feedback (from somewhere) on the webcast in realtime.
  • They walked through why so many people are in the room (including cutting to showing them) and their function – including load testing, cutover team, etc.
  • Given the thunderstorm, they explained that they do in fact have a backup generator for electricity.  Good contingency planning.

7:33 CST:

  • They have a tornado watch in Illinois during this deployment.
  • It sounds like a live webcast – the background noise is audible – you can tell he really is in a big room with a lot of activity.
  • There’s a nice dashboard setup on the wall for monitoring.

search – wolfram alpha going live

The process of bringing Wolfram Alpha online is being webcast live right now.  It starts with a 5 minute intro along with some other pre-recorded clips.  Some interesting tidbits:

  • it will be run on thousands of CPUs
  • it is planned to be a 48 process – presumably shooting for being fully live Monday morning
  • the webcast will include deployment and testing

I look forward to seeing snippets of it throughout the weekend.

I also watched the overview of what Wolfram Alpha is all about.  My first impression as posted earlier on JavaRanch:

What is interesting to me is that it gives you the answer, but not the source. For calculations, there isn’t really a source anyway. I don’t cite that 2+2=4. However, I do cite the population of Germany. So how are we supposed to know it is right? On the other hand, I think showing similar information you might not have asked for is cool.

I expect my impression will change once I actually get to try it out.

7:15 CST , I’m still unable to get through to the live part.  Firefox is still showing the pre-recorded clips and my other browser is timing out on the site.  Will try agin later.

7:30 CST: It was a browser caching thing.  Clearing the cache shows justin.tv – the live part.  The site is very slow.  I think demand is higher than expected to follow the events live.  Maybe it was publicized too well?

7:31 CST: It’s up now.  Reloading yet again helped.

See part 2 for my impressions of the parts of the webcast I am watching tonight.

how testing can improve legacy code design

There’s no shortage of articles on how TDD improves the design of new code.  That’s all well and good.  But what about legacy code?

How it came up

This weekend, I had occasion to make a few enhancements to the email sending project at JavaRanch.  The one that got me thinking about the design was when I needed to add some logic to filter the e-mail list.  I was trying to allow specifiying the start and end index so we could resend to just part of the list if the process failed.  After all, you don’t want people getting two copies.

What I did

As the current filtering logic was in the BulkMailerProcess class, I decided to start there.  This class has a bunch of dependencies and isn’t currently tested.  Hello legacy code!  My first thought was that I would make my new filtering method package private and test that.  As I set out to write the test, I realized I needed to get access to the instance variable containing the list of e-mails.  Ugh.  This made me cringe enough to think about an alternate direction.

My next thought was that I really have a separate concept here.  I’m filtering e-mails.  So it one of the existing methods in BulkMailerProcess.  (It makes sure the e-mails are properly formed.)  Time to create a new class.  At this point it was easy.  My new class EmailFilter takes a list of e-mails and runs both filtering/cleaning operations on them.  It’s very focused and gets all that logic out of the main processing class.  I feel like I left the code cleaner than I found it.

The result

It certainly is more tested.  The method to clean the e-mails wasn’t originally tested since it was so embedded in everything else.  Now it is.  In fact now it is tested at 100%.  Without looking at the implementation of the method I copied in, I did write one test to verify the method gets called and at least does what it sounds like.  With this system I got to 96% coverage on the new EmailFilter class.  I could easily get to 100%, but that’s for another day.  The goal here isn’t to be perfect.  It’s to leave things better than they started out.

I left a comment in the code so nobody thinks it is more tested than it is.

/**
* Check valid format for email. This logic was moved verbatim from
* BulkMailerProcess class. Do not change without adding more detailed unit
* tests to verify behavior.
*/

What’s next

The only thing I’m less than happy with is the name of the class.  I started with EmailListUtil because I didn’t have a better name.  Then I changed it to EmailFilter.  But it’s not just a filter.  It’s doing validation too for cleaning the invalid e-mails from the list before filtering by index.  I’ll have to think about the name some more.

The other next step is to improve things a little more next time I touch the code.  I already have some ideas.  The key is to not attempt too much at once.  That would be overwhelming.  A little at a time makes it doable.