Monday, 17 March 2008

Boing! I’m flabbergasted

I’ve always considered myself as a bit of a nerd. I guess this is something that comes with the territory when you can’t help code something like full-blown Task manager for Sitecore or can go into infinite happiness loop over long lost, newfound generics.

Well, I must now redefine myself:  I’m not a tech-freak. Not at all! What I’ve done in the past seems to pale in comparison to what Alistair from Australia decided to do.

 

I wrote a full-blown task manager for Sitecore in XAML/Ajax. Alistair has decided to set up the bar by writing a full working command prompt system, - ALSO using XAML/Ajax. But not just that, his commands are working directly on the Sitecore data structure allowing you to search, filter and manipulate items exactly the same way you would do it in your Windows command prompt.

ff2a832fd4f79220866a629f6a72f974.jpg

 

What’s this? Is it DOS? Is it PowerShell? No, it’s Revolver

Wednesday, 06 June 2007

Controlling users with Sitecore: Who’s online?

This article applies to Sitecore 5.3.1.

 

Like many other applications, Sitecore licensing can be based on a backend user count basis, limiting more than a given amount of concurrent users. When a server reaches a limit, next user who want to log on, will be denied access until someone leaves the Sitecore server.

As with many web based applications, this may pose a challenge in organizations where users tend to leave the application by closing the browser window. As the server never gets a log off command, it must wait until the session times out, - then logs out the user. This leaves a regular time span where Sitecore may deny users from logging on to the server because they have not yet “timed out” (the standard session timeout is 20 minutes).

Here’s a tool that uses the Sitecore DomainAccessGuard class which holds information about the logged on users and their last actions. I’ve added an application shortcut to the tray, and if you wish to, you can apply admin/security only access to this shortcut.

Finally I’ve added the ability to kick off an idle user. The status column indicates the last activity where green is an action within 2 minutes, 2-5 minutes and red marks “older” actions. On the screenshot, I’m about to kick off user Audrey.

 

medium_LoggedInUsers_small.PNG

 

This Sitecore package contains an installer for the application and the shortcut. Besides this, it comes with full source code and a web project.

Download:

WhoIsOnline.zip

10:50 Posted in Sitecore | Permalink | Comments (6) | Email this | Tags: Sitecore, XAML

Friday, 04 August 2006

Web based task manager in AJAX

Let’s recapitulate the challenge from my last post

We wanted to build a web based application for Sitecore that uses AJAX for emoting something between the task manager and the performance monitor; a customizable task manager.

The reason for creating a task manager / performance manager is two-fold: 

  1. Sitecore allows asynchron processes to be executed as background threads. Indexing, publishing, reporting and other time consuming processes which runs at low priority. For this purpose, Sitecore leverages the access to these threads by a Job manager. The task manager should visually display the jobs being executed, and the status of these.
  2. Solutions can be hosted or devoted or secure servers where access is limited. System administrators may want to use the web based interface to investigate performance monitors from their local machine through the web based interface.

Now, from an architectural point of view, how did I put together this piece of software?

First I thought it would be fairly easy; simply create an AJAX or native .NET application, then let it execute an update every, - say 3 seconds. It should request new tasks as well as getting the basic CPU usage.

But hey; we don’t want to update the entire grid of jobs on every single request. Also, why not make it possible for the user to add their customized performance counters to the usage load display. And then, why not at the same time, display it as a graph.

So, now I was down to a number of features that should be created:

A web based application that would, every X second through XJAX execute some code behind. The code behind would:

  1. Read the Sitecore jobs and update a grid.
  2. Process specific performance counters and
    1. Build an image.
    2. Return image.

Well, it wasn’t really that simple. First of all, I would need to build another AJAX application that allows users to select performance counters and return it to the first form to update another grid.

Allow user to select a performance counter on the grid and change the scale of the graph. Also, when selecting an item, it should be possible to se average value, last value, max value and min value of the selected counter.

So:

  1. Build two applications: “Monitor” and “Select performance counter”.
  2. Build job processor class
  3. Build a task manager class that can read selected performance counters and update them as well as return specific stats.
  4. Build a graph class that can receive data sets, and draw a line graph.

Well, I soon found out that by calling the task class every 3 second would result in two challenges which were mutually damaging:

  1. First, a call every 3 second, and then a performance counter number would result in a rough graph with 3 seconds intervals.
  2. Second, drawing a graph every 3 seconds would result in server load as drawing and file operations. This would be equivalent to having a performance counter affecting performance counts.

Above raises a major challenge with the current architecture. I cannot increase the number of requests to give a better, smoother graph as this would increase the number of graph paints and server load, and in the other hand I cannot decrease the server load.

But, as always, this can be solved. I did it by creating a performance counter collecting Sitecore job which would run as a background thread. It will be kept alive by a ping from the main monitor application every time I request a new graph. The job collects counters every second. Then every 5 second, I request a graph based on the data collected.

So, as simple as that:

  • Create a background thread that can be configured from an application. Thread collects performance counters.
  • Two XAML applications (that are compiled into .NET forms) which are AJAX based:
    • Monitor application
    • Get new counter application
  • Graph class that can draw a class.

Interesting links: