5

I work on a large-ish Java project. We are using maven as our build tool, and I use Intellij (14) as my IDE.

Currently, if I build the whole project (c. 15 modules) it takes about 3 minutes. Due to the way that we use our code (even in development), I end up doing a full build quite often. On the basis that "what gets measured gets managed", I'd like to be able to monitor/record:

  1. How many times an hour/day a build has been run?
  2. How much time has been spent running builds?
  3. If it were possible, to break this down by maven task - i.e. clean/compile/test/other plugins etc.

One approach might be to have the maven output dumped to files, and then have a process to read these/calculate the statistics I want. How should I approach this?

Just to be clear, I'm not asking for comments/advice on how to reduce our build-cycle runtime. We've already done a fair bit of work on this, and are continuing to work on it - indeed, I'm really looking for a way to monitor our effective progress on this.

amaidment
  • 428
  • 3
  • 12
  • 3
    if you're in a team using a source control system, thought about automizing your build-cycles and using something like [Jenkins](https://jenkins-ci.org/) ..you'd have pretty neat overviews about build-time, error-tracking and whatnot? – definitely undefinable Oct 09 '15 at 13:24
  • @definitely - Thanks - that's a helpful suggestion to monitor the build-time from day-to-day over time, and hopefully in a consistent environment. However, that doesn't take into account how often I am building the project (or sub-modules) in my daily development work. I'd really like to be able to (objectively) say I've spent x mins (or hours!) doing builds each day. (That would provide ammunition for arguing to spend time reducing the build time...) – amaidment Oct 09 '15 at 17:19
  • 1
    In Windows, [Performance Monitor](https://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx#id0120047) should be able to collect statistics on how long particular processes are running. Could you set up some perfmon counters for your build / compile / test executables? – Josh Kelley Oct 12 '15 at 12:10
  • 1
    Seems like a maven plugin should work, although I'm not finding one. – Sign Oct 12 '15 at 15:15
  • I try for that project but monitoring and make a storage is not better. I suggest you to use datasets.Its is useful for you to handle them easily. Its work well form me – Ponmari Subramanian Oct 12 '15 at 13:25
  • Tell IntelliJ to use an external maven installation, and then modify that to log the usage. – Thorbjørn Ravn Andersen Oct 14 '15 at 12:28
  • You could do the following: - Make a wrapper script for point 1. - Use maven profile (https://github.com/takari/maven-profiler) for point 2. Cheers, – darthfather Oct 14 '15 at 10:01
  • @ThorbjørnRavnAndersen - can you expand on that? What do you mean when you suggest modifying the external maven installation? – amaidment Oct 14 '15 at 13:24
  • 1
    To my understanding IntelliJ will invoke the "mvn" shell script whenever it needs things done (I might easily be wrong on this). This mean that you can hook into this script whatever you need. – Thorbjørn Ravn Andersen Oct 14 '15 at 14:02
  • @ChrisF - can you explain why this question has been closed? In my mind, it is a question about 'development methodologies and processes'. I had wondered whether to post it to StackOverflow, as a question about 'a practical, answerable problem that is unique to software development', but that migration was rejected. If the question is off-topic for both Programmers and StackOverflow, where does it belong? – amaidment Oct 29 '15 at 11:17
  • @amaidment I did migrate it to Stack Overflow based on a flag, but it was closed there - which caused the close reason here to be changed. I have no control over that. Perhaps rewording the question would help as it was closed on Stack Overflow - http://stackoverflow.com/questions/33178756/how-to-monitor-record-build-compile-test-time - for being too broad. – ChrisF Oct 29 '15 at 11:23

0 Answers0