Toggling layers on and off in a load tester application.

6 messages Options
Embed this post
Permalink
Carl Jokl

Toggling layers on and off in a load tester application.

Reply Threaded More More options
Print post
Permalink
I am fairly far along in in development of a .Net MapGuide Enterprise load tester. I have recently had some problems when trying to toggle layers on and off on the test map. I thought that this was working but it looks like it may not have been after all.

I used the grider script as a starting point and ported the functionality to .Net using our own MapGuide framework's HttpRequest making component.

The problem which I am having is that when I am calling the code to turn off a layer and getting the image back the image does not show that layer having been turned off. I even used FireFox live headers to observer every request which the AJAX viewer makes to the server and my code is making requests in identical format and yet for me it isn't working. I have functionality to translate layer names to ids as I know layer object ids need to be submitted. I have tried both the route of creating an overlay image as well as just creating a regular map image. Neither approach is showing the layer I am trying to hide being hidden. I can't see what is different about the requests that I am making from those made by the Ajax Viewer. I feel like I have tried just about everything at this point. Matching even the parameter order (not that this should matter in Http but you never know when dealing with Autodesk Software). We are using MapGuide Enterprise 2010 Service Pack 1. There is the BEHAVIOR parameter. I am using the same one as the AJAX viewer but I don't know what behaviour is associated with each number. I am not sure if this is even documented as I might guess a lot of this stress testing work is based on a fair amount of reverse engineering.

I did notice for a lot of the requests to create a dynamic map image overlay by the AJAX view the CLIENTAGENT parameter appears twice in the url query. I am pretty sure that this is a viewer bug.
Kenneth Skovhede, GEOGRAF A/S

Re: Toggling layers on and off in a load tester application.

Reply Threaded More More options
Print post
Permalink
AFAIK, it is not possible to toggle layers on/off from
a client request, even if the GUID items are present.

I have never gotten it to work, and can't see it being done
in the viewer either.

You need a server side script to toggle the layer visibility
in the runtime map.

I wrote RFC 21 way back, which would support something like this:
http://trac.osgeo.org/mapguide/wiki/MapGuideRfc21

I would LOVE to have every API function supported
in the http interface, so more functions can be performed
without having server side access.

The RFC should probably be scrapped, and a new one written
that states that all API methods should have a http equivalent.

I'm guessing that the REST API that Jason & Harris put up,
can support something like this, but it's still a server item
that needs to be installed.

Regards, Kenneth Skovhede, GEOGRAF A/S



Carl Jokl skrev:

> I am fairly far along in in development of a .Net MapGuide Enterprise load
> tester. I have recently had some problems when trying to toggle layers on
> and off on the test map. I thought that this was working but it looks like
> it may not have been after all.
>
> I used the grider script as a starting point and ported the functionality to
> .Net using our own MapGuide framework's HttpRequest making component.
>
> The problem which I am having is that when I am calling the code to turn off
> a layer and getting the image back the image does not show that layer having
> been turned off. I even used FireFox live headers to observer every request
> which the AJAX viewer makes to the server and my code is making requests in
> identical format and yet for me it isn't working. I have functionality to
> translate layer names to ids as I know layer object ids need to be
> submitted. I have tried both the route of creating an overlay image as well
> as just creating a regular map image. Neither approach is showing the layer
> I am trying to hide being hidden. I can't see what is different about the
> requests that I am making from those made by the Ajax Viewer. I feel like I
> have tried just about everything at this point. Matching even the parameter
> order (not that this should matter in Http but you never know when dealing
> with Autodesk Software). We are using MapGuide Enterprise 2010 Service Pack
> 1. There is the BEHAVIOR parameter. I am using the same one as the AJAX
> viewer but I don't know what behaviour is associated with each number. I am
> not sure if this is even documented as I might guess a lot of this stress
> testing work is based on a fair amount of reverse engineering.
>
> I did notice for a lot of the requests to create a dynamic map image overlay
> by the AJAX view the CLIENTAGENT parameter appears twice in the url query. I
> am pretty sure that this is a viewer bug.
>  
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Kenneth Skovhede, GEOGRAF A/S

Re: Toggling layers on and off in a load tester application.

Reply Threaded More More options
Print post
Permalink
I just saw that you are using C# somewhere.
If possible, you can use the MaestroAPI to
toggle layers via. http.

It requires binary
access, so it will be hard to port to clean JS.

Regards, Kenneth Skovhede, GEOGRAF A/S



Kenneth Skovhede, GEOGRAF A/S skrev:

> AFAIK, it is not possible to toggle layers on/off from
> a client request, even if the GUID items are present.
>
> I have never gotten it to work, and can't see it being done
> in the viewer either.
>
> You need a server side script to toggle the layer visibility
> in the runtime map.
>
> I wrote RFC 21 way back, which would support something like this:
> http://trac.osgeo.org/mapguide/wiki/MapGuideRfc21
>
> I would LOVE to have every API function supported
> in the http interface, so more functions can be performed
> without having server side access.
>
> The RFC should probably be scrapped, and a new one written
> that states that all API methods should have a http equivalent.
>
> I'm guessing that the REST API that Jason & Harris put up,
> can support something like this, but it's still a server item
> that needs to be installed.
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
> Carl Jokl skrev:
>> I am fairly far along in in development of a .Net MapGuide Enterprise
>> load
>> tester. I have recently had some problems when trying to toggle
>> layers on
>> and off on the test map. I thought that this was working but it looks
>> like
>> it may not have been after all.
>> I used the grider script as a starting point and ported the
>> functionality to
>> .Net using our own MapGuide framework's HttpRequest making component.
>> The problem which I am having is that when I am calling the code to
>> turn off
>> a layer and getting the image back the image does not show that layer
>> having
>> been turned off. I even used FireFox live headers to observer every
>> request
>> which the AJAX viewer makes to the server and my code is making
>> requests in
>> identical format and yet for me it isn't working. I have
>> functionality to
>> translate layer names to ids as I know layer object ids need to be
>> submitted. I have tried both the route of creating an overlay image
>> as well
>> as just creating a regular map image. Neither approach is showing the
>> layer
>> I am trying to hide being hidden. I can't see what is different about
>> the
>> requests that I am making from those made by the Ajax Viewer. I feel
>> like I
>> have tried just about everything at this point. Matching even the
>> parameter
>> order (not that this should matter in Http but you never know when
>> dealing
>> with Autodesk Software). We are using MapGuide Enterprise 2010
>> Service Pack
>> 1. There is the BEHAVIOR parameter. I am using the same one as the AJAX
>> viewer but I don't know what behaviour is associated with each
>> number. I am
>> not sure if this is even documented as I might guess a lot of this
>> stress
>> testing work is based on a fair amount of reverse engineering.
>>
>> I did notice for a lot of the requests to create a dynamic map image
>> overlay
>> by the AJAX view the CLIENTAGENT parameter appears twice in the url
>> query. I
>> am pretty sure that this is a viewer bug.
> _______________________________________________
> mapguide-internals mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Carl Jokl

Re: Toggling layers on and off in a load tester application.

Reply Threaded More More options
Print post
Permalink
Let me give you a bit more background. Not too long ago we went live with a migrated web application which had originally been running in MapGuide 6.5 but was migrated to MapGuide Enterprise. Extensive testing was done of the MapGuide enterprise migration before it went live. In spite of all our testing and in particular load testing, when the application went live it proved to be unstable. In the end we had to roll back the live system from MapGuide Enterprise to MapGuide 6.5. We are left now trying to figure out what the problem is (which we are certain lies in the MapGuide Enterprise Server). As these stability issues did not show up in our load testing we need to be sure our testing can replicate a load closer to the live environment. I have been given responsibility for creating a load testing application. Rather than trying to gather as many of our staff to use the application concurrently to do load testing as we have previously I have created a program which simulates multiple concurrent users manipulating a map on the server. To that end this program needs to be able to perform the basic user activities.

This work is almost complete. This is basically a C# .Net application which communicates with the server components and "pretends" to be the AJAX viewer. This works well actually. I have image files dumped out to prove that the client has a correct map image as the map is panned and zoomed. It even is able to update for different selection. I think I am already close to being able to toggle layers on and off. This isn't any kind of official or approved approach from Autodesk rather it is from reverse engineering how the AJAX viewer works. I can use the Live Headers pluging for FireFox and watch every HTTP Request and Response moving back and fourth between the viewer and the server.

You say that you don't think this is possible. I say it has to be possible for the AJAX viewer to work. Everything the AJAX viewer displays in the browser was rendered on the server. This is a collection of HTML Div objects which JavaScript is updating with new rendered images from the server. I have done a lot of reading of the JavaScript source code to have a reasonable idea how the AJAX viewer works.
I have observed a single HTTP request made from the viewer to the server when a layer is turned either on or off. This implies that it only takes one call to do it. Even though my C# code calls the same URL with the same parameters the image I get back still shows the layer as being visible. This is why it is really frustrating. I can't see what the AJAX viewer does any different from my code. The AJAX viewer would as far as I know when a layer is turned off make a request to the server to render a new map image with that layer turned off.

I wonder if I might have to go into the server side C++ code to reverse engineer more of how the viewer-server interaction works and what the Server expects to receive in terms of parameters. The BEHAVIOR parameter in particular I am just using blindly the same value I am seeing going back and fourth in the HTTP Interaction. It would be good to know what the different number codes relate to.

My starting point on this project has been the existing Grinder based load tester which was posted by another user on this forum. That user has been able to carry out load testing in this way.
Carl Jokl

Re: Toggling layers on and off in a load tester application.

Reply Threaded More More options
Print post
Permalink
Never mind. This weekend I had a flash of inspiration about what the problem might be. It relates to the legend script page being loaded twice in testing. Once it is loaded to parse the group and layer information from the JavaScript into C# .Net objects for use in other parts of the testing but it also was loaded again in a separate test which just tested that the various frames of the viewer can be loaded. I suspect that the object ids for the groups and layers must change each time the Legend script frame is loaded so my tests would have been using old object ids for the layers and groups which were no longer being used.
Kenneth Skovhede, GEOGRAF A/S

Re: Toggling layers on and off in a load tester application.

Reply Threaded More More options
Print post
Permalink
I can see what you mean with the guids being passed, it appears that it
does work.
Not sure what I did wrong back then.

The behavior parameter is described in RFC38:
http://trac.osgeo.org/mapguide/wiki/MapGuideRfc38

The object id's (guids) change each time you generate a runtime map.
The runtime map is generated in mapframe.(aspx|php|jsp):

            MgMap map = new MgMap();
            MgResourceIdentifier resId = new
MgResourceIdentifier(mapDefinition);
            String mapName = resId.GetName();
            map.Create(resourceSrvc, resId, mapName);

Regards, Kenneth Skovhede, GEOGRAF A/S



Carl Jokl skrev:

> Never mind. This weekend I had a flash of inspiration about what the problem
> might be. It relates to the legend script page being loaded twice in
> testing. Once it is loaded to parse the group and layer information from the
> JavaScript into C# .Net objects for use in other parts of the testing but it
> also was loaded again in a separate test which just tested that the various
> frames of the viewer can be loaded. I suspect that the object ids for the
> groups and layers must change each time the Legend script frame is loaded so
> my tests would have been using old object ids for the layers and groups
> which were no longer being used.
>  
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals