public static function end() { // Already ended (skip it) if (self::$_ended === true) { return; } // Connection not available (run failed) if (empty(self::$_connection)) { return; } self::$_connection['end'] = microtime(true); self::$_connection['exec_time'] = round(self::$_connection['end'] - self::$_connection['start'] - self::$_throttle / 1000000, 3); self::$_connection['memory'] = memory_get_peak_usage(); try { self::backend()->set("connection-" . self::$_connectionKey, self::$_connection); self::backend()->clean(); } catch (Exception $e) { } self::$_ended = true; }