private static String computerName() {
        final String hostName;

        try {
            hostName = InetAddress.getLocalHost().getHostName();
            if (hostName != null && !hostName.isEmpty()) {
                return hostName;
            }
        } catch (final Exception ex) {
            // Ignore exception.
        }

        return Optional.ofNullable(System.getenv("COMPUTERNAME"))
            .orElseGet(() -> Optional.ofNullable(System.getenv("HOSTNAME"))
                .orElse("unknown")
            );
    }
Utility class for reporting events to the statistics manager.

@author Emil Forslund
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/util/Statistics.java