src/PhpProxyBuilder/Aop/Advice/InstrumentationAdvice.php
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) {
        $time = $this->monitor->getTime();

        if ($this->namePrefix) {
            $name = $this->namePrefix;
        } else {
            $name = get_class($jointPoint->getTarget());
        }
        if ($this->metricPerMethod) {
            $name .= '.' . $jointPoint->getMethodName();
        }

        try {
            $result = $jointPoint->proceed();
            $this->monitor->incrementTimer($name . self::SUFFIX_SUCCESS, $time);
            $this->monitor->incrementCounter($name . self::SUFFIX_SUCCESS);
            return $result;
        } catch (Exception $e) {
            $this->monitor->incrementTimer($name . self::SUFFIX_EXCEPTION, $time);
            $this->monitor->incrementCounter($name . self::SUFFIX_EXCEPTION);
            throw $e;
        }
    }
public function interceptMethodCall(ProceedingJoinPointInterface $jointPoint) {
        $time = $this->monitor->getTime();

        if ($this->namePrefix) {
            $name = $this->namePrefix;
        } else {
            $name = get_class($jointPoint->getTarget());
        }
        if ($this->metricPerMethod) {
            $name .= '.' . $jointPoint->getMethodName();
        }

        try {
            $result = $jointPoint->proceed();
            $this->monitor->incrementTimer($name . self::SUFFIX_SUCCESS, $time);
            $this->monitor->incrementCounter($name . self::SUFFIX_SUCCESS);
            return $result;
        } catch (Exception $e) {
            $this->monitor->incrementTimer($name . self::SUFFIX_EXCEPTION, $time);
            $this->monitor->incrementCounter($name . self::SUFFIX_EXCEPTION);
            throw $e;
        }
    }
public function interceptMethodCall ( ProceedingJoinPointInterface $ jointPoint ) { $ time = $ this -> monitor -> getTime ( ) ; if ( $ this -> namePrefix ) { $ name = $ this -> namePrefix ; } else { $ name = get_class ( $ jointPoint -> getTarget ( ) ) ; } if ( $ this -> metricPerMethod ) { $ name .= '.' . $ jointPoint -> getMethodName ( ) ; } try { $ result = $ jointPoint -> proceed ( ) ; $ this -> monitor -> incrementTimer ( $ name . self :: SUFFIX_SUCCESS , $ time ) ; $ this -> monitor -> incrementCounter ( $ name . self :: SUFFIX_SUCCESS ) ; return $ result ; } catch ( Exception $ e ) { $ this -> monitor -> incrementTimer ( $ name . self :: SUFFIX_EXCEPTION , $ time ) ; $ this -> monitor -> incrementCounter ( $ name . self :: SUFFIX_EXCEPTION ) ; throw $ e ; } }
In this implementation we measure time and count every method call

@param ProceedingJoinPointInterface $jointPoint
@return mixed
In this implementation we measure time and count every method call