<commit_before>package io.vamp.core.rest_api

import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import io.vamp.common.akka.ActorSupport
import io.vamp.common.http.{InfoBaseRoute, InfoMessageBase, RestApiBase}
import io.vamp.common.vitals.JvmVitals
import io.vamp.core.container_driver.ContainerDriverActor
import io.vamp.core.persistence.PersistenceActor
import io.vamp.core.pulse_driver.PulseDriverActor
import io.vamp.core.router_driver.RouterDriverActor

import scala.concurrent.Future
import scala.concurrent.duration._
import scala.language.{existentials, postfixOps}

case class InfoMessage(message: String, jvm: JvmVitals, persistence: Any, router: Any, pulse: Any, containerDriver: Any) extends InfoMessageBase

trait InfoRoute extends InfoBaseRoute {
  this: RestApiBase =>

  val infoMessage = ConfigFactory.load().getString("vamp.core.rest-api.info.message")

  val componentInfoTimeout = Timeout(ConfigFactory.load().getInt("vamp.core.rest-api.info.timeout") seconds)

  def info(jvm: JvmVitals): Future[InfoMessageBase] = info(Set(PersistenceActor, RouterDriverActor, PulseDriverActor, ContainerDriverActor).map(ActorSupport.alias)).map { result =>
    InfoMessage(infoMessage,
      jvm,
      result.get(ActorSupport.alias(PersistenceActor)),
      result.get(ActorSupport.alias(RouterDriverActor)),
      result.get(ActorSupport.alias(PulseDriverActor)),
      result.get(ActorSupport.alias(ContainerDriverActor))
    )
  }
}<commit_msg>info version<commit_after>package io.vamp.core.rest_api

import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import io.vamp.common.akka.ActorSupport
import io.vamp.common.http.{InfoBaseRoute, InfoMessageBase, RestApiBase}
import io.vamp.common.vitals.JvmVitals
import io.vamp.core.container_driver.ContainerDriverActor
import io.vamp.core.persistence.PersistenceActor
import io.vamp.core.pulse_driver.PulseDriverActor
import io.vamp.core.router_driver.RouterDriverActor

import scala.concurrent.Future
import scala.concurrent.duration._
import scala.language.{existentials, postfixOps}

case class InfoMessage(message: String, version: String, jvm: JvmVitals, persistence: Any, router: Any, pulse: Any, containerDriver: Any) extends InfoMessageBase

trait InfoRoute extends InfoBaseRoute {
  this: RestApiBase =>

  val infoMessage = ConfigFactory.load().getString("vamp.core.rest-api.info.message")

  val componentInfoTimeout = Timeout(ConfigFactory.load().getInt("vamp.core.rest-api.info.timeout") seconds)

  def info(jvm: JvmVitals): Future[InfoMessageBase] = info(Set(PersistenceActor, RouterDriverActor, PulseDriverActor, ContainerDriverActor).map(ActorSupport.alias)).map { result =>
    InfoMessage(infoMessage,
      getClass.getPackage.getImplementationVersion,
      jvm,
      result.get(ActorSupport.alias(PersistenceActor)),
      result.get(ActorSupport.alias(RouterDriverActor)),
      result.get(ActorSupport.alias(PulseDriverActor)),
      result.get(ActorSupport.alias(ContainerDriverActor))
    )
  }
}
{'fraction_non_alphanumeric': 0.10479041916167664, 'fraction_numerical': 0.0, 'mean_word_length': 6.108747044917258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '255942', 'n_tokens_mistral': 911, 'n_tokens_neox': 903, 'n_words': 150}