Improve GeneratorReactor timing 20/99420/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Jan 2022 09:37:29 +0000 (10:37 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 24 Jan 2022 09:37:29 +0000 (10:37 +0100)
Parts of generation are not covered by timer, make sure we measure the
entire execution.

Change-Id: If1ac6fee65f7569bffc7f124551819d12d27f046
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/GeneratorReactor.java

index 57d1899219ea70affc222d954799bd4736af61bf..ce2681193362f09a9ad1f632c288378896bc23d4 100644 (file)
@@ -120,6 +120,9 @@ public final class GeneratorReactor extends GeneratorContext implements Mutable
                 throw new IllegalStateException("Unhandled state" + state);
         }
 
+        // Start measuring time...
+        final Stopwatch sw = Stopwatch.createStarted();
+
         // Step 1a: walk all composite generators and resolve 'uses' statements to the corresponding grouping node,
         //          establishing implied inheritance ...
         linkUsesDependencies(children);
@@ -146,7 +149,6 @@ public final class GeneratorReactor extends GeneratorContext implements Mutable
          * Since our implementation class hierarchy captures all four statements involved in a common superclass, we can
          * perform this in a single pass.
          */
-        final Stopwatch sw = Stopwatch.createStarted();
         linkDependencies(children);
 
         // Step five: resolve all 'type leafref' and 'type identityref' statements, so they point to their