Uncategorized Posts

Ruby: The Unit Test-Friendly Language

Accelerate your tests with test doubles

Let’s say you have a Ruby class that retrieves the contents of web pages, and you need to write a unit test for it…

You’ve tested the get_response method, and now you need to test get_body. You’re using MiniTest, a unit testing framework that comes standard with Ruby.

You create a Spider instance, assign it a page to retrieve, and at the end of the test, assert that the HTTP response matches your expected value. Simple enough.

Two problems

But there’s two problems with this test:

  • Your Spider instance is making a real network request for the page, slowing the test and incurring network overhead for both you and the host you visit.
  • The page could easily change on the remote side. You can use the current page contents in the test assertion, but it might need to be changed in the future.

In fact, the latter issue is causing your test to fail right now, because the real page doesn’t match the simplified HTML in your test.

Read more…

Comment |

The Essence of Feedback Control

Pick your auto-scaling metrics wisely

Centrifugal_governorA while back, I wrote up some notes on the use of feedback control in auto-scaling server instances in a data center. Afterwards, a reader contacted me to ask whether the article didn’t “boil down to ‘pick your auto-scaling metrics wisely’?”

That’s exactly right!

Feedback control indeed “boils down” to picking the appropriate metric when making decisions. The whole idea behind feedback control is to base actions on the actual behavior (the “output”) of the system, and not merely on its operating conditions (the “input”). Conceptually, that’s all there is to it.

This is nevertheless a big deal, for two reasons:

Read more…

Comment |

Is the Jump Box Obsolete?

Security in cloud environments better enhanced in other ways

With compliance becoming an ever-increasing priority and hybrid infrastructures becoming the norm, many traditional IT practices must evolve or die. Perhaps a widely used practice that hasn’t kept up with the evolution of compliance requirements in increasingly hybrid environments is the jump server, often called the jump box.

The original theory for jump boxes made a lot of sense. Set up a jump box as a bastion host inside of your environment that everybody logs into and then you can “jump” to any of the other boxes or servers. The jump box would be a heavily fortified gatekeeper, ensuring that only the correct users could pass it. Audit controls would be placed on the jump box to track all user activity. For those that wanted to level up, multi-factor authentication could be installed at the jump box to make it harder for an attacker to leverage stolen credentials.

Read more…

Comment |

Snow and Fire Make Light

Ice lanterns give you a reason to look forward to the cold

A few years ago, muttering about how incapable I was of creating anything beautiful, I decided to try something that seemed simple but different. I’d seen candles lighting up the winter night in containers of ice, and remembered how the candles’ movement combined with the variations in the ice to make something ever-changing and unique.

Glowing lantern

I ordered some star-shaped ice lantern molds, and set about doing something fun with the Upstate New York winter. They were a little smaller than I expected, but even my initial experiments turned out well. With a votive candle inside, they were easily visible from both my house and the road, flickering and different from the LED lights on the house.

Read more…

Comment: 1 |

Wearable computing and automation

The Jawbone UP shows the promise available in all kinds of wearable sensors.

In a recent conversation, I described my phone as “everything that Compaq marketing promised the iPAQ was going to be.” It was the first device I really carried around and used as an extension of my normal computing activities. Of course, everything I did on the iPAQ can be done much more easily on a smartphone these days, so my iPAQ sits in a closet, hoping that one day I might notice and run Linux on it.

In the decade and a half since the iPAQ hit the market, battery capacity has improved and power consumption has gone down for many types of computing devices. In the Wi-Fi arena, we’ve turned phones into sensors to track motion throughout public spaces, and, in essence, “outsourced” the sensor to individual customers.

Phones, however, are relatively large devices, and the I/O capabilities of the phone aren’t needed in most sensor operations. A smartphone today can measure motion and acceleration, and even position through GPS. However, in many cases, display isn’t needed on the sensor itself, and the data to be collected might need another type of sensor. Many inexpensive sensors are available today to measure temperature, humidity, or even air quality. By moving the I/O from the sensor itself onto a centralized device, the battery power can be devoted almost entirely to collecting data.

Read more…

Comment |

The new stage of system monitoring is better integrated

Current tools make collection and visualization easier but don't reduce work

New tools are raining down on system administrators these days, attacking the “monitoring sucks” theme that was pervasive just a year ago. The new tools–both open source and commercial–may be more flexible and lightweight than earlier ones, as well as more suited for the kaleidoscopic churn of servers in the cloud, making it easier to log events and visualize them. But I look for more: a new level of data integration. What if the monitoring tools for different components could send messages to each other and take over from the administrator the job of tracing causes for events?

Read more…

Comments: 2 |

Dealing with Data in the Hadoop Ecosystem

Hadoop, Sqoop, and ZooKeeper

Kathleen Ting (@kate_ting), Technical Account Manager at Cloudera, and our own Andy Oram (@praxagora) sat down to discuss how to work with structured and unstructured data as well as how to keep a system up and running that is crunching that data.

Key highlights include:

  • Misconfigurations consist of almost half of the support issues that the team at Cloudera is seeing [Discussed at 0:22]
  • ZooKeeper, the canary in the Hadoop coal mine [Discussed at 1:10]
  • Leaky clients are often a problem ZooKeeper detects [Discussed at 2:10]
  • Sqoop is a bulk data transfer tool [Discussed at 2:47]
  • Sqoop helps to bring together structured and unstructured data [Discussed at 3:50]
  • ZooKeep is not for storage, but coordination, reliability, availability [Discussed at 4:44]

You can view the full interview here:

Read more…

Comment |

OpenStack release offers more flexibility and aids to performance

The Havana release features metering and orchestration

I talked this week to Jonathan Bryce and Mark Collier of OpenStack to look at the motivations behind the enhancements in the Havana release announced today. We focused on the main event–official support for the Ceilometer metering/monitoring project and the Heat orchestration project–but covered a few small bullet items as well.

Read more…

Comment: 1 |

Cultivate and Grow Your Following

How to use SlideShare presentations for more than public speaking

For years, PowerPoint slidedecks dominated boardrooms and marketing meetings for companies around the globe. With the introduction of SlideShare six years ago, a whole new platform appeared, and with it the opportunity to share slideshows in a new way. Now, technologists, programmers and developers are using slidedecks to collaborate, demonstrate their professional knowledge, and move quickly in an open, agile workplace. For example, you can:

  • connect with other professionals who are working on similar projects.
  • quickly learn what is being presented at industry conferences.
  • identify others who are working on technologies and projects that you’re interested in.
  • learn how companies and organizations are using specific technologies, and follow their progress.

Read more…

Comment |

The Open Compute Project

You Are Invited to Optimize Computer Infrastructure

Jay Parikh (@jayparikh) is VP Infrastructure, Facebook. We talk about where The Open Compute Project has been and where it is going! For more information check out The Open Compute Project website.

Key highlights include:

  • Find out about the Open Compute Project [Discussed at 0:13]
  • It’s all about open hardware [Discussed at 1:10]
  • Facebook data centers have been optimized [Discussed at 2:12]
  • How do you get involved? [Discussed at 3:33]

You can view the full interview here:

Read more…

Comment |