Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds dropwizard metrics, overhaul of how application is initialized #82

Merged
merged 17 commits into from
Aug 22, 2016

Conversation

hanswesterbeek
Copy link
Contributor

@hanswesterbeek hanswesterbeek commented Aug 18, 2016

Migrated to use of play 2.4-recommended dependency injection, 'compile-time' variant. That means far less static classes, greater testability and the ability to keep upgrading Play, as they are sure to deprecate 'object' components.

Did not use the run-time variant (which relies on Guice) because it is unneeded and requires programmers to learn another framework.

Note: Considering the fact that the init-overhaul is so fundamental, a full re-test of the app is required before merging this branch. I have processed the 'first' sip.zip with success. Works on my machine :)

…e-time dependency injection' which is akin to Spring Java Config.

Doing so has exposed the org.OrgContext companion object for what it is: a holder of configuration and singleton instances that gets passed around between anyone and everyone. One by one, each property of the OrgContext class should be removed until every component is only injected with exactly the values or collaborators it requires.

Metrics are now available on /non-public/monitoring/metrics. When deploying this application you should disallow users to that url using nginx, apache etc.
Remove useless 'logBulkApi' switch.
…t-time. Keep it as a member of the to-be-removed OrgContext for now as an intermediary step.
…gActor-actorref was created more than once, which Akka does not like.
@hanswesterbeek hanswesterbeek changed the title Adds dropwizzard metrics, overhaul of how application is initialized Adds dropwizard metrics, overhaul of how application is initialized Aug 18, 2016
@kiivihal
Copy link
Member

I have been testing this pull-request and ran into an issue during the initial PMH harvest:

  • error in the interface: While Harvesting, failure: play.api.libs.ws.WSAPI
  • stacktrace:
java.lang.InstantiationException: play.api.libs.ws.WSAPI
    at java.lang.Class.newInstance(Class.java:427)
    at play.api.inject.NewInstanceInjector$.instanceOf(Injector.scala:49)
    at play.api.inject.SimpleInjector$$anonfun$instanceOf$1.apply(Injector.scala:85)
    at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
    at scala.collection.AbstractMap.getOrElse(Map.scala:59)
    at play.api.inject.SimpleInjector.instanceOf(Injector.scala:85)
    at play.api.inject.SimpleInjector.instanceOf(Injector.scala:80)
    at play.api.Application$$anonfun$instanceCache$1.apply(Application.scala:235)
    at play.api.Application$$anonfun$instanceCache$1.apply(Application.scala:235)
    at play.utils.InlineCache.fresh(InlineCache.scala:69)
    at play.utils.InlineCache.apply(InlineCache.scala:55)
    at play.api.libs.ws.WS$.wsapi(WS.scala:94)
    at play.api.libs.ws.WS$.url(WS.scala:121)
    at harvest.Harvesting$class.fetchPMHPage(Harvesting.scala:178)
    at harvest.Harvester.fetchPMHPage(Harvester.scala:48)
    at harvest.Harvester$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Harvester.scala:161)
    at nxutil.Utils$.actorWork(Utils.scala:22)
    at harvest.Harvester$$anonfun$receive$1.applyOrElse(Harvester.scala:158)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
    at harvest.Harvester.aroundReceive(Harvester.scala:48)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
    at akka.actor.ActorCell.invoke(ActorCell.scala:487)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
    at akka.dispatch.Mailbox.run(Mailbox.scala:220)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.NoSuchMethodException: play.api.libs.ws.WSAPI.<init>()
    at java.lang.Class.getConstructor0(Class.java:3082)
    at java.lang.Class.newInstance(Class.java:412)
... 28 more

@hanswesterbeek
Copy link
Contributor Author

How to reproduce?

…ecome apparent when you hit them at runtime. Thank you, Play Framework!
@hanswesterbeek
Copy link
Contributor Author

hanswesterbeek commented Aug 19, 2016

Obtained repro-scenario out of band and verified through UI that it works.

@kiivihal the ball is in your court again :)

@codecov-io
Copy link

codecov-io commented Aug 19, 2016

Current coverage is 0.00% (diff: 0.00%)

Merging #82 into develop will not change coverage

@@           develop    #82   diff @@
=====================================
  Files           50     52      +2   
  Lines           51   3934   +3883   
  Methods          0      0           
  Messages         0      0           
  Branches         3    159    +156   
=====================================
  Hits             0      0           
- Misses          51   3934   +3883   
  Partials         0      0           

Powered by Codecov. Last update fc78e11...d123c33

@kiivihal
Copy link
Member

I have verified that the harvesting and incremental harvesting now works again. I will merge this pull-request.

@kiivihal kiivihal merged commit 5299b2c into develop Aug 22, 2016
@kiivihal kiivihal deleted the feature/metrics branch August 22, 2016 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants