4. “A good programmer will not be lulled into
complacency by such reasoning, he will be wise to
look carefully at the critical code; but only after that
code has been identified”
in eXtreme Programming
5. lulled into complacency
• complacency: a feeling of quiet pleasure or security, often while unaware of
some potential danger
• lull: to give or lead to feel a false sense of safety; cause to be less alert, aware, or
watchful.
6. “It is often a mistake to make a priori judgments
about what parts of a program are really critical,
since the universal experience of programmers
who have been using measurement tools has been
that their intuitive guesses fail”
in eXtreme Programming
14. Hash Code / Equals
Must implement hash code as a necessary but not sufficient condition for
equality
The default implementation of hashCode() in Object class returns distinct
integers for different objects.
16. How
•Manually add some System.out.println
•Create some kind of javax.management beans to record time. They
can recorded manually and queried with tools later on.
•Use AOP Libraries to build Aspects which record code execution time.
•Build an JVMTI Agent, which uses APIs to add code and record
execution time.
22. Overhead
• CPU Overhead represents the additional CPU usage caused by
executing monitoring code.
• Memory overhead is caused by the additional data that is stored
within the application-> send data to remote server
• Network traffic. All solutions that follow a distributed approach will
also utilize the network to send data from the application to where it is stored
and processed.
24. Instrumentation
@Around(" call(void MyApp.method* (..)) ")
public void aroundMethodCall (final ProceedingJoinPoint joinPoint)
throws Throwable {
long cpuStart = threadMXBean.getCurrentThreadCpuTime();
joinPoint.proceed();
long cpuEnd = threadMXBean.getCurrentThreadCpuTime();
25. In Marketplace
• Live instance, continuous listing import running
• looking for classes with filter market*
• memory / cpu use before and after a complete task