Skip to content

Commit

Permalink
- Added logging for the port that the profiler server successfully
Browse files Browse the repository at this point in the history
  starts up on
- Corrected the error recording to drop the oldest errors when at
  capacity.
  • Loading branch information
Jeff Fenchel committed Dec 17, 2015
1 parent a405998 commit 87bc2aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Sets up a simple embedded HTTP server for interacting with the profiler while it runs
*
* @author Andrew Johnson
*/
public class ProfilerServer {
private static final Logger log = Logger.getLogger(ProfilerServer.class.getName());
private static final Vertx vertx = VertxFactory.newVertx();

/**
Expand All @@ -36,6 +39,8 @@ public void handle(AsyncResult<HttpServer> event) {
if (event.failed()) {
server.close();
startServer(runningProfilers, activeProfilers, port + 1, isRunning, errors);
} else if (event.succeeded()) {
log.info("Profiler server started on port " + port);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void run() {
e.printStackTrace(pw);
errors.add(String.format("Received an error running profiler: %s, error: %s", profiler.getClass().getName(), sw.toString()));
if ( errors.size() > 10) {
errors.pollLast();
errors.pollFirst();
}
}
}
Expand Down

0 comments on commit 87bc2aa

Please sign in to comment.