Search This Blog

Thursday, November 22, 2012

[Reminder for myself] Performance Monitoring

Determine the points where requests are waiting or slow

If system is busy, deny request at the earliest entry point (e.g. if database is busy then stop accepting requests at the web server)

If under load stop accepting requests and
  • process pending requests or
  • drop them all or
  • restart application 
If adjusting system make sure you're not just moving the load to some other component (e.g from CPU->HDD)

Things to check for

Java:
  • Pools size
  • Heap utilization
  • Garbe collection
  • Cache hit ratio
  • Messaging systems

Communication:
  • Network I/O (bytes r/w, throughput)
OS:
  • Disk I/O
  • CPU usage
  • Memory usage
  • Threads usage

Thursday, November 15, 2012

Notes on JUnit @After Annotation


Notes on JUnit @After Annotation:

  • All methods marked with @After are executed
  • The method named tearDown executes even if it's not marked as @After
  • @After annotation is not inheritable so you need to add @After if you override the annotated method
  • Remember to call super.tearDown if you override tearDown in you class
  • For class hierarchies it is best to use different clean-up methods with different names, marked with @After, so they're all called automatically and you won't accidentally override them.