maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject maven-resolver git commit: [MRESOLVER-14] Statistics should be calculated using System.nanoTime instead of System.currentTimeMillis.
Date Thu, 16 Mar 2017 22:30:08 GMT
Repository: maven-resolver
Updated Branches:
  refs/heads/master 101f53422 -> 9bf6abff7


[MRESOLVER-14] Statistics should be calculated using System.nanoTime instead of System.currentTimeMillis.

This closes #6


Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/9bf6abff
Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/9bf6abff
Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/9bf6abff

Branch: refs/heads/master
Commit: 9bf6abff705f84327de94bf5c85ee0a98c814c2e
Parents: 101f534
Author: Christian Schulte <cs@schulte.it>
Authored: Sun Mar 12 00:30:30 2017 +0100
Committer: Christian Schulte <schulte@apache.org>
Committed: Thu Mar 16 23:29:48 2017 +0100

----------------------------------------------------------------------
 .../aether/internal/impl/DefaultDependencyCollector.java       | 6 +++---
 .../aether/util/graph/transformer/ConflictIdSorter.java        | 6 +++---
 .../eclipse/aether/util/graph/transformer/ConflictMarker.java  | 6 +++---
 .../aether/util/graph/transformer/ConflictResolver.java        | 4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9bf6abff/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
----------------------------------------------------------------------
diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
index e2e3979..35ede64 100644
--- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
+++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java
@@ -169,7 +169,7 @@ public class DefaultDependencyCollector
         List<Dependency> managedDependencies = request.getManagedDependencies();
 
         Map<String, Object> stats = logger.isDebugEnabled() ? new LinkedHashMap<String,
Object>() : null;
-        long time1 = System.currentTimeMillis();
+        long time1 = System.nanoTime();
 
         DefaultDependencyNode node;
         if ( root != null )
@@ -271,7 +271,7 @@ public class DefaultDependencyCollector
             errorPath = results.errorPath;
         }
 
-        long time2 = System.currentTimeMillis();
+        long time2 = System.nanoTime();
 
         DependencyGraphTransformer transformer = session.getDependencyGraphTransformer();
         if ( transformer != null )
@@ -291,7 +291,7 @@ public class DefaultDependencyCollector
 
         if ( stats != null )
         {
-            long time3 = System.currentTimeMillis();
+            long time3 = System.nanoTime();
             stats.put( "DefaultDependencyCollector.collectTime", time2 - time1 );
             stats.put( "DefaultDependencyCollector.transformTime", time3 - time2 );
             logger.debug( "Dependency collection stats: " + stats );

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9bf6abff/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java
----------------------------------------------------------------------
diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java
index c2122fa..5cc6432 100644
--- a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java
+++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java
@@ -63,7 +63,7 @@ public final class ConflictIdSorter
 
         @SuppressWarnings( "unchecked" )
         Map<String, Object> stats = (Map<String, Object>) context.get( TransformationContextKeys.STATS
);
-        long time1 = System.currentTimeMillis();
+        long time1 = System.nanoTime();
 
         Map<Object, ConflictId> ids = new LinkedHashMap<Object, ConflictId>(
256 );
 
@@ -81,13 +81,13 @@ public final class ConflictIdSorter
             buildConflitIdDAG( ids, node, id, 0, visited, conflictIds );
         }
 
-        long time2 = System.currentTimeMillis();
+        long time2 = System.nanoTime();
 
         int cycles = topsortConflictIds( ids.values(), context );
 
         if ( stats != null )
         {
-            long time3 = System.currentTimeMillis();
+            long time3 = System.nanoTime();
             stats.put( "ConflictIdSorter.graphTime", time2 - time1 );
             stats.put( "ConflictIdSorter.topsortTime", time3 - time2 );
             stats.put( "ConflictIdSorter.conflictIdCount", ids.size() );

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9bf6abff/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java
----------------------------------------------------------------------
diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java
index a3fb483..fe2f5d5 100644
--- a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java
+++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java
@@ -55,14 +55,14 @@ public final class ConflictMarker
     {
         @SuppressWarnings( "unchecked" )
         Map<String, Object> stats = (Map<String, Object>) context.get( TransformationContextKeys.STATS
);
-        long time1 = System.currentTimeMillis();
+        long time1 = System.nanoTime();
 
         Map<DependencyNode, Object> nodes = new IdentityHashMap<DependencyNode,
Object>( 1024 );
         Map<Object, ConflictGroup> groups = new HashMap<Object, ConflictGroup>(
1024 );
 
         analyze( node, nodes, groups, new int[] { 0 } );
 
-        long time2 = System.currentTimeMillis();
+        long time2 = System.nanoTime();
 
         Map<DependencyNode, Object> conflictIds = mark( nodes.keySet(), groups );
 
@@ -70,7 +70,7 @@ public final class ConflictMarker
 
         if ( stats != null )
         {
-            long time3 = System.currentTimeMillis();
+            long time3 = System.nanoTime();
             stats.put( "ConflictMarker.analyzeTime", time2 - time1 );
             stats.put( "ConflictMarker.markTime", time3 - time2 );
             stats.put( "ConflictMarker.nodeCount", nodes.size() );

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9bf6abff/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java
----------------------------------------------------------------------
diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java
b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java
index 5f9d8e0..6ccc508 100644
--- a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java
+++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java
@@ -144,7 +144,7 @@ public final class ConflictResolver
 
         @SuppressWarnings( "unchecked" )
         Map<String, Object> stats = (Map<String, Object>) context.get( TransformationContextKeys.STATS
);
-        long time1 = System.currentTimeMillis();
+        long time1 = System.nanoTime();
 
         @SuppressWarnings( "unchecked" )
         Collection<Collection<?>> conflictIdCycles =
@@ -231,7 +231,7 @@ public final class ConflictResolver
 
         if ( stats != null )
         {
-            long time2 = System.currentTimeMillis();
+            long time2 = System.nanoTime();
             stats.put( "ConflictResolver.totalTime", time2 - time1 );
             stats.put( "ConflictResolver.conflictItemCount", state.totalConflictItems );
         }


Mime
View raw message