public static function getNumericValue($eventTags, $logger)
    {
        if (!$eventTags) {
            $logger->log(Logger::DEBUG, "Event tags is undefined.");
            return null;
        }

        if (!is_array($eventTags)) {
            $logger->log(Logger::DEBUG, "Event tags is not a dictionary.");
            return null;
        }

        if (!isset($eventTags[self::NUMERIC_EVENT_METRIC_NAME])) {
            $logger->log(Logger::DEBUG, "The numeric metric key is not defined in the event tags or is null.");
            return null;
        }

        if (!is_numeric($eventTags[self::NUMERIC_EVENT_METRIC_NAME])) {
            $logger->log(Logger::DEBUG, "Numeric metric value is not an integer or float, or is not a numeric string.");
            return null;
        }

        if (is_nan($eventTags[self::NUMERIC_EVENT_METRIC_NAME]) || is_infinite(floatval($eventTags[self::NUMERIC_EVENT_METRIC_NAME]))) {
            $logger->log(Logger::DEBUG, "Provided numeric value is in an invalid format.");
            return null;
        }

        $rawValue = $eventTags[self::NUMERIC_EVENT_METRIC_NAME];
        // # Log the final numeric metric value
        $logger->log(Logger::INFO, "The numeric metric value {$rawValue} will be sent to results.");

        return floatval($rawValue);
    }
public static function getNumericValue($eventTags, $logger)
    {
        if (!$eventTags) {
            $logger->log(Logger::DEBUG, "Event tags is undefined.");
            return null;
        }

        if (!is_array($eventTags)) {
            $logger->log(Logger::DEBUG, "Event tags is not a dictionary.");
            return null;
        }

        if (!isset($eventTags[self::NUMERIC_EVENT_METRIC_NAME])) {
            $logger->log(Logger::DEBUG, "The numeric metric key is not defined in the event tags or is null.");
            return null;
        }

        if (!is_numeric($eventTags[self::NUMERIC_EVENT_METRIC_NAME])) {
            $logger->log(Logger::DEBUG, "Numeric metric value is not an integer or float, or is not a numeric string.");
            return null;
        }

        if (is_nan($eventTags[self::NUMERIC_EVENT_METRIC_NAME]) || is_infinite(floatval($eventTags[self::NUMERIC_EVENT_METRIC_NAME]))) {
            $logger->log(Logger::DEBUG, "Provided numeric value is in an invalid format.");
            return null;
        }

        $rawValue = $eventTags[self::NUMERIC_EVENT_METRIC_NAME];
        // # Log the final numeric metric value
        $logger->log(Logger::INFO, "The numeric metric value {$rawValue} will be sent to results.");

        return floatval($rawValue);
    }
public static function getNumericValue ( $ eventTags , $ logger ) { if ( ! $ eventTags ) { $ logger -> log ( Logger :: DEBUG , "Event tags is undefined." ) ; return null ; } if ( ! is_array ( $ eventTags ) ) { $ logger -> log ( Logger :: DEBUG , "Event tags is not a dictionary." ) ; return null ; } if ( ! isset ( $ eventTags [ self :: NUMERIC_EVENT_METRIC_NAME ] ) ) { $ logger -> log ( Logger :: DEBUG , "The numeric metric key is not defined in the event tags or is null." ) ; return null ; } if ( ! is_numeric ( $ eventTags [ self :: NUMERIC_EVENT_METRIC_NAME ] ) ) { $ logger -> log ( Logger :: DEBUG , "Numeric metric value is not an integer or float, or is not a numeric string." ) ; return null ; } if ( is_nan ( $ eventTags [ self :: NUMERIC_EVENT_METRIC_NAME ] ) || is_infinite ( floatval ( $ eventTags [ self :: NUMERIC_EVENT_METRIC_NAME ] ) ) ) { $ logger -> log ( Logger :: DEBUG , "Provided numeric value is in an invalid format." ) ; return null ; } $ rawValue = $ eventTags [ self :: NUMERIC_EVENT_METRIC_NAME ] ; // # Log the final numeric metric value $ logger -> log ( Logger :: INFO , "The numeric metric value {$rawValue} will be sent to results." ) ; return floatval ( $ rawValue ) ; }
Grab the numeric event value from the event tags. "value" is a reserved keyword.
The value of 'value' can be a float or a numeric string

@param $eventTags array Representing metadata associated with the event.
@param $logger instance of LoggerInterface

@return float value of 'value' or null
Grab the numeric event value from the event tags . value is a reserved keyword . The value of value can be a float or a numeric string