Skip to main content

Generating Java Mixed Mode Flame Graphs

Overview

I've seen Brendan Gregg's talk on generating mixed-mode flame graphs and I wanted to reproduce those flamegraphs for myself. Setting up the tools is a little bit of work, so I wanted to capture those steps. Check out the Java in Flames post on the Netflix blog for more information.

I've created github repo (github.com/jerometerry/perf)  that contains the scripts used to get this going, including a Vagrantfile, and JMeter Test Plan.

Here's a flame graph I generated while applying load (via JMeter) to the basic arithmetic Tomcat sample application. All the green stacks are Java code, red stacks are kernel code, and yellow stacks are C++ code. The big green pile on the right is all the Tomcat Java code that's being run.


Tools

Here's the technologies I used (I'm writing this on a Mac).
  • VirtualBox 5.1.12
  • Vagrant 1.9.1
  • bento/ubuntu-16.04 (kernel 4.4.0-38)
  • Tomcat 7.0.68
  • JMeter 3.1
  • OpenJDK 8 1.8.111
  • linux-tools-4.4.0-38
  • linux-tools-common
  • Brendan Gregg's FlameGraph tools
  • Johannes Rudolph's Perf Map Agent tool 

Steps

Here's the steps to set up the VM
  1. Created a Ubuntu 16.04VM using VirtualBox / Vagrant (vagrant init bento/ubuntu-16.04; vagrant up)
  2. SSH into the VM (vagrant ssh)
  3. Update apt (sudo apt-get update)
  4. Install Java 8 JDK (sudo apt-get install openjdk-8-jdk)
  5. Install Java 8 Debug Symbols (sudo apt-get install openjdk-8-dbg)
  6.  Install Tomcat 7 (sudo apt-get install tomcat7 tomcat7-examples)
  7. Configure JAVA_HOME in /etc/default/tomcat7 (JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64)
  8. Configure JAVA_OPTS in /etc/default/tomct7 (JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -XX:+UseG1GC -XX:+PreserveFramePointer -XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints")
  9. Restart tomcat7 service (sudo service tomcat7 restart)
  10. Install cmake (sudo apt-get install cmake build-essential)
  11. Install Linux perf (sudo apt-get install linux-tools-common linux-tools-generic linux-tools-`uname -r`)
  12. Download flamegraph (git clone --depth=1 https://github.com/brendangregg/FlameGraph)
  13. Download perf-map-agent (git clone --depth=1 https://github.com/jrudolph/perf-map-agent)
  14. Build perf-map-agent (cd perf-map-agent; export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64; cmake .; make)

At this point, Tomcat 7, Java 8, Linux Perf, FlameGraphs, and Perf Map Agent are all configured, and we're just about ready to generate a flame graph.

Applying Workload

Next step is to apply load to the Tomcat. From the host
  1. Download JMetere 3.1
  2. Run JMeter
  3. Add a Thread Group: Number of Threads (users): 25, Ramp up period (in seconds): 30, Loop Count: Forever
  4. Add new Sampler, HTTP Listener. Server Name or IP: localhost. Port Number: 8080. Path: /examples/jsp/jsp2/el/basic-arithmetic.jsp
  5. Hit play
That is a basic test plan to drive the Tomcat basic arithmetic sample using 25 users ramped up over 30 seconds, forever. That's enough load to capture a decent profile. You might need to tweak JMeter HTTP Listener, depending on how your VM is set up. In my case, I have the VM port forwarding guest port 8080 to host port 8080. 

Generating Flamegraph

With the VM configured and JMeter running, we can now generate a flame graph. From the home directory (~/) in the VM
  1. sudo perf record -F 99 -a -g -- sleep 30
  2. sudo ./FlameGraph/jmaps
  3. sudo chown root /tmp/perf-*.map
  4. sudo chown root perf.data
  5. sudo perf script | ./FlameGraph/stackcollapse-perf.pl | grep -v cpu_idle | ./FlameGraph/flamegraph.pl --color=java --hash > flamegraph.svg
And with that, the Flame Graph is now generated!

You can copy the flame graph to the host as follows
  • cp ~/flamegraph.svg /vagrant
This is put the flamegraph.svg file in the directory you ran the vagrant up command in, since by default vagrant syncs that folder.

Automation

To simplify this, I've added the Vagrantfile to my github repo, along with the JMeter Test plan.

git clone https://github.com/jerometerry/perf.git
cd ./perf
vagrant up

... Start JMeter test plan

vagrant ssh
sudo ~/generate-flamegraph.sh
exit


AWS EC2

The steps above are pretty close to what you would do to set this up in AWS EC2. Assuming you have an EC2 Ubuntu instance running with OpenJDK 8 installed, you would need to

  1. SSH into the EC2 instance
  2. Update apt (sudo apt-get update)
  3. Install Java 8 Debug Symbols (sudo apt-get install openjdk-8-dbg)
  4. Add PreserveFramePointer to JAVA_OPTS "XX:+PreserveFramePointer"
  5. Restart Java process
  6. Install cmake (sudo apt-get install cmake build-essential)
  7. Install Linux perf (sudo apt-get install linux-tools-common linux-tools-generic linux-tools-`uname -r`)
  8. Download flamegraph (git clone --depth=1 https://github.com/brendangregg/FlameGraph)
  9. Download perf-map-agent (git clone --depth=1 https://github.com/jrudolph/perf-map-agent)
  10. Build perf-map-agent (cd perf-map-agent; export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64; cmake .; make)
Once you have Linux Tools installed, the Java debug symbols installed, flamegraph and java-perf-agent configured, you can apply the workload to the Java process, then generate a flamegraph 

  1. sudo perf record -F 99 -a -g -- sleep 30
  2. sudo ./FlameGraph/jmaps
  3. sudo chown root /tmp/perf-*.map
  4. sudo chown root perf.data
  5. sudo perf script | ./FlameGraph/stackcollapse-perf.pl | ./FlameGraph/flamegraph.pl --color=java --hash > flamegraph.svg
Then you would scp the flamegraph.svg file down to your local machine. For example, assuming my username on the EC2 instance is jerome_terry, and I have an SSH tunnel configured named EC2Instance, then I would just run
  • scp jerome_terry@EC2Instance:/home/jerome_terry/flamegraph.svg ./

Safepoints


Nitsan Wakart recommended that I include the JVM options -XX:+UnlockDiagnosticVMOptions and -XX:+DebugNonSafepoints, and pass unfoldall to perfmap agent. Doing this paints a better picture of what's actually running on CPU.

Adding the JVM options is trivial (add it to JAVA_OPTS in the Tomcat example). Passing unfoldall to perfmap agent requires modification of Brendan Greggs jmaps script by changing


net.virtualvoid.perf.AttachOnce $pid 

to

net.virtualvoid.perf.AttachOnce $pid unfoldall

You'll also need to pass the ---inline flag to the stackcollapse-perf.pl script. 

References

Comments

  1. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

    Best AWS training in bangalore

    ReplyDelete
  2. Awesome , Your guidelines and approaches content was very nice, it seems to clearly understandable. Its unique one i was fully enjoyed, Thanks for giving this wonderful opportunity,

    Selenium Training in chennai | Selenium Course in Chennai

    ReplyDelete
  3. Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts.
    honor service centres in chennai
    honor service center velachery
    honor service center in vadapalani

    ReplyDelete
  4. Thanks for sharing this valuable information to our vision. You have posted a worthy blog keep sharing.

    Article submission sites
    Education

    ReplyDelete
  5. TreasureBox is operated by a group of young, passionate, and ambitious people that are working diligently towards the same goal - make your every dollar count, as we believe you deserve something better.
    tv stand nz
    bike stand nz
    sofa bed nz

    ReplyDelete
  6. Excellent knowledge shared about java mixed mode frame , Thanks to you. For more details Click Here- : Digital Marketing Course

    ReplyDelete
  7. Visit for AWS training in Bangalore: AWS training in Bangalore

    ReplyDelete
  8. You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!!
    tree stump removal lake worth

    ReplyDelete
  9. I think this is one of the most significant information for me. And i’m glad reading your article. dumpster rental asheville

    ReplyDelete
  10. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post.tree trimming companies montgomery

    ReplyDelete
  11. This post is good enough to make somebody understand this amazing thing, and I’m sure everyone will appreciate this interesting things.
    dumpster rental cost springfield

    ReplyDelete
  12. I didn't realized how it is very written everything in here! ADA Compliance Striping San Jose CA

    ReplyDelete
  13. Hi, This is a nice article you shared great information i have read it thanks for giving such a wonderful blog for the reader. septic tank cleaning springfield

    ReplyDelete
  14. You have a good point here!I totally agree with what you have said!! Thanks for sharing your views. hope more people will read this article!!! residential tree services jonesboro

    ReplyDelete
  15. Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject?
    dumpster rental companies little rock

    ReplyDelete
  16. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..drain cleaning service little rock

    ReplyDelete
  17. You have a good point here!I totally agree with what you have said!! Thanks for sharing your views. hope more people will read this article!!! emergency tree services beaumont

    ReplyDelete
  18. Great article and a nice way to promote online. I’m satisfied with the information that you provided junk hauling services corpus christi

    ReplyDelete
  19. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post.grease trap pumping service corpus christi

    ReplyDelete
  20. Thanks for the wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading. stump grinding lubbock

    ReplyDelete
  21. I think this is one of the most significant information for me. And i’m glad reading your article. dumpster rental services albuquerque

    ReplyDelete

  22. I just can’t stop reading this. Its so fresh, so filled with updates that I just didn’t know. I am delighted to see that people are in fact writing about this subject in such a elegant way, presenting us all diverse parts to it. You’re a fine blogger. Please carry on with it. I can’t wait to read what’s after that. carpet cleaners

    ReplyDelete
  23. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
    data analytics courses

    data science interview questions

    business analytics courses

    data science course in mumbai

    ReplyDelete
  24. Similarly, you can watch the TV shows Pinoy Tambayan HD such as Pino Ako, Pinoy Tambayan, Pinoy Teleserye Replay, Pinoy1TV, TFC, Pinoy GMA TV replays at anytime or whenever you want. As we know that Filipinos people are so hard working and they keep themselves busy on work. Because of their job, they cannot watch their favorite Pinoy TV shows, ambayan shows or Pinoy Lambingan on television.

    ReplyDelete
  25. This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environmen python training in vijayawada. , data scince training in vijayawada . , java training in vijayawada. ,

    ReplyDelete
  26. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science training in Hyderabad

    ReplyDelete
  27. شرکت تلکا هاست پیشرو در میزبانی انواع وب سایت و هم چنین دارای انواع هاست فوق ارزان با کنترل پنل سی پنل میباشد.حتما از سایت ما دیدن کنید و از قیمت های مناسب برای انواع سرویس های وب و ثبت انواع دامنه شگفت زده شوید.

    ReplyDelete
  28. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data science Interview Questions
    Data Science Course

    ReplyDelete
  29. My spouse and I love your blog and find almost all of your post’s to be just what I’m looking for. Can you offer guest writers to write content for you?
    I wouldn’t mind producing a post or elaborating on some the subjects you write concerning here. Again, awesome weblog!

    AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  30. If people that write articles cared more about writing great material like you, more readers would read their content. It's refreshing to find such original content in an otherwise copy-cat world. Thank you so much.
    Best Data Science training in Mumbai

    Data Science training in Mumbai

    ReplyDelete
  31. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries. keep it up.
    data analytics course in Bangalore

    ReplyDelete
  32. Best Corporate Video Production Company in Bangalore and top Explainer Video Company in Bangalore , 3d, 2d Animation Video Makers in Chennai.
    Great article, Charles. Thanks for it.

    ReplyDelete
  33. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.

    Correlation vs Covariance

    ReplyDelete
  34. The blog has very nice information and amazing facts to read. Thanks for sharing this post! You can also check our blog
    Url - https://www.raletta.in/blog/internship-in-indore/

    ReplyDelete
  35. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

    ReplyDelete
  36. the post was very nice!
    Visit this blog also for more information

    https://www.raletta.in/blog/work-from-home/

    Thank you

    ReplyDelete
  37. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
    Data Science Certification in Bangalore

    ReplyDelete
  38. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!.
    Data Science Course in Bangalore

    ReplyDelete
  39. A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one
    Data Science Training in Bangalore

    ReplyDelete
  40. Very interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.You can also check my articles as well.

    Data Science In Banglore With Placements
    Data Science Course In Bangalore
    Data Science Training In Bangalore
    Best Data Science Courses In Bangalore
    Data Science Institute In Bangalore

    Thank you..

    ReplyDelete
  41. I am sure that this is going to help a lot of individuals. Keep up the good work. It is highly convincing and I enjoyed going through the entire blog.

    Data Science Course

    ReplyDelete
  42. I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site.

    Data Science Training

    ReplyDelete
  43. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

    ReplyDelete
  44. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one.
    360DigiTMG Data Science Institute in Bangalore

    ReplyDelete
  45. The development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. machine learning projects for final year In case you will succeed, you have to begin building machine learning projects in the near future.

    Projects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.


    Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.

    ReplyDelete
  46. I see some amazingly important and kept up to length of your strength searching for in your on the site.

    Data Science Course

    ReplyDelete
  47. I think about it is most required for making more on this get engaged.

    Data Science Training

    ReplyDelete
  48. Thanks for sharing this article with us this is very useful for us. Visit our blog too Fashion Blog

    ReplyDelete
  49. To establish a network by putting towers in a region we can use the clustering technique to find those tower locations which will ensure that all the users receive optimum signal strength.
    data science training bangalore

    ReplyDelete
  50. Very interesting blog Thank you for sharing such a nice and interesting blog and really very helpful article.
    Data Science Course in Hyderabad

    ReplyDelete
  51. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  52. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.

    Simple Linear Regression

    Correlation vs Covariance

    ReplyDelete
  53. I feel a lot more people need to read this, very good info!.Learn best Data Science Course in Hyderabad

    ReplyDelete
  54. I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read!! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site.Learn Best Data Science Training in Hyderabad

    ReplyDelete
  55. really awesome post this is. Truly, one of the best posts I've ever witnessed to see in my whole life. Wow, just keep it up.Learn best Business Analytics Course in Hyderabad

    ReplyDelete
  56. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!data science certification

    ReplyDelete
  57. This post is very simple to read and appreciate without leaving any details out. Great work!
    data science course hyderabad - 360DigiTMG

    ReplyDelete
  58. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
    python course training in guduvanchery

    ReplyDelete
  59. Very impressive and interesting blog found to be well written in a simple manner that everyone will understand and gain the enough knowledge from your blog being more informative is an added advantage for the users who are going through it. Once again nice blog keep it up.

    360DigiTMG Tableau Course

    ReplyDelete
  60. I truly appreciate essentially perusing the entirety of your weblogs. Basically needed to advise you that you have individuals like me who value your work. Certainly an extraordinary post. Caps off to you! The data that you have given is useful.360DigiTMG data science course

    ReplyDelete
  61. I'd love to thank you for the efforts you've made in composing this post. I hope the same best work out of you later on too. I wished to thank you with this particular sites! Thank you for sharing. Fantastic sites!
    Data Science Course in Bangalore

    ReplyDelete
  62. This is a great post. This post gives a truly quality information. I am certainly going to look into it. Really very helpful tips are supplied here. Thank you so much. Keep up the great works
    Data Science Training in Bangalore

    ReplyDelete
  63. This Was An Amazing ! I Haven't Seen This Type of Blog Ever ! Thankyou For Sharing, data science course in hyderabad

    ReplyDelete
  64. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
    360DigiTMG

    ReplyDelete

  65. I'm really thankful that I read this. It's extremely valuable and quite informative and I truly learned a great deal from it.
    360DigiTMG Data Science Training Institute in Bangalore

    ReplyDelete
  66. Additionally, this is an excellent article which I truly like studying. It's not everyday I have the option to see something similar to this.
    Data Science Course In Bangalore With Placement

    ReplyDelete

  67. Very wonderful article. I liked reading your article. Very wonderful share. Thanks ! .
    Data Science Course In Bangalore With Placement

    ReplyDelete
  68. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.

    data science interview questions

    ReplyDelete
  69. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.

    Simple Linear Regression

    Correlation vs covariance

    KNN Algorithm

    Logistic Regression explained

    ReplyDelete
  70. Thanks for the Information.Interesting stuff to read.Great Article.
    I enjoyed reading your post, very nice share.
    Data Science Course Training in Hyderabad

    ReplyDelete
  71. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple Linear Regression
    data science interview questions
    KNN Algorithm
    Logistic Regression explained

    ReplyDelete
  72. Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.

    360DigiTMG Business Analytics Course

    ReplyDelete
  73. Thanks for the lovely blog. It helped me a lot. I'm glad I found this blog. Thanks for sharing with us, I too am always learning something new from your post.

    360DigiTMG Business Analytics Course in Bangalore

    ReplyDelete
  74. Thanks for the lovely blog. It helped me a lot. I'm glad I found this blog. Thanks for sharing with us, I too am always learning something new from your post.

    360DigiTMG Business Analytics Course in Bangalore

    ReplyDelete
  75. I can configure my new idea from this post. Detailed information is given. Thank you all for this valuable information...

    360DigiTMG Data Analytics Course in Bangalore

    ReplyDelete
  76. Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. technical training

    ReplyDelete
  77. Attend The Data Science Courses From ExcelR. Practical Data Science Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Courses.
    Data Science Courses

    ReplyDelete
  78. As forever your articles do move me. Each and every detail you have posted was extraordinary.

    data science courses in delhi

    ReplyDelete
  79. It is a great pleasure to read your message. It's full of information I'm looking for and love to post a comment that says "The content of your post is amazing". Excellent work.

    360DigiTMG Artificial Intelligence Course in Bangalore

    ReplyDelete
  80. You have provided finicky information for a new blogger so it has turned out to be really obliging. Keep up the good work!
    Data Science training in Mumbai
    Data Science course in Mumbai
    SAP training in Mumbai

    ReplyDelete
  81. Attend The data science course in Hyderabad From ExcelR. Practical data science course in Hyderabad Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The data science course in Hyderabad. data science course in Hyderabad

    ReplyDelete
  82. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data science online course

    ReplyDelete
  83. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad

    ReplyDelete
  84. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Simple Linear Regression
    Correlation vs covariance
    data science interview questions
    KNN Algorithm
    Logistic Regression explained

    ReplyDelete
  85. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad

    ReplyDelete
  86. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data science course

    ReplyDelete
  87. Really fine and interesting informative article. I used to be looking for this kind of advice and enjoyed looking over this one. Thank you for sharing.Learn 360DigiTMG Tableau Course in Bangalore

    ReplyDelete

Post a Comment

Popular posts from this blog

Basic Web Performance Testing With JMeter and Gatling

Introduction In this post I'll give a quick way to get some basic web performance metrics using both JMeter and Gatling.

JMeter is a well known, open source, Java based tool for performance testing. It has a lot of features, and can be a little confusing at first. Scripts (aka Test Plans), are XML documents, edited using the JMeter GUI.  There are lots of options, supports a wide variety of protocols, and produces some OK looking graphs and reports.

Gatling is a lesser known tool, but I really like it. It's a Scala based tool, with scripts written in a nice DSL. While the scripts require some basic Scala, they are fairly easy to understand and modify. The output is a nice looking, interactive, HTML page.
Metrics Below are the basic metrics gathered by both JMeter and Gatling. If you are just starting performance testing, these might be a good starting point.

Response Time – Difference between time when request was sent and time when response has been fully received

Latency –…

Multi Threaded NUnit Tests

Recently I needed to reproduce an Entity Framework deadlock issue. The test needed to run in NUnit, and involved firing off two separate threads. The trouble is that in NUnit, exceptions in threads terminate the parent thread without failing the test.

For example, here's a test that starts two threads: the first thread simply logs to the console, while the other thread turfs an exception. What I expected was that this test should fail. However, the test actually passes.

readonly ThreadStart[] delegates = { () => { Console.WriteLine("Nothing to see here"); }, () => { throw new InvalidOperationException("Blow up"); } }; [Test] public void SimpleMultiThreading() { var threads = delegates.Select(d => new Thread(d)).ToList(); foreach (var t in threads) { t.Start(); } foreach (var t in threads) { t.Join(); } }
Peter Provost posted an article that describes how to make this test fail. It works…