Archive for Flash

Stress Testing AMF Gateway Screen Capture

I took some time to do a screen capture of AMF stress testing. It’s much easier to understand when you can see how to set it up. Check it out.

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.

TweenLite isTweening Method.

I’m on a project right now that’s using TweenLite But it’s missing the isTweening method. Here it is:

First update the constructor:
Line 180/181 should look like this:

_all[$target][this] = this;
_all[$target]['instance'] = this;

In the executeAll() function, there is an innter for loop, change it to this:

for (twp in a[p]) {
 if(twp == 'instance')
  continue;
 tw = a[p][twp];
 if (tw != null && tw.active) {
 tw.render(t);
 }
}

Then add this somewhere at the bottom:

public static function isTweening(target:*):Boolean
{
  if(_all[target] == null)
    return false;
  var t:* = _all[target] as Dictionary;
  var instance:TweenLite = t['instance'] as TweenLite;
  return instance.active;
}

Hope that helps someone out there.

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

Flash 8 Not Officially Supported Anymore

Just wanted to give everyone a heads up that I no longer test for Flash 8. The core features are still there, but I don’t test in Flash 8. I think we’re beyond it now.

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

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

I released a Mac OS X plugin switcher called Plugout and took it down later. We wanted to put it on a more collaborative effort site. So It will be over here. Instead of being under the RubyAMF name. Larry’s got a sweet Mac widget coming for this – hang in there.

Next entries »