Sunday, July 14, 2013

JMeter -- Process Setup 07 -- Explaining Build File 02


This is part seven of our setup.  Part six can be found here: http://dudewheysmehblog.blogspot.com/2011/09/jmeter-process-setup-06-explaining.html

My apologies for the large time gap between part 6 and part 7.  Let's get to it!

We will be covering what the following targets are doing: transformation, transform, perfStart, perfStop, mailSuccessCompile, mailSend, fullrun, and fullrunOneTransform.

target="transformation"
This is exactly the same as transformationOld, except with two transformations: a less detailed one and a more detailed one.  The reason why I did this is simple.  After the test is completed, people get a mail notifying them with links to the report files.  Some people like to check their work mail on the phone.  The detailed report is very large and takes forever and a day to load.  The less detailed report loads very quickly and gives a good summary of what has happened in the test.

target="transform"
Sometimes a test will stop or be stopped prematurely, but you still want to see a report.  What you need to do:
  1. Go to the results folder and see if there is a .JTL file associated with the test -- you can tell by the filename's timestamp.  If the .JTL is not there, you'll have to re-run.
  2. If the .JTL is there the XML will probably be malformed.  Open it up in Notepad++ and check the end of the file.  It should have a closing </httpSample> tag and it should end with </testResults>.  If a tag is missing, add it in the correct spot, save the file, and close it.
  3. Now you can use the transform target to just run the XSL transformation on the .JTL file.  You have three options:
    1. ant -Dfile="[JTLFilename_without.jtl_atTheEnd]" -Dproject="[projectName]" transform
      1. This does absolutely nothing.  You need to add the -Dxsl flag at the end and set it to either "full" or "less".
    2. ant -Dfile="[JTLFilename_without.jtl_atTheEnd]" -Dproject="[projectName]" transform -Dxsl="full"
      1. This runs two transformations on the .JTL file, the Detailed and the Less Detailed ones.  Two reports are generated.
    3. ant -Dfile="[JTLFilename_without.jtl_atTheEnd]" -Dproject="[projectName]" transform -Dxsl="less"
      1. This runs one transformation on the .JTL file - the Less Detailed one.  One report is generated.
target="perfStart"
This target is called by other targets in order to set a counter name and start Perfmon.  It uses a built in utility in Windows called logman, which I'll get into once we reach Process Setup 10.  To satisfy your curiosity, open a command prompt and enter: "logman query".  You should see something like this:


  • We are using the Ant "exec" command to build up a command which will be executed.  Think about this as if we are telling Ant to open a command prompt and enter a string of commands.
  • After the first echo, we are building up the following command: logman update=[${counterName}] -o "C:\PerfLogs\Admin\${project}\ReportLog_${time}\WebServer.blg -u ${compU} ${compP}
    • counterName is the name of the Data Collection Set that we will be using.  As an overview, we will create a Data Collection Set and choose all of the different performance counters that we are interested in tracking.  This command updates this counter to OUTPUT the data to a folder specific to this Project & this Test, so that it's easy to find later on.  counterName is set in extra.properties.
    • compU and compP are the user name and password that are needed to edit the Data Collection Set.  If I recall correctly, it should be the same as your windows login and password, IF NEEDED.  These are also set in extra.properties.
  • After the second echo, we again use exec to build up the command to start logman, which is simply: logman start ${counterName}.

target="perfStop"
Similar to the last part of the perfStart target, this utilizes the Ant exec command to stop Perfmon: logman stop ${counterName}.

target="mailSuccessCompile"
It's was not easy, at least when I created this, to concatenate and manipulate strings, which is why the var folder was necessary.
  • We start by copying the contents of the ${project} variable into the project.txt file.  We then replace spaces in the file with the HTML encoded value "%20".  We repeat this for ${file} > file.txt and ${folder}> folder.txt.
  • All of the var files are loaded into variables.
  • A lot of the rest of this target is just doing math & string operations in order to output a nicely formatted calculation of the time in the email.
  • The last part of this target puts text into two var files, subject.txt and mailbody.txt.
    • The subject will be, for our example: "BC Rich Load Test <timestamp> - Success"
    • The body will be an HTML document with a funny picture, a table with test time info and links to the reports.
      • The table contains: Test name, Start Time, End Time, and Total time.
      • The reports are the Detailed JMeter Report, the Less Detailed JMeter Report, and the Perfmon .BLG's & HTML report.

target="mailSend"
This target sends a mail depending on the status.  It checks if the value of the var/failed.txt file is "No" and if so, it gets all the pieces together and sends the Succes mail out, otherwise it sends the Failure mail.  Some properties (enableStartTLS, user, password, and ssl) are required if using a gmail address & can probably be removed if you're using an internal address.

target="fullrun"
This target pretty much just calls all the other targets in sequential order.  The calls to the other targets are located within a trycatch statement, which checks to see if there are any errors.  If there are any errors, the sequence stops, the var/failed.txt is set to Yes, and a Failure mail is sent.  To use this target, use the command: ant -Dfile="[filename]" -Dfolder="[folderName]" -Dproject="[projectName]" fullrun
  • It starts by resetting the var/failed.txt file to No and then calls:
    • perfStop (to stop the counter if it is running)
    • perfStart (to properly set the counter/log and start the monitoring)
    • jmeterStart (to run the test)
    • transformation (to perform two transformations)
    • perfStop (to stop the counter)
    • mailSuccessCompile (to compile the Success Mail)
  • If any of the previous calls fails, the failMessage is stored and var/failed.txt is set to Yes
  • mailSend (to send the Success Mail)

target="fullrunOneTransform"
This is exactly the same as fullrun, except it performs a single transformation (by using transformationOld instead of transformation).  To use this target, use the command: ant -Dfile="[filename]" -Dfolder="[folderName]" -Dproject="[projectName]" fullrunOneTransform

Summary:
The build file has many targets, some of which are meant to be called from the command line, and others which are meant to be called sequentially.  You are welcome to tweak each one as you see fit.  Pretty much anything you can do manually on the computer can be automated using Ant -- you just need to find the proper command and modify the build file.

Recap & Next Steps:
We have covered how to set up JMeter and Ant and get your tests' reports up and running.  We have tweaked our properties and have modified our build files.  Next we will go over what the XSL files are doing, setup a way to programmatically run our tests (locally or on remote machines) with batch files, and then monitor everything being used with Perfmon.

In Process Setup 08, we will look into the XSL files and how to tweak them.
Part eight has not yet been completed.

Sunday, April 28, 2013

Removing all Hyperlinks in MS Word 2010

Found this neat keyboard shortcut for MS Word 2010 today:
Remove all hyperlinks in a document by highlighting all of the text and hitting:
 CTRL  +  Shift  F9 
In MS Office 2010, it removes the hyperlink and changes the text to the normal color.  In older versions, the text may still be blue.  To change it, just keep the text highlighted and change the font color like you normally would.

Friday, December 14, 2012

Condolences and Gun Control arguments

My heart goes out to those who have passed and those who are suffering in Newtown, Connecticut.

I've heard many people from the NRA state that "Guns don't kill people.  People kill people."  That's true.  Guns are just tools, like a hammer, a knife, or a car.

While people can kill other people using these tools, that doesn't make all tools equal.

  • A hammer can be used to hit a nail, or to hit a person.  It was created though to hit a nail.
  • A knife can be used to cut a fruit, or to to cut a person.  It's normal use though,  is to cut food.
  • A car can be used to drive from A to B, or to drive into a person or into another car.  It was created as a mode of transportation, and that is it's normal use.
A gun can be used for killing animals for fun/sport, or for killing people.
It's a tool for killing.  You can't build a house with a gun.  You can't cut an apple to feed your baby with a gun.  You can't drive from A to B with a gun.

A gun is for killing.  Nothing else.

Having a gun for "defense" means that you want to defend yourself by killing someone else.  If someone ever broke into a gun owner's house, the chances are high that he'll get shot "center mass," and be leaving in a body bag.

A gun is for killing.
And the prime use is for killing other people.

Should all guns be banned?  Probably not, but something definitely needs to be done.

Sunday, November 11, 2012

Random thoughts - Best Beginnings

While going through the daily motions today, I remembered two of my all-time favorite opening sequences:

Gandalf's Fall (at the beginning of the Two Towers)
and

Nightcrawler, taking out everyone (from X-Men 2)

I guess I like movies like that where I know the characters before hand and how bad-a** they are (and will be), and I don't get too disappointed (especially when there's a good director involved)!

What opening sequences dropped your jaw when you first saw it?

Friday, November 9, 2012

IGSA Diwali Show

Just came back from the IGSA Diwali show with my wife and thoroughly enjoyed it!

Pretty much everything was, as the emcee put it, "fantastic!"

Updates

Dear Blog,
I apologize for the neglect as of late.  After GMAT prep late last year, I was busy with B-School applications (Dec 2011 - March 2012), Coursera/Udacity courses (Nov 2011 - May 2012), Carnegie Mellon University's (CMU) Tepper School of Business admission process (April - July 2012), Basecamp (Aug 2012), Mini 1 (late Aug - Oct 2012), the Organizational Leadership Club (OLC) and the Carnegie Bosch Institute (CBI) Case Competition, the AT Kearney Case Competition, DDI Manager Ready Leadership Assessment, and the Business and Technology Club Trek to New York and Seattle (late Oct 2012).
The classes I've taken so far: Management Presentations, Financial and Managerial Accounting I, Probability and Statistics, Corporate Strategy, and Managerial Economics.

Thursday, July 19, 2012

New Pages to check out!

I've created some Pages, which you can find at the top of the site.  Check them out and let me know what you think!

Soon, I'll create some tutorials about how to create these specific types of pages:
  • pulling +1's from Google Plus
  • pulling shared activities from Google Plus
  • pulling comments/questions/answers on different Stack Exchange sites
  • including the You Might Also Like (YMAL) section below each blog post

Friday, April 20, 2012

Udacity thoughts

I often wonder if I'm the only person who thinks Undercity everytime I see or visit Udacity.



Friday, March 30, 2012

FCGDAEB & EGBDF


How did you memorize the notes on sheet music and the circle of fifths?

I'm sure we've all heard "Every Good Boy Does Fine" in music class, but there are two that I've used for forever, and oddly enough, they can't be found here or here...


Thursday, March 22, 2012

Shutting down the Musings...


I'm not very good at keeping blogs updated, especially two of them!

I have used the blogger import/export feature to merge "Musings of a Madman" into "Dude, Where's My Blog."

If you have any objections or reasons why I should really keep them separate, please let me know (I guess the in comment section is a good place) -- otherwise I will be deleting Musings and posting everything to Dude.

Thanks!

Getting to the meat of 'Forever' stocks...or not.

After doing a Google search to find out which stocks are good to buy and hold, I came across this scammy type site.  The page loads and the video starts playing once it's buffered.  The premise is that if you listen for just a few minutes, the guy will tell you the list of the 10 "Forever" stocks that you should get a hold of.  He never actually names any of them though...

I couldn't wait to see if he was going to actually say the stock names, so I tried fast forwarding through it...but the controls were disabled.  Talk about cheap tricks...

Time to bypass those controls:

Thursday, December 29, 2011

Don't post your "Adult Film" Name online!! Here's why...

I was just reading through some older blog posts in Google Reader and came across this GFI post.
It immediately reminded me of this xkcd comic.

Basically, your adult film name (AFN) is comprised of two parts:
First Name = your Pet's name
Last Name = the street you live on

So, for example, in the xkcd comic, the girl's AFN is Mister Rogers.

The post explains that it was big on Tumbler and Twitter for people to reblog/retweet the message with their AFN, which should definitely be avoided!

Why?

Because in many sites' password recovery feature, those are two of the pre-canned questions that users can select as their "secret question:"
  • What is the name of your first pet.
  • What street did you grow up on?
From Naked Security in 2009
Even if you like to create your own security questions, sometimes there is no option to do so and you must answer one of these questions.

So, don't go around posting these answers for the world to see!

Wednesday, December 21, 2011

Thanks for noticing me...

I drove to work this morning,
having a plate-full of cupcakes to share,
with the team.
On the way there, I saw a sign-holding man,
waving at the cars, trucks, and vans,
that pass by everyday.
On his sign, says "Help!
Homeless, Hungry, and Looking for Work."

We had spoken before this day, as well,
when I had stopped to fill up at Shell,
on the corner.

I had given him a few,
dollars and coins.
He expressed his thanks,
smiled, and waved me on.

Today I, pulled into Shell,
not for gas, but to share a treat,
I waved to him from across the street,
As he approached, I held out the sweets,
Which was met by a smile and a warm-filled greet.

"Aw, cupcakes," he exclaimed!

After his thanks, and a shake of the hand,
His smile halfway melted,
A bit of sorrow was there, I had felt it;

He looked very genuine and real,
And said, "Thanks for noticing me."

Saturday, November 26, 2011

Android Phones for $.01 on Amazon for Black Friday weekend? -- Not really...

I just read on LinkedIn that Amazon is currently selling all non-iPhones for one cent until Monday and was thinking, "Wow!  Now I can upgrade my wife to a smart phone!"

Not really...
Checking the deal's page, the deal only applies to new contracts or new lines added to an existing plan, not for upgrades.

Sucks for us, but if you're reading this and were thinking of switching to a new non-iPhone, here's a decent incentive (I know a 2-year contract and a free phone is a sham, but if you were thinking of doing it anyway, you will have saved money upfront on the phone with this).

Thursday, November 10, 2011

iPod Returns

This morning, totally by accident, we found my old 1GB iPod Nano under the passenger seat of my Dad's car.
I've been looking for it for months now and had consigned it as being lost.

WOOOT!!

Just charged it back up.  With 194 Songs near and dear to my heart, which one to play first?!

CHOP SUEY!

Wednesday, November 9, 2011

Free Online Image to PDF converter

Currently working on college applications and needed to convert a screen shot of my transcript in the PNG format to the PDF format.

A quick Google search led me to this site: Neevia Technologies -- Docupub.

Saturday, October 8, 2011

Dirty Spaceman

Tonight I'm leaving
Though I'm bleeding
Now you know me as Dirty Spaceman, yeah
Tonight I'm leaving
Got that spaceman head and
Now I'm leaving (now I'm leaving)

Angel Mouth ate my Jedi Jello
Now she feels the burn (now she feels the burn)
And I'm feeling extra angry
I-I-I I'm the Dirty Spaceman
(Yeah, yeah, sometimes I'm pretty)

Best lyrics ever...
Related Posts Plugin for WordPress, Blogger...