Quantcast
Channel: Silk Performer
Viewing all articles
Browse latest Browse all 4084

Blog Post: Sending Notifications During a Load Test Using Silk Performer

$
0
0
In some circumstances it might be useful to be able to receive updates or notifications from your running load test. This could involve tracking error rates, checking for specific conditions or just notifications of when the test is complete. In fact you can program Silk Performer to send a notification based on pretty much any event you can think of. A scenario where this might be useful comes from the fact that a lot of tests are run after office hours during periods of low activity or where employee machines can be utilized as agents. So imagine the horror when you click to start a test, walk out of the office and return the next morning only to find that your load test actually had a catastrophic failure a few minutes after your departure because you forgot to populate the database with the correct data or some other oversight that would cost you a nights testing.  For this reason it would be great to have a way for Silk Performer to notify you of such an event. Due to the many ways in which Silk Performer can interact with other applications there are many ways notifications can be sent. For example you can use SMTP/POP/.Net Framework support to send notifications via email, or use an SMS gateway to deliver notifications straight to your smartphone via text. You could also send notifications via instant messaging applications like Skype or WhatsApp although I don’t know how useful that would be. In a more mundane way you could also just play some sounds from the machine to notify those around that something related to the test requires attention. I decided to have some fun this week around the topic of notifications.  I took Silk Performer, a smart watch and a great SMS gateway service and combined them to show what might be possible.  Here are the results: You might not have a smart watch lying around but don't worry because the watch only replicates what is already on the phone: The process of putting this together is actually very simple and it is going to be similar regardless of what type of notification you decide to use.  My solution consists of a script which exists purely to generate an error, an event handler to catch the error, a custom function which makes a call to the SMS Gateway and a cellphone to receive the message... and a smart watch just for the sake of it. The Event Handler This handler will catch any event with severity error.  This is probably too all encompassing to be useful but was fine for my scenario as my script only generates one type of error.  The handler calls two custom functions: GetErrorStack produces a simple string with the error codes and text and this makes up the body of the SMS message. FSendSMS is the function where I interact with the Gateway to send a text message - and also return the balance on my gateway account. The SMS Gateway The gateway service I used was called Kapow.  They provide several API's for users to interact with including an HTTP interface and a DLL.  In my example I have shown the request being made to the gateway with required parameters: username and password of the gateway account, mobile number to send the message too and also the mobile number that the message should appear to come from under from_id.  I used the from_id to add a contact to my smartphone with the Silk Performer name and logo - otherwise the Gateway url is specified instead of a number. In a nutshell, the load test runs normally and this code does nothing until an error occurs and the event handler triggers.  At this point I get the error text and send it to the SMS function to send the message.  Of course you don't have to use SMS at all.  You could use email: Or you could use sound as an alert as described in this  article. It is important to note that whatever option you choose you must ensure that it will not be a performance bottleneck for the load test. You also need to ensure you don’t cause spamming through your chosen method. At least this would annoy your recipients but at worst this could cost you money if using a paid for SMS gateway service. For this reason it is better to count errors and trigger a notification only after a certain threshold is breached or better still only flag a notification for some errors which have a specific meaning like Winsock errors which can indicate a networking problem.

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>