From 06151bfd4b77eefa1c8630d6db8fab207ff40ce9 Mon Sep 17 00:00:00 2001 From: Xavier Hanin Date: Tue, 4 Dec 2007 20:39:16 +0000 Subject: [PATCH] IMPROVEMENT: Ease performance auditing (IVY-655) git-svn-id: https://svn.apache.org/repos/asf/ant/ivy/core/trunk@601077 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + doc/configuration/triggers.html | 67 ++++++++- src/java/org/apache/ivy/Ivy.java | 2 +- .../core/event/download/DownloadEvent.java | 1 + .../download/EndArtifactDownloadEvent.java | 6 +- .../resolve/EndResolveDependencyEvent.java | 22 ++- .../core/event/resolve/EndResolveEvent.java | 6 + .../event/resolve/ResolveDependencyEvent.java | 1 + .../core/event/retrieve/EndRetrieveEvent.java | 83 ++++++++++++ .../core/event/retrieve/RetrieveEvent.java | 46 +++++++ .../event/retrieve/StartRetrieveEvent.java | 29 ++++ .../core/report/ArtifactDownloadReport.java | 7 +- .../apache/ivy/core/report/ResolveReport.java | 28 +++- .../org/apache/ivy/core/resolve/IvyNode.java | 4 +- .../ivy/core/resolve/ResolveEngine.java | 9 +- .../ivy/core/retrieve/RetrieveEngine.java | 26 +++- .../ivy/core/settings/typedef.properties | 1 + .../ivy/plugins/repository/TransferEvent.java | 105 ++++++++++++--- .../ivy/plugins/trigger/LogTrigger.java | 127 ++++++++++++++++++ src/java/org/apache/ivy/util/FileUtil.java | 73 +++++++++- .../ivy/core/retrieve/RetrieveTest.java | 37 +++++ .../ivy/plugins/trigger/LogTriggerTest.java | 91 +++++++++++++ 22 files changed, 722 insertions(+), 50 deletions(-) create mode 100644 src/java/org/apache/ivy/core/event/retrieve/EndRetrieveEvent.java create mode 100644 src/java/org/apache/ivy/core/event/retrieve/RetrieveEvent.java create mode 100644 src/java/org/apache/ivy/core/event/retrieve/StartRetrieveEvent.java create mode 100644 src/java/org/apache/ivy/plugins/trigger/LogTrigger.java create mode 100644 test/java/org/apache/ivy/plugins/trigger/LogTriggerTest.java diff --git a/CHANGES.txt b/CHANGES.txt index 895cea79..5bfad407 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -62,6 +62,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br - NEW: Add a task/code to create M2 POM files from Ivy configurations (IVY-416) - NEW: [Build] Publish the ivy sources (IVY-646) (thanks to Nicolas Lalevée) +- IMPROVEMENT: Ease performance auditing (IVY-655) - IMPROVEMENT: Maven Dependency Management is not used to determine artifact version (IVY-616) (thanks to Jim Bonanno) - IMPROVEMENT: split the cache into an downloaded artifacts cache and a metadata cache (IVY-628) - IMPROVEMENT: add publish triggers to event system (IVY-650) (thanks to Jason Trump) diff --git a/doc/configuration/triggers.html b/doc/configuration/triggers.html index 9f69a30b..4a19bb82 100644 --- a/doc/configuration/triggers.html +++ b/doc/configuration/triggers.html @@ -50,30 +50,33 @@ The event available in Ivy are the following ones:
  • conf
  • comma separated list of configurations which will be resolved - Fired before a module dependencies will be resolved + Fired at the beginning of the resolve process, before a module dependencies and transitive dependencies are resolved. pre-resolve-dependency - Fired before each dependency is resolved in a single resolve call + Fired before each dependency is resolved. In this case resolved means resolving the actual revision if the requested revision is a version constraint and not a static version, and downloading all necessary metadata information. post-resolve-dependency - Fired after each dependency resolved in a single resolve call + Fired after each dependency is resolved post-resolve @@ -82,9 +85,15 @@ The event available in Ivy are the following ones:
  • module
  • the name of the module for which the dependencies have been resolved
  • revision
  • the revision of the module for which the dependencies have been resolved
  • conf
  • comma separated list of configurations resolved +
  • resolve-id
  • the identifier of the resolution process since 2.0 +
  • nb-dependencies
  • total number of dependencies, including transitive and evicted ones since 2.0 +
  • nb-artifacts
  • total number of artifacts resolved, excluding metadata artifacts since 2.0 +
  • resolve-duration
  • the time (in ms) elapsed to resolve dependencies, before dowloading artifacts since 2.0 +
  • download-duration
  • the time (in ms) elapsed to download all artifacts, excluding metadata artifacts downloaded during the first phase of the resolution process since 2.0 +
  • download-size
  • the total size (in bytes) of all downloaded artifacts, excluding metadata artifacts. Only artifacts actually downloaded (not in cache or used from their original location) are considered since 2.0 - Fired after a module dependencies has been resolved + Fired at the end of the resolve process, when all module dependencies have been resolved pre-download-artifact @@ -95,6 +104,7 @@ The event available in Ivy are the following ones:
  • artifact
  • the name of the the artifact which is about to be downloaded
  • type
  • the type of the the artifact which is about to be downloaded
  • ext
  • the extension of the the artifact which is about to be downloaded +
  • metadata
  • true if the artifact to be downloaded is a metadata artifact, false for published artifacts since 2.0
  • resolver
  • the name of the resolver used to download the artifact
  • origin
  • the origin location from which it will be downloaded
  • local
  • true if it's a local artifact, false otherwise @@ -111,15 +121,47 @@ The event available in Ivy are the following ones:
  • artifact
  • the name of the the artifact which was just downloaded
  • type
  • the type of the the artifact which was just downloaded
  • ext
  • the extension of the the artifact which was just downloaded +
  • metadata
  • true if the downloaded artifact is a metadata artifact, false for published artifacts since 2.0
  • resolver
  • the name of the resolver used to download the artifact
  • origin
  • the origin location from which it was downloaded
  • local
  • true if it's a local artifact, false otherwise
  • size
  • the size in bytes of the downloaded artifact +
  • duration
  • the time elapsed to download the artifact (in ms) since 2.0
  • file
  • the file to which it has been downloaded Fired after an artifact has been downloaded from a repository to the cache + pre-retrieve
    since 2.0 + + + + Fired at the beginning of the retrieve process. + + post-retrieve
    since 2.0 + + + + Fired at the end of the retrieve process. + pre-publish-artifact
    since 2.0