goldb.org home

AS OF MAY 2008, THIS BLOG IS NO LONGER BEING UPDATED.
Visit the new blog at: http://coreygoldberg.blogspot.com



 Wednesday, August 15, 2007

Good Riddance To SCO - Crushed On Wall Street

Earlier this week, SCO finally lost the infamous Linux copyright infringement case against IBM.  The judge ruled Unix copyrights belong to Novell, not SCO.  A lot of people have forgotten about this case; but when it was originally filed, it really spooked a lot of Free software developers and Linux advocates.

After the ruling, Wall Street punished SCO's stock price accordingly.

5-Day stock price chart for SCOX:

SCO Stock Chart

Ouch.  Decimated.  I'm actually surprised it didn't get hammered more... Time to short this rag?

#    Comments [0] |
 Wednesday, August 08, 2007

Pylot - Dev Update #5 - Web Performance/Load Test Tool (Graphs With MatPlotlib)

We performance practioners love our graphs!  Visualizing data is helpful in analyzing performance results.  Sometimes a quick glance at a graph provides better understanding than a mound of raw or summarized data.  Pylot's Results Reporting feature creates graphs of response times (latency) and Throughput.

For the graphing toolkit, Pylot uses Matplotlib to produce fancy graphs like these:

python matplotlib line graph

Matplotlib allows you to graph data from Python. Here is a simple script that gives a glimpse of how a line/marker graph is created as a png image:


#!/usr/bin/env python

from pylab import * # Matplotlib

def main():
# sequence of data points to graph (x, y coordinates)
points = [(1, 3), (2, 6), (3, 2), (4, 5)]
graph(points)


def graph(points):
fig = figure(figsize=(6, 2)) # image dimensions
ax = fig.add_subplot(111)
ax.grid(True, color='#666666')
xticks(size='x-small')
yticks(size='x-small')
x_seq = [item[0] for item in points]
y_seq = [item[1] for item in points]
ax.plot(x_seq, y_seq,
color='blue', linestyle='-', linewidth=1.0, marker='o',
markeredgecolor='blue', markerfacecolor='yellow', markersize=2.0)
savefig('graph.png')


if __name__ == '__main__':
main()

The output looks like this:

pylot matplotlib latency graph

Related:

#    Comments [0] |
 Friday, July 27, 2007

Recommended Reading For Learning Python

I have the opportunity to spread Python to some junior/newbie programmers. In doing so, I wanted to compile a concise list of reccomended learning materials. The intended audience is someone who has a basic familiarity with programming but no specific Python experience.

There are a ton of books and online materials available, but where should you start? Here is my very brief list:

First Book:

Python Tutorials Online:

#    Comments [5] |

C# - Simple TCP Server

Most of network programming I do is Web/HTTP oriented. So it has been a while since I had to work with TCP and Socket programming directly. Yesterday I needed to write a quick TCP Server. C# and .NET made this really easy to do:


using System;
using System.Text;
using System.Net;
using System.Net.Sockets;

public class TCPServer
{
    private static int port = 8001;

    public static void Main()
    {
        IPAddress ipAddress = IPAddress.Any;
        TcpListener listener = new TcpListener(ipAddress, port);
        listener.Start();
        Console.WriteLine("Server is running");
        Console.WriteLine("Listening on port " + port);
        Console.WriteLine("Waiting for connections...");
        while (true)
        {
            Socket s = listener.AcceptSocket();
            Console.WriteLine("Connection accepted from " + s.RemoteEndPoint);
            byte[] b = new byte[65535];
            int k = s.Receive(b);
            Console.WriteLine("Received:");
            for (int i = 0; i < k; i++)
                Console.Write(Convert.ToChar(b[i]));
            ASCIIEncoding enc = new ASCIIEncoding();
            s.Send(enc.GetBytes("Server responded"));
            Console.WriteLine("\nSent Response");
            s.Close();
    }
}

#    Comments [0] |
 Thursday, July 26, 2007

Microsoft - Patents and Open Source

Microsoft launched a new site which is intended to be the "gateway for information about open source engagements and activities across Microsoft."

From the FAQ:

"What is the Microsoft position on intellectual property (IP) and open source?

Intellectual property (IP) serves a vital role in maintaining a healthy cycle of innovation in the IT industry. IP concepts—including copyright, trademark, patent, or public domain—are useful for developers to define terms of use that enable their project or business to thrive, regardless of what development model they choose."

Sorry, but patents do *not* "serve a vital role in maintaining a healthy cycle of innovation in the IT industry".  Restricting ideas actually does the exact opposite.

So... I'm glad to see Microsoft taking steps towards Free software, but as of now they still don't really "get it".

#    Comments [3] |

highscalability.com - Building Bigger, Faster, More Reliable Web Sites

I stumbled across this site yesterday:  highscalability.com

"We started High Scalability to help you build successful scalable websites. This site tries to bring together all the lore, art, science, practice, and experience of building scalable websites into one place so you can learn how to build your system with confidence. Hopefully this site will move you further and faster along the learning curve of success."

This is really cool site/blog about building scalable architectures.  It contains lots of good info and overviews of some of the larger distributed systems on the net.  Definitely a regular stop for me.

#    Comments [0] |
 Wednesday, July 25, 2007

Google Architecture - King of Scalability

Awesome technical overview of Google's inner workings:

Google Architecture

"Google is the King of scalability. Everyone knows Google for their large, sophisticated, and fast searching, but they don't just shine in search. Their platform approach to building scalable applications allows them to roll out internet scale applications at an alarmingly high competition crushing rate. Their goal is always to build a higher performing higher scaling infrastructure to support their products. How do they do that?"

... a breakdown of Google's massive highly scalable architecture.
This is modern distributed computing at its finest.

#    Comments [0] |
 Tuesday, July 24, 2007

Pylot - Dev Update #4 - Web Performance/Load Test Tool (New Name and Defining Test Cases)

PyLT has been renamed to Pylot (some sort of abbreviation for "Python Load Test")

I realized that having a pronounceable name for a piece of software is pretty important :)

So...
As I develop my load test tool, I need a way to define test cases.  Here is my first attempt:


What Is A Pylot Test Case?

You must declare your test cases in an XML file. This is the format that the test engine understands. Editing XML may seem natural to some people, but awkward to others. The nice thing about this structure is that it will be very easy to create a more friendly user interface [sometime in the future] for defining test cases.

A test case is defined using the following syntax. Only the URL element is required.

<case>
<url>URL</url>
<method>HTTP METHOD</method>
<body>REQUEST BODY CONTENT</body>
<add_header>ADDITIONAL HTTP HEADER</add_header>
<verify>STRING OR REGULAR EXPRESSION</verify>
<verify_negative>STRING OR REGULAR EXPRESSION</verify_negative>
</case>

Below is an example of the simplest possible test case file. It contains a single test case which will be executed continuously during the test run. The test case contains a URL for the service under test. Since no method or body defined, it will default to sending an HTTP GET to this resource. Since no verifications are defined, it will pass/fail the test case based on the HTTP status code it receives (pass if status is < 400).

<testcases>
<case>
<url>http://www.example.com/foo</url>
</case>
</testcases>

Related:

#    Comments [0] |
 Thursday, July 19, 2007

Something I Need To Remember...

people are more important than technology
#    Comments [3] |
 Friday, June 29, 2007

PyLT - Dev Update #3 - Web Performance/Load Test Tool

(Update: PyLT has been renamed to Pylot)

(PyLT is the open source web performance/load test tool that I am developing)

A quick update on PyLT development...

The load generating engine is looking pretty solid and seems to work really well so far. It uses threading for concurrency and seems to scale well (though I haven't put it through its paces enough yet).

The GUI is evolving more and starting to look like a real performance/load testing tool:

This is my first project using wxWidgets and wxPython.  I am finding it to be very powerful and relatively straight forward to design nice user interfaces.  However, this is a big jump for me.  The past few years I have mostly done web programming and work with distributed systems.  It took a bit to get my head back into traditional GUI application development and event-driven programming

More to come...

Related:

#    Comments [0] |

C# - Convert ASCII String To Hex

C# method to convert an ascii string to hex:

public string ConvertToHex(string asciiString)
{
    string hex = "";
    foreach (char c in asciiString)
    {
        int tmp = c;
        hex += String.Format("{0:x2}", (uint)System.Convert.ToUInt32(tmp.ToString()));
    }
    return hex;
}

#    Comments [0] |
 Wednesday, June 27, 2007

Launch of GNU GPLv3

It's Official...

From the FSF press release:

"On Friday, June 29, at 12 noon (EDT), the Free Software Foundation will officially release the GNU GPL version 3.  Please join us in celebration as we bring to a close eighteen months of public outreach and comment, in revision of the world's most popular free software license."

GPLv3 has been a long time coming.  This is a big moment in Free Software.

#    Comments [0] |
 Friday, June 22, 2007

OSI Standing Up To Those Flagrantly Abusing The Term 'Open Source'

Michael Tiemann (President of the Open Source Initiative):

"When is the OSI going to stand up to companies who are flagrantly abusing the term 'open source'?"
The answer is:  starting today.

Read more:  Will The Real Open Source CRM Please Stand Up?

#    Comments [0] |
 Friday, June 15, 2007

PyLT - Dev Update #2 - Web Performance/Load Test Tool

(Update: PyLT has been renamed to Pylot)

(PyLT is the web performance/load test tool that I am developing)

A quick update on PyLT development...

This week I rewrote the GUI using wxPython.  It still needs a *lot* of work, but here is what it's starting to look like:


Related:
PyLT - Dev Update #1 - Web Performance/Load Test Tool
PyLT - Scratching My Itch - New Web Performance/Load Test Tool (Open Source)

#    Comments [0] |
 Tuesday, June 12, 2007

Does Python Meet The Definitions Of An OO Programming Language?

Who cares.  After all, we are all consenting adults here.  Python is most definitely a multi-paradigm language.  This flexibility is one of Python's great features.

Tim Peters responding to accusations of Python not being a "true OO programming language" (1998):

Jeff:
> So how does Python implement encapsulation? From
> what I have seen it does not, and therefore may contain
> many OO concepts, but cannot be considered a
> true OO programming language.

Tim Peters:
Indeed, and because it doesn't support closures, it's not a true
functional programming language either. And because you have to import
all sorts of modules to do the simplest things (e.g., regular
expressions), neither is it a true scripting language. Indeed, because
it doesn't support labeled break or continue statements, it's not even
a true structured programming language.
#    Comments [0] |
 Monday, June 11, 2007

PyLT - Dev Update #1 - Web Performance/Load Test Tool

(Update: PyLT has been renamed to Pylot)

A quick update on PyLT development...

I have a working version of the guts of my tool (the multi-threaded load generator).  I have now started working on the user interface.  My initial idea was to use Tk for the GUI Toolkit.  I started developing a minimal GUI and quickly realized I need a Toolkit more powerful than Tk.

My original justification for using Tkinter (from blog comments):

"I will probably eventually move to a richer toolkit (like wxPython) if I take this thing far. For right now, Tk works. It comes distributed with core python, it's super fast and light, it's easy to use, and I know it pretty well. Though it looks like crap and is limited in many ways."

As of today I am rewriting the GUI with wxPython, which uses the wxWidgets Toolkit.  This should give me the ability to create a rich cross-platform UI for my tool.

[For posterity] Here is what the original prototype of the Tk UI looked like:


R.I.P. Tk... Hello wxWidgets


Related:
PyLT - Scratching My Itch - New Web Performance/Load Test Tool (Open Source) 

#    Comments [2] |
 Friday, June 01, 2007

PyLT - Scratching My Itch - New Web Performance/Load Test Tool (Open Source)

(Update: PyLT has been renamed to Pylot)

I have started development on a new web performance/load testing tool.  It is targeted at testing Web Services.


Here is some Q&A with myself:


You know you are reinventing the wheel, right?

Yes, I know.  There are already open source web load testing tools available (OpenSTA, JMeter, Grinder, WebLOAD, etc).  I have used all of these as well as proprietary tools for years.  I am a performance engineer and I feel like I need a tool set that I am intimately familiar with.  I need the ability to easily alter and tweak the tool at will.  I don't have the time, budget, or patience enough to wait on vendors when I need something.  I also want a tool that is fun to hack and adapt.  For this, I need to understand the code base deeply.

What language are you using?

Python.  The initial GUI uses Tk, but this may be changed down the road. I use Python's threading module for concurrency. If this doesn't scale well enough, I will be exploring other models of concurrency (perhaps generator based coroutines).

Why do you think you can write a tool like this?

I have worked in performance testing for nearly 10 years.  I have written many tools that work with various protocols to do distributed load generation and testing.  Creating a simple HTTP load generator is sort of my Hello World 2.0 for each language I try (I have written these from scratch in Python, Perl, Java, and C#).  This tool takes that basic concept and organizes it into a robust application.

Will it be Free and Open Source?

Of course!  Licensed under GNU GPL.



For an early look, check out the source repository at:  http://pylt.googlecode.com/svn/trunk

More details to come.

-Corey

#    Comments [6] |
 Wednesday, May 30, 2007

goldb.org - OS Breakdown - Last 30 Days

Operating Systems of visitors to my website and blog over the past 30 days.
(Results with less than 1% have been removed)

#    Comments [2] |
 Tuesday, May 29, 2007

Simple Python Web Server Example

Note to self...
use this:

Roll your own server in 50 lines of Python code (by Muharem Hrnjadovic):

"Just in case you wondered why there are so many frameworks in Python land, here’s a basic server (including a request dispatch mechanism) in only 50 lines of code."

Why *not* add a server interface to every tool I write?  :)

#    Comments [0] |

WebInject and op5 Monitor for Advanced Web Site Monitoring

One cool thing about developing Open Source software is seeing where people end up using your software. I have seen my WebInject test tool show up in various places for various uses.

The most recent example of this come from op5 AB:

"op5 is a leading product developer of systems and network monitoring and management software. Our aim is to give our customers an increased and measurable availability to the IT system – both in terms of quality and quantity. Our products are op5 Monitor, op5 Statistics and op5 LogServer."

op5 Monitor (Linux Open Source Awards: Best Open Source Application 2006) is their network and application monitoring solution:

"op5 Monitor is a system that monitors the whole network. op5 Monitor is unique in its flexibility and it can monitor all net connected components from servers, routers and printers to individual processors, for example mail services, web servers and virus programmes. All these functions are handled by a web – browser. The system can handle a net with a several thousand units."

Carl Ekman wrote a nice paper explaining how to use WebInject as an intelligent agent/plugin for use in web application monitoring:
WebInject and op5 Monitor - Setting up advanced website monitoring with WebInject (PDF)

The paper serves a nice example and tutorial for using WebInject as a monitoring plugin (It can be used in a similar fashion with Nagios also):

"Most op5 Monitor users have detailed monitoring of all inhouse applications and servers, but sometimes not even that is enough. What if something unforeseen happens that makes dynamically generated content spout jibberish to thousands of visitors without you even knowing about it?

With WebInject you can monitor the actual content of the web pages, and you can perform simulated user actions such as logging in and checking an account balance. If a search string is not present, an error message occurs or a link is broken, you can get an alert with a customized, descriptive message."
#    Comments [0] |
 Sunday, May 27, 2007

Python Multitask - Generator-based Multitasking and Asynchronous I/O

This looks cool:  http://o2s.csail.mit.edu/o2s-wiki/multitask
"multitask allows Python programs to use generators (aka coroutines) to perform cooperative multitasking and asynchronous I/O. Applications written using multitask consist of a set of cooperating tasks that yield to a shared task manager whenever they perform a (potentially) blocking operation, such as I/O on a socket or getting data from a queue. The task manager temporarily suspends the task (allowing other tasks to run in the meantime) and then restarts it when the blocking operation is complete. Such an approach is suitable for applications that would otherwise have to use select() and/or multiple threads to achieve concurrency."


It is built on some of the new generator features in Python 2.5.  I wrote about this a few months back and actually tried to implement a version of a coroutine scheduler myself.  Glad to see someone packaged up a nice version I can use :)


#    Comments [0] |
 Wednesday, May 23, 2007

StockQuote Google Gadget - Usage Stats

A few months ago I deployed my StockQuote Google Gadget, which is used for retrieving stock quotes and daily price graphs.

Behind the gadget is a remote .NET/C# service I created which scrapes stock quotes and charts from Google Finance.

You can see it and play with the demo: cgoldberg.googlepages.com

- Add my gadget to your Google Personalized Homepage
- Add my gadget to your own web page

I have been logging usage stats; just to see how many people are using it and how many transactions it is doing. Stats have been collected for about 4 months:

12000 transactions per day and growing fast.. yikes.


Update: My StockQuote gadget is no longer in service.  I Received a takedown notice from Google Finance on 05/23/2007.   umm...  sorta saw that comin' :)

#    Comments [0] |
 Monday, May 21, 2007

Zed Shaw's Statistics Rant

Programmers Need To Learn Statistics Or I Will Kill Them All

Zed Shaw:

"I have a major pet peeve that I need to confess. I go insane when I hear programmers talking about statistics like they know sh-t when it’s clearly obvious they do not. I’ve been studying it for years and years and still don’t think I know anything. This article is my call for all programmers to finally learn enough about statistics to at least know they don’t know sh-t."
#    Comments [1] |
 Thursday, May 17, 2007

RESTful Web Services - 10 Years of 'Programmable Web' Books

I just got the RESTful Web Services book (Leonard Richardson & Sam Ruby, O'Reilly, 2007) in the mail today.  I've only read the beginning, but so far it is great.  In fact, it brings me back to when I first started working with the "programmable web".  I got into the programmable web back when the web was only a few years old.  I spent years doing performance/scalability testing and tuning for large Web 1.0 applications and bizarre custom Web API's (think huge financial services rushing to get online).  Building tools to run realistic workloads through a system involves writing custom clients to simulate real user/browser interaction.  This is pretty ugly stuff when you are dealing with an application that was designed with only humans in mind (AKA all).  It involves lots of HTTP protocol level work.. screen scraping.. protocol sniffing and analyzing.. requests.. header mangling.. cookie handling.. redirects.. authentication.. session information parsing.. etc, etc.

Application simulation is pretty messy work.  There is no simple API to hide behind; you had to figure out what the API was for yourself.  See.. *every* web application has an API.  Though it might have been designed by accident.  This allowed me to see first hand how developers and frameworks butchered the use of the "Web" as a platform.  Staring at naked HTTP let me see every little bit of the hairball underneath.  Alas, any standardization around web services (or the concept to be officially named) was far off.

A friend (bearded Perl hacker) let me borrow a book to show me how Perl can do this cool web stuff:  Web Client Programming with Perl (Clinton Wong, O'Reilly, 1997).  This book helped me build my first web clients to do application simulation and testing.  There wasn't a ton of documentation at the time to do this sort of thing, so i relied heavily on this book.

So now.. 10 years later..  the Web has changed..  it has morphed into *the* distributed platform..  it is becoming organized.

As I flip through Restful Web Services, it all just looks right..  REST looks right..   It is simple..  it is HTTP..  it is all the guts I already know.  It almost feels like a sequel to my old favorite:

I have traded Perl for Python as my preferred scripting language the past few years, but I am still building simulators, web clients, and virtual users. I am excited to work on some new stuff in this area.

#    Comments [0] |
 Wednesday, May 16, 2007

WebInject - Open Source Web Service Testing Tool Gets High Marks

InfoWorld article:

Three open source Web service testing tools get high marks

Rick Grehan of InfoWorld reviewed 3 popular open source tools for testing web services.  Rick is a contributing editor of the InfoWorld Test Center.  One of the tools he reviewed was WebInject (which I wrote).

"In this roundup, I examined three tools that purport to verify that your Web services do what they are supposed to do, that they resist graceless failure, and (in some cases) that they conduct themselves with efficiency. The tools are soapUI, TestMaker, and WebInject. All are open source, and are available for free download and incorporation into your next Web services project."
My tool (WebInject) scored pretty well in the comparison.

From the article:

WebInject

WebInject is a super-lightweight testing tool that can automate the testing of both Web services and Web applications. In fact, WebInject's ability to test XML/SOAP Web services appears to be a recent addition to the tool, as earlier versions could not readily handle the SOAP protocol.

Written in Perl, WebInject is primarily a command-line tool, though its author provides a thin Perl/Tk user interface that at least simplifies the execution of tests for those unwilling to spend too much time at the command prompt. If you're not familiar with Perl, don't panic. WebInject is built so that you can construct your tests without having to touch so much as a byte of Perl code.

WebInject is really an execution and reporting engine. Unlike the other tools, it has no IDE-style user interface, so tests must be written in an editor outside of the WebInject UI. This gives WebInject a less professional feel, but doesn't hamper the tool. I envision users of WebInject having directories filled with text files of various test “templates.” To add a new test case, the user just pops open his or her favorite editor, does some cutting, some pasting, and a bit of tweaking to alter the template to fit the specific circumstance, and ba-ding!, you've got a new test case.

...

In essence, a WebInject “project” is nothing more than an XML file filled with a set of elements strung one after the other. WebInject's simple structure lets you build tests with amazing rapidity. You must, however, have a moderately good understanding of the mechanics of SOAP protocols as well as a tool that lets you generate and capture HTTP/SOAP requests and responses. You'll need the requests to build the POST body and the responses so that you can create proper “verifypositive” and “verifynegative” regular expressions to check for success or failure. I used the Web Service Toolkit add-on for Eclipse to grab requests and responses for WebInject; once I had gotten the hang of it, I fell easily into the groove of building test cases.


Criteria Score Weight
Documentation 8 20%
Features 8 20%
Scalability 8 20%
Ease-of-use 8 15%
Portability 9 15%
Value 9 10%

Review Score:
Very Good 8.3

Cost:
Free download - open source

Platforms
Any platform that runs Perl or has a Perl interpreter installed

Bottom Line:
Much less feature-rich than the other tools, the lightweight WebInject nonetheless bolts out of the starting gate. If you need testing that will be off the ground and flying in minutes, reach for WebInject. On the other hand, it has far fewer capabilities than the other two products in this test, and unless you want to hack the Perl code, WebInject's feature set is pretty much what you install.


visit www.webInject.org
for more of my tools, visit: www.goldb.org

#    Comments [0] |