Tuesday, May 16, 2006

Server configuration

Server configuration is a pain, especially for distributed systems. My problem? I want n A processes running on m boxes talking to p B processes on q boxes, where a m-box can also be a q-box. One issue is each process needs to use its own ports and other processes need to know those ports.

There are so many ways to have one level of indirection, but all require a central bootstrap/lookup.

I suppose something like zeroconf would help, as each process would broadcast its info to the others, but is that too heavyweight?

I looked briefly at Puppetsince I'm on a Ruby kick, but it seems too abstract. Why should I have to define a class/object system inside a domain-specific language inside Ruby, when I have Ruby itself? What I mean is, I don't think systems configuration engineers think in terms of inheritance, they think in terms of processes and ports and configuration strings and policies. I get a bad feeling whenever there is a keyword 'class' intended for downstream users.

Friday, May 12, 2006

Too many things

Recompiling for 64-bit architecture.Performance testing.Installing application monitoring system at the data center. (wishing centos had a newer Ruby; have to install via rpm ick)Bug-a-thon #2.Company going to MI-III.Going to Santa Cruz for birthday #31.

The web site (using Camping) is still less than 200 lines. sc_poller.rb gets metrics from machines. Metrics.rb is a little large, but contains the code generation code and generous comments in case I get hit by a bus and someone needs to read Ruby for the first time. ScMetrics.rb is where I use the code generation and contains the graph definitions; it's the file that tells me how productive I am, since if I want to add a new kind of graph I should only have to add a new definition to this file. 62 lines isn't bad for 10 graph definitions.

Tuesday, May 09, 2006

Today is Bug-a-thon day

Today is a Sharpcast Bug-a-thon day, where we take a release candidate and play with it, that is, we try to break it.

I'm anxious to see how all the pieces--desktop, mobile, and web--fit together for this release, and of course what kind of graphs my monitoring system pumps out when we're using the app simultaneously.

Monday, May 08, 2006

Grokking Ruby metaprogramming

I finally grok metaprogramming in Ruby and am happily generating methods into my subclasses. The trick I had to realize is that I need to view the generated methods as template methods available to "normal" methods. For example, if I have a graph method, it can call a generated filter method to filter what to graph. My monitoring system for the backend of Sharpcast is so much cleaner now.

Another way of describing Ruby metaprogramming--one of many styles--is that you avoid the cost of overriding methods in subclasses by generating the methods you want from the base class into the subclass.

Saturday, May 06, 2006

One reason I like my job

This week I've been writing monitoring and analysis tools in Ruby, adding features and fixing bugs in C++, and reviewing Java APIs. Being able to code in the most appropriate language, using the features of those particular languages, is one reason I really like my job at Sharpcast.

Thursday, May 04, 2006

Camping and microframeworks

I'm loving Camping, a web framework that's 4k in size written in Ruby. I just learned it yesterday. All I need is a simple dynamic web site and I can wrote the whole thing in--let me look--146 lines with comments.

It's great because it's set up to be URL/controller-friendly. What do I mean by that? Most web frameworks force you into some limited URL scheme. Especially Java servlet containers. But I love the REST style and want my URLs to name resources, not actions. (Use HTTP people!)

Boiled down to the actual program, this means that URLs need to map to model objects, the M in MVC. In Camping, you do this: