Ejemplo n.º 1
0
 /**
  * Creates a simple probe with the specified name.
  *
  * @param name the name of the probe.
  */
 public PerformanceProbe(String name) {
   this.probeName = name;
   this.outputPeriod = NOT_PERIODIC;
   this.doReset = false;
   add();
 }
Ejemplo n.º 2
0
 /**
  * Starts or stops monitoring this probe according to specified parameters. When monitoring is on,
  * this probe is periodically output at the specified period. If requested, the probe is reset
  * after each periodical output. When monitoring if off, this probe is only output when the JVM
  * terminates.
  *
  * <p>This method may be called several times during the execution of the JVM in order to start,
  * stop, restart, etc. monitoring or to change monitoring period.
  *
  * @param period the monitoring period; specifying {@link #NOT_PERIODIC} stops monitoring.
  * @param doReset {@code true} if the {@link #reset()} must be called after each output and {@code
  *     false} otherwise.
  */
 public void setMonitoring(long period, boolean doReset) {
   remove();
   this.outputPeriod = period;
   this.doReset = doReset;
   add();
 }