Archive for Flex

AMF Stress Testing – Flex, Ruby, JMeter.

A while back I was tasked with coming up with a way to do stress testing for AMF. I looked at a bunch of tools, and a couple in particular. Those being curl-loader, httperf and JMeter. The only tool out of the box that supported “arbitrary binary support” was JMeter. AMF is sent in an HTTP request as arbitrary binary, not a regular multipart upload. Which is cool, but not many tools support that.

Anyway, I’m going to keep this short – here is a rough set of tools that will get you stress testing your AMF gateways. Make sure to read the “readme” in the zip file, this has enough instruction on the different tools, and the source for it all, so you can read through it, alter it, use it to your advantage.

Also, the capture client only works with SSR right now, but I’ve included the source for everything so you could go in and update the part that I left out which was support for Remote Object. It shouldn’t be a ton of work, sorry I couldn’t get that done.

I’ll be watching the RubyAMF mailing list for any help requests / questions about this. Hopefully this is really straight forward, and the readme does a pretty good job of explaining what’s going on with everything.

Enjoy.

Mac OS X Flash Player Switcher – Plugout Update

I just put up another version of Plugout which has one minor change for Leopard. When starting a browser from Plugout, you would get an NSQuickDrawView deprecation warning. NSQuickDrawView is part of Cocoa and has been deprecated in favor of Quartz. So, no huge changes – just some output redirects when starting the browser. You can see the output if any in ~/plugout_plugins/output

RubyAMF – Skipping 1.3.4 And Writing 1.3.5

Surprise! RubyAMF 1.3.5 is under way, and no 1.3.4 will be released.

So here’s the scoop. Aryk Grosz from MixBook contacted me about using RubyAMF and some experiences he was having. RubyAMF would start to slow down with large complex data structures even slower than WebORB depending on the size, Yikes! Aryk had put time into optimizing RubyAMF and you would not believe the results we’re getting.

I went down to Mixbook in San Jose on Sunday and spent a little time with Aryk ripping apart RubyAMF. So we’ve pretty much re-written RubyAMF, here’s a brief rundown of what’s going on.

First let’s talk restructure. We ripped out 60% of the code base which was legacy from RAMFL. I won’t go into the gory details but we’ve re-arranged a lot, changed a lot of names. For example ValueObjects are now ClassMappings. Which is more appropriate because RAMF has full class mapping support. We’ve also put an init.rb file in the plugin so all the requires get done on application startup.

There are a couple other features we’ve added to class mapping definitions, such as the :associations, :attributes, and :ignore_fields properties. The :ignore_fields is just like it sounds, for a specific class mapping you can ignore specific properties on it. You can also define a global ignore fields like so: ClassMappings.ignore_fields.

The :associations and :attributes are for performance reasons. You aren’t required to use them, but if you do it speeds up the serializer even more. We’ve also change the names of :incoming / :map_to / :o utgoing to :actionscript / :ruby.

Performance! This thing is about 5x faster. As an example, a data structure of about 1500 objects that’s used in Mixbook takes around 35 seconds with WebORB. RAMF averages 2.4 seconds. Sweet! You can even see the speed increase on one object. It’s that much faster.

We also decreased the size of the data transfer. As an example, let’s say an AMF message was 250K, it would now be about 100K. That’s a huge difference.

That’s just a small preview of what’s going on. Sorry for the inconvenience of not getting 1.3.4 done last week, but as soon as we started these changes and optimizations – 1.3.4 was obsolete.

So hats off to Aryk for the help, he did a most of the speed optimizations and has been refactoring and writing a ton for RubyAMF. Thanks for the help!

And to top it all off, RubyAMF will have it’s first “in production” customer over at MixBook. They’re working on re-factoring their rails app to use RubyAMF. Awesome!

-Aaron

New Remoting Parameter Mapping Feature

To whet your RubyAMF appetite a little more. We’ve added in a new feature that will be in 1.3.4. This new feature allows you to map incoming remoting parameters to to params[:] hash how ever you like.

As a quick example, let’s say you wanted to map the “id” property of a “User” object to the params[:id] key. Here’s how you’d do it.

Here’s an example actionscript remoting call:

 service = new RemotingService("...","UserController",3);
 service.destroy([myUser],result,fault);

And the supporting RubyAMF configuration to accomplish this mapping:

Parameter::Map.register({
 :controller => :UserController,
 :action => :destroy,
 :params => { :id => "{0}.id" }
})

This is a big improvement over the old way, which would only map the first parameter into the params[:] hash, you can decide what gets put where.

As another example. If you wanted to map the 3rd arguments “firstname” property to “params[:firstname]“. You’d do this:

AS:

 service.myaction([...,...,thirdObject],result,fault);

Config:

Parameter::Map.register({
 :controller => :UserController,
 :action => :myaction,
 :params => { :firstname => "{2}.firstname" }
})

As mentioned, this will hit in 1.3.4. Hope it’s useful :) -A

Beginners Tutorial to RubyAMF with RESTful Rails

Checkout this nice tutorial. Get started with Flex and RubyAMF! Thanks Bryan!

Development Efforts

As you’ve probably seen I’m working on finding some people for support development on RubyAMF. Quite a few people are interested with RubyAMF, and Rails 2 support and feature additions need to be done as soon as rails 2 is ready. So I’m gearing up for that hopefully with some help. There should be plenty of time for dev as Rails 2 is only in a preview release state.

Hang in everyone! I’ll officially be back from vacation on the 8th to release 1.3.4 and gear up for the next dev tasks. Additionally I don’t see any major conflicts with RubyAMF and Rails 2, as there is only one entry point into Rails (aside from the rubyamf controller).

Max Day 1 – Thanks

Just wanted to shout out to Tony Hillerson of Effective UI who did a great job at the Flex on Rails session. Unfortunately I won’t be at the wednesday session because my flight leaves at the same time. So again thanks Tony for the great job!

I met so many great people from Adobe and the different teams. Thanks to all!

Plugout – Mac OS X Plugin Switcher

It recently came to Larry and mine’s attention that there isn’t an easy way to switch plugins for OS X. Mike Chambers had put one out early last year, but is no longer valid as it was for PPC macs. The problem now with Intel macs is that if you install any flash player lower than 9, it is PPC so it won’t run if you open up the browser. Your browser will tell you that you don’t have have Flash installed.

This is easily fixed by opening “Get Info” on your browser and checking run in rosetta. But that is a little tedious to be switching back and forth.

So here’s a much more graceful commandline tool to automate this for you – Plugout. It’s a commandline tool that easliy let’s you switch to the target plugin, and restart the browser in rosetta (if necessary). It will work with any plugin. It comes with the Flash players 7-9 and Silverlight 1.0. But is easily extendable to add Quicktime, or RealPlayer, or whatever other plugin you want.

Plugout will be available as a Ruby gem shortly, and in the future I’d like to add support for remote updating of the plugins. But I’m not sure what kind of legal trouble this could cause. I’m sure I’ll be getting a letter from Adobe or Microsoft about even distributing the plugins up front. I’ll wait for a cease and desist. :)

We’re also working on GUI’s for plugout. Flash IDE and Flex Builder. And hopefully a standalone app of some sort that can be used in QA teams. For now commandline usage is simple enough for us developers. Gotta give some love to unix man.

Thanks to Larry Gordon for helping figuring out some ins and outs of how this should all work. Thanks to Larry Gordon and Alastair Green for the name plugout.

To install the tool run “sudo ./install.sh” from the commandline (inside of the plugout directory). The installer copies the plugout executable to /usr/bin and copies the plugout_plugins directory to your home directory. Refer to the homepage or ‘plugout -h’ for a how to.

Plugout Homepage

Screencast

Download it

Also a heads up – I haven’t had a chance to test this on a PPC Mac, so if anyone out there has a PPC mac and can test this all out that would be great!

Flash Player 9 For PPC Macs – Help!

I need a huge favor from someone. I need to find all the flash player 9 plugin files (/Library/Plug-Ins) For every version of flash player 9 (for PPC). The way to get all these plugins is to install players 9.0 – 9.0.60 from the archives page. After each install, go to the /Library/Plug-Ins folder and swipe the necessary flash plugins. Put them in a folder labeled 9.0.x for each version.

I can’t get them myself because I’m on an Intel mac, the PPC installers won’t install it. So please, if anyone out there has a spare 30 minutes and a PPC help me out and zip up those files on an FTP for me.

RubyAMF too Dark?

So maybe this isn’t a question you were expecting. But does anyone else have any problems with the colors / brightness on RubyAMF? This post didn’t include RubyAMF. Apparently because it’s too dark to read. Which is alright. But it makes me want to hear from more people. Should I re-skin the site to be mostly white with some red? I’m on a mac so the brightness / gamma is different and it shines for me :)

RubyAMF is getting to the point where it’s a great experience tying it in with Rails (and of course with Lite) – the fact that it works with scaffolding and in your controller with render :amf makes it a winner for me. But if people don’t use it because they can’t read the site then it’s time for an update. I love working on RubyAMF so I want everyone to have a great experience with it. Maybe this sounds weird – but I LOVE remoting. The first project I did with remoting was with MercuryCloud and Patrick Mineault. Ever since then it’s been a key part of almost every project I build. So I’m not trying to be pushy about RubyAMF at all, just know that everything I put into RubyAMF is pretty carefully thought out for performance factor and ease of use.

What do you think, time for a re-skin or color update?

Next entries »