@Override
        public Future<Class> load(final String script) throws Exception {
            final long start = System.currentTimeMillis();

            return CompletableFuture.supplyAsync(() -> {
                try {
                    return loader.parseClass(script, generateScriptName());
                } catch (CompilationFailedException e) {
                    final long finish = System.currentTimeMillis();
                    log.error("Script compilation FAILED {} took {}ms {}", script, finish - start, e);
                    failedCompilationCount.incrementAndGet();
                    throw e;
                } finally {
                    final long time = System.currentTimeMillis() - start;
                    if (time > expectedCompilationTime) {
                        //We warn if a script took longer than a few seconds. Repeatedly seeing these warnings is a sign that something is wrong.
                        //Scripts with a large numbers of parameters often trigger this and should be avoided.
                        log.warn("Script compilation {} took {}ms", script, time);
                        longRunCompilationCount.incrementAndGet();
                    } else {
                        log.debug("Script compilation {} took {}ms", script, time);
                    }
                }
            }, Runnable::run);

        }
Gets the total number of nanoseconds that the cache spent compiling scripts.
gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java