SoapUI guys are releasing an open-source load testing tool

June 15th 2010 · Java , Dev Trends

att-1000

I just finished watching a video conference put on by eviware (pronounced ev-ee-ware, surprisingly to me). eviware are the guys who created soapUI. soapUI is a Java-based tool for interacting with, and testing, web services.

soapUI has long had support for basic load testing of web services, but eviware went and created a brand new tool for load testing, called loadUI. Not just load testing of web services, but load testing in general. They’re planning on releasing it on June 21st as an open source beta. Like soapUI it will probably have both a free and commercial (“pro”) version.

The tool looks pretty interesting. It doesn’t look like it will be any immediate danger to established tools like LoadRunner, but the feature set is already useful.

The UI is the first thing that strikes you. They wrote it in JavaFX and made it look like a patch panel. I don’t have a screen shot yet of the application, but here’s a shot from the Yahoo Pipes application which has a similar UI paradigm.

att-1001

You drag and drop components onto the project canvas and connect them with wires. They have components to generate load, process statistics, etc. You also drag and drop testing servers. So you can drag new test generators to new servers. What’s especially cool is that it’s all live. During a load test you can add or subtract servers, components, etc. The result is the ability to fine tune your test and then save it for later, repeatable, runs.

They said in the video conference that loadUI can be extended by creating your own components.

The application will work anywhere that JavaFX does but there are issues with the Mac implementation. I have no idea if there are issues with the Linux implementation as well. It appears that Windows is the primary development platform for eviware so it should run well there.

I’ll take a look at loadUI once it’s released and see how useful it is. If nothing else, given its free version, it should be the go-to tool for lightweight load testing. It’s definitely an improvement on ab (Apache Bench).


Accessing REST services from Spring 3

June 14th 2010 · Java

1

If you’re using Spring 3 and want to access REST-based services, then you’re in luck because it’s extremely easy.

Let’s say you wanted to pull content from an Alfresco server. A simple way to do that would be to use the direct download URL. But that requires a login ticket. Which you get using a REST call.

In order to generate a login ticket, you call the Alfresco login service with a userid and password:

/alfresco/service/api/login?u=userid&pw=password

Assuming the userid and password are correct, Alfresco will respond back with this simple XML:

<?xml version="1.0" encoding="UTF-8"?>
<ticket>TICKET_18d49dbd5de400c3fa1254b46e46ac51fbd0934e</ticket>

Using Spring it becomes trivial to login and get the ticket:

RestTemplate rest = new RestTemplate();

Map<String, String> params = new HashMap<String, String>();
params.put("user", apiUser);
params.put("password", apiPassword);
Source result = rest.getForObject("http://localhost:8080/service/api/login?u={user}&pw={password}", Source.class, params);

XPathOperations xpath = new Jaxp13XPathTemplate();
return xpath.evaluateAsString("//ticket", result);

This deserves a little explanation. The RestTemplate was introduced in Spring 3 to give REST access the same support as JDBC. It serves as a wrapper to hide all the details in accessing REST resources, including opening and closing connection objects and converting responses to Java objects.

Just like Spring JDBC templates, you can pass a Map of keywords and values. You can also provide parameters positionally, getForObject("url", Source.class, param1, param2, param3, ...).

The Source.class parameter is the return type. The RestTemplate will invoke a HtmlMessageConverter to transform the content returned by the REST call into a Java object.

In the example, Spring will use the pre-registered SourceHttpMessageConverter to treat the stream returned by the REST call as a javax.xml.transform.Source object. You can register custom converters for your own objects with the RestTemplate if you like.

Once you have the Source object, you can operate on it using Spring XML. In this case, we instantiate a concrete implementation of the XPathOperations object, Jaxp13XPathTemplate. XPathOperations is another Spring template object (XPathTemplate). You can use it to map XML into objects. In our case, we use XPath to pull out the contents of the <ticket> tag as a String using a convenience method – xpath.evaluateAsString("//ticket", result).

Once you have the ticket, it’s a simple matter to perform the exact same process using the Alfresco direct download URL:

/alfresco/download/direct?path=xyz&ticket=ticketvalue

If you’re pulling out HTML or text content, you can use the default StringHttpMessageConverter to pull out the file contents directly.

One last wrinkle if you’re implementing this in your own code. The Spring XML library is part of Spring WS, not part of the base Spring package. So when you add it to your Maven POM, it’ll look like this:

<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-xml</artifactId>
    <version>${spring-xml.version}</version>
</dependency>

Safari 5 is out - it's a catch-up to Chrome in most respects

June 8th 2010 · Mac Computer , Dev Trends

Apple released Safari 5 in conjunction with their WWDC conference this week. In most respects, Safari 5 is a catch-up to Chrome. Apple’s benchmarks put it very slightly faster then Chrome.

In addition, Safari 5 is now on par with Chrome for HTML5 support. Both browsers get virtually identical scores in the HTML5 support test.

The biggest new feature, browser extensions, is also a catch-up to Chrome. If you can believe it, Safari has never had a formal browser extension mechanism. Every Safari extension/add-on to this point, has exploited the ability of Objective-C to inject code into a running program.

Safari extensions look very much like Chrome extensions. They are pure JavaScript, HTML and CSS. They are also cryptographically signed. Some Mac developers got early previews of this release and had demo extensions ready.

You can expect the usual flood of extensions as people port their favorites over from Firefox and Chrome.

There are also a few additional items like improved web development tools, something similar to the Google smart bar (just incorporating history), Bing search support and improved tab handling.

The only real surprise was a feature called Safari Reader. When I first heard about it I thought it was another RSS reader. It’s not. It’s an alternative view of a web page that removes everything from the page except the article you’re reading.

It uses some unknown heuristics to determine when you’re reading an article. When it determines you are, it puts a Reader button in the address bar.

2.

It will take a web page:

3

And turn it into a reader view:

4

It’s even smart enough to stitch multiple pages together into one article. I’m not sure yet how useful this feature will turn out to be, or whether it’s just a gimmick.

If you want to know more, Apple has a web page covering the new features of Safari.

The big Chrome feature that Safari doesn’t yet have is sandboxing. Chrome runs each web page in a separate process that has only limited connectivity to the browser itself. It’s this sandboxing that makes Chrome so secure. The Apple Webkit team (Webkit is the browser engine that both Safari and Chrome is based on) has been working for a while on a sandbox implementation.

The difference between the Chrome implementation and the one the Webkit team is working on, is that the Webkit version is in the Webkit engine. Once it’s complete, all browsers based on Webkit will “automatically” inherit it.

Google’s sandbox is built above the Webkit layer, which is why the Webkit team didn’t want to use their implementation.


New iPhone 4 Announced

June 7th 2010 · iPhone , Dev Trends

The beginning of the Apple keynote can be summarized in one word: defensive.

Steve is upset about the app rejection complaints and about the Android market share claims. You want “un-curated” apps? Write a web app.

The rest of the announcements can be summarized like this:

  • New iPhone 4, thinner then 3GS, front-facing camera, out June 24th
  • Video chat on either front or rear camera (FaceTime)
  • HD video recording with iMovie app available for the phone
  • Camera flash and video illumination
  • Usual $199 and $299 price point
  • eBooks a big new market for Apple, coming to iPhone and iPod Touch
  • iPhone OS is now iOS. iOS 4 just went Gold Master (GM). Available June 21st.
  • iAds already has $60 million in ad commitments

Apple is now up to 5 billion apps downloaded.

In the last three years Apple has paid developers $1 billion. So Apple has made $300 million from app sales. If the average app price is $2.99 that means about 333 million of the apps were paid for. So about 7% of apps downloaded are for-pay.

There are 15,000 apps submitted each week. 95% are approved within 7 days. Of course that means that 750 are not approved each week.

Top three reasons apps are rejected

  1. Doesn’t function or do what it says it does
  2. Uses private APIs
  3. Crashes

iPhone 4 released. Looks just like the stolen prototype.

  • 24% thinner then 3GS – “thinnest smartphone on the planet”
  • Glass front and back with steel band running on the outside
  • Screen is custom “bendable” glass
  • Front and rear facing camera
  • LED camera flash on rear
  • Second mic for noise reduction
  • The steel band around the outside is a giant antenna
  • Display has four times the pixels as the 3GS – 326 pixels per inch
  • Supposedly max retina resolution is 300 pixels per inch
  • You can’t see pixels in new screen, wide viewing angle, 800:1 contrast
  • Interestingly, the iPhone 4 display has 78% of the pixels of the iPad
  • Theoretically you can’t see any increase in resolution above this
  • Uses iPad A4 chip
  • Bigger battery, better battery life – 20-40% longer
  • Added gyroscope. It’s tied into the accelerometer.
  • 5 megapixel camera – wanted better photos not more pixels
  • Kept sensor pixel size the same, switched to back-side illumination
  • Translation of above: better low-light performance
  • Records HD video – 720p at 30 frames a second
  • LED illumination for video
  • Costs $199 or $299
  • Available June 24th, pre-orders June 15th

iMove for iPhone

  • New app, iMovie for iPhone
  • Titles, clips, photos w/Ken Burns effects, transitions, music tracks
  • Video themes, geolocation, maps, etc.
  • Export to 360p, 520p and 720p

iPhone OS is now iOS.

  • Stuff covered before: multi-tasking, unified inbox, folders
  • Threaded mail, enhanced camera and photo apps, encryption
  • SSL VPN, multiple Exchange servers, wireless app distribution, remote management
  • iOS 4 goes Gold Master today. Public release on June 21st.
  • Upgrade is free

iBooks

  • Already owns 22% of the eBook market
  • Being expanded to support PDFs, bookmarks and notes
  • Being released for the iPhone and iPod Touch
  • PDF in email goes to PDF bookshelf in iBooks
  • Syncs between devices like Kindle (buy once, read on any device for free)

iAds

  • Had people working on them for 8 weeks
  • Apple keeps 40% of ad revenues
  • Ads are HTML5, fully interactive and don’t take you out of the apps
  • Already have $60 million in ad commitments for second half of 2010
  • Expect to own half of the mobile advertising space in second half of 2010

FaceTime

  • “FaceTime” video chat on either front or rear camera
  • Can switch to front or rear during video chat
  • FaceTime is wi-fi only, no setup, iPhone to iPhone only
  • FaceTime uses open standards
  • Working with carriers to get FaceTime on 3G networks

The numbers behind the AT&T pricing plans

June 3rd 2010 · Computing , Dev Trends

Opinions are great, but let’s do the math on AT&T’s new pricing structure to see what kind of a deal it really is.

AT&T claims, and it appears to be backed up by customer reports, that 68% of their smartphone users use less then 200 MB per month and 98% use less then 2 GB per month. That’s smartphone users, not the general customer base. Let’s assume that all of them are paying $30/month for their data service.

For the sake of our calculations, let’s guess that AT&T has 20 million smartphone users.

20 million x $30 = $600 million a month from data fees

So 68% of the customers could switch to the new $15/mo plan. But let’s be realistic. Many won’t. Let’s guess that about 2/3 of the eligible smartphone users will downgrade.

9 million downgraders x $15 = $135 million in lost revenue per month

Now the 30% who use between 200 MB and 2 GB can switch to the new $25/mo plan. Again, not all of them will. Let’s say that 2/3 will.

4 million downgraders x $5 = $20 million in lost revenue per month

That leaves the 2% who use above 2 GB. Let’s assume that none of them will switch to the $25/mo plan.

0 downgraders = no lost revenue

From this vastly simplified calculation it looks like AT&T’s new pricing plan will result in $155 million in lost revenue each month. And that no one will be adversely affected by it. In this rosy view the customers have a lot to look forward to.

9 million people save $180 a year
4 million people save $60 a year
7 million people see no change

But AT&T isn’t known for being generous. What they’re looking for is new subscribers and overage charges. They know that usage levels are rising and will continue to do so. They want to get in the business of having high-usage customers pay more. This will drive users to reduce usage or pay for the privilege.

What will it take to offset the $155 million in lost revenue and then add revenue? Any one of these options:

15.5 million $25 a month customers paying an overage fee
10 million $15 a month customers paying an overage fee
8 million $25 a month customers paying double overage fees
5 million $15 a month customers paying double overage fees

But, of course, it will be some combination of these. To begin with, a small percentage of the over 2 GB users will pay single, double and even triple overage fees per month. A larger percentage of the just under 2 GB users will pay a single, and rarely, a double overage fee. And an even larger percentage of under 200 MB users will pay single, double, triple and quadruple overage fees.

At the start of this new plan most people will see their bills drop. AT&T will have reduced revenues. It won’t be $155 million, thanks to overage fees, but there will be a drop. Long-term however this will result in higher revenues for AT&T. They will get more customers picking up data plans. That’s at least an additional $15 a month where they’re getting $0 a month now. And they’re setting the ground work for tiered pricing so that high-bandwidth users will pay high fees. They’re betting that this will become the accepted norm, even as bandwidth usage rises. And that’s where this is really going.


Blogging with Toto

May 25th 2010 · Ruby Language , Web

I got tired of bad Wordpress performance at Dreamhost so I started looking around for new options. I found one with Toto. Toto is a micro-blogging framework written in Ruby. It appealed to me on several fronts – it’s Ruby and I like Ruby, it’s extremely lightweight and I can easily understand and extend it.

Toto is a single Ruby file ‘toto.rb’ that sits on top of the Rack infrastructure. I played around with it and liked what I saw. From the outside it looks very similar to a Wordpress installation. URLs still look like ‘/2009/03’ and ‘/2010/04/18/my-article’. That was important to me since I wanted to seamlessly migrate from my existing Wordpress blog.

You can’t get much more lightweight then Toto. It doesn’t use a database. Comments are handled by Disqus. And each article is a single file consisting of a YAML header followed by the article text. You can read much more about it in an excellent overview article written by Dmitry Fadeyev.…

<< Previous articles
Next articles >>