From d75f6852930438dbda560cf601620361074335fd Mon Sep 17 00:00:00 2001 From: volodya-lombrozo Date: Tue, 12 Nov 2024 17:19:01 +0300 Subject: [PATCH] feat(#834): add a bit of logging --- src/it/jna/invoker.properties | 2 +- .../org/eolang/jeo/representation/CanonicalXmir.java | 12 +++++++++++- .../eolang/jeo/representation/CanonicalXmirTest.java | 9 --------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/it/jna/invoker.properties b/src/it/jna/invoker.properties index 33a60fead..85d4581e0 100644 --- a/src/it/jna/invoker.properties +++ b/src/it/jna/invoker.properties @@ -30,4 +30,4 @@ # Just to compare, the 'short' path takes 13 seconds to run, while the 'full' path # takes 31 minutes. invoker.goals=clean verify -e -B -invoker.profiles=full \ No newline at end of file +invoker.profiles=short \ No newline at end of file diff --git a/src/main/java/org/eolang/jeo/representation/CanonicalXmir.java b/src/main/java/org/eolang/jeo/representation/CanonicalXmir.java index c7e7121b2..d400197a4 100644 --- a/src/main/java/org/eolang/jeo/representation/CanonicalXmir.java +++ b/src/main/java/org/eolang/jeo/representation/CanonicalXmir.java @@ -23,6 +23,7 @@ */ package org.eolang.jeo.representation; +import com.jcabi.log.Logger; import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; import com.yegor256.xsline.Shift; @@ -127,7 +128,16 @@ private String toEo() { * @throws IOException If fails. */ private XML parse(final String eoprog) throws IOException { - return new EoSyntax(this.name, new InputOf(eoprog)).parsed(); + final long start = System.currentTimeMillis(); + final XML parsed = new EoSyntax(this.name, new InputOf(eoprog)).parsed(); + final long end = System.currentTimeMillis(); + Logger.info( + this, + "We need to parse XMIR by using EoSyntax#parsed to make unrolling. The '%s' was parsed in %[ms]s", + this.name, + end - start + ); + return parsed; } /** diff --git a/src/test/java/org/eolang/jeo/representation/CanonicalXmirTest.java b/src/test/java/org/eolang/jeo/representation/CanonicalXmirTest.java index d24875d10..a86c98456 100644 --- a/src/test/java/org/eolang/jeo/representation/CanonicalXmirTest.java +++ b/src/test/java/org/eolang/jeo/representation/CanonicalXmirTest.java @@ -125,13 +125,4 @@ void unrollsSequenceOfValuesCorrectly() { ) ); } - - @Test - void unrollesRealFile() throws Exception { - new CanonicalXmir( - new XMLDocument( - new ResourceOf("xmir/Native.xmir").stream()) - ).plain(); - } - }