<commit_before>package controllers

import com.gu.management._
import com.gu.management.play.ManagementController
import com.gu.management.logback._

// example of creating your own new page type
class DummyPage extends ManagementPage {
  val path = "/management/dummy"
  def get(request: HttpRequest) = PlainTextResponse("Hello dummy!")
}

// switches
object Switches {
  val omniture = new DefaultSwitch("omniture", "enables omniture java script")
  val takeItDown = new DefaultSwitch("take-it-down", "enable this switch to take the site down", initiallyOn = false)

  val all = List(omniture, takeItDown, Healthcheck.switch)
}

// timing stuff
object TimingMetrics {
  val downtime = new TimingMetric("example", "downtime", "downtime", "Amount of downtime")
  val requests = new TimingMetric("example", "requests", "requests", "Number of requests recieved")

  val all = List(downtime, requests)
}

// properties
object Properties {
  // If I were using com.gu.configuration I'd comment out the following line
  // val all = new ConfigurationFactory getConfiguration ("music", "conf/arts_music").toString
  val all = "key1=value1\nkey2=value2"
}

object Management extends ManagementController {
  val applicationName: String = "Example Play App"
  lazy val pages = List(
    new DummyPage(),
    new ManifestPage(),
    new Switchboard(Switches.all, applicationName),
    StatusPage(applicationName, ExceptionCountMetric :: ServerErrorCounter :: ClientErrorCounter :: TimingMetrics.all),
    new HealthcheckManagementPage(),
    new PropertiesPage(Properties.all),
    new LogbackLevelPage(applicationName)
  )
}
<commit_msg>Fix example-play app<commit_after>package controllers

import com.gu.management._
import com.gu.management.play.ManagementController
import com.gu.management.logback._

// example of creating your own new page type
class DummyPage extends ManagementPage {
  val path = "/management/dummy"
  def get(request: HttpRequest) = PlainTextResponse("Hello dummy!")
}

// switches
object Switches {
  val omniture = new DefaultSwitch("omniture", "enables omniture java script")
  val takeItDown = new DefaultSwitch("take-it-down", "enable this switch to take the site down", initiallyOn = false)

  val all = List(omniture, takeItDown, Healthcheck.switch)
}

// timing stuff
object TimingMetrics {
  val downtime = new TimingMetric("example", "downtime", "downtime", "Amount of downtime")
  val requests = new TimingMetric("example", "requests", "requests", "Number of requests recieved")

  val all = List(downtime, requests)
}

// properties
object Properties {
  // If I were using com.gu.configuration I'd comment out the following line
  // val all = new ConfigurationFactory getConfiguration ("music", "conf/arts_music").toString
  val all = "key1=value1\nkey2=value2"
}

object Management extends ManagementController {
  val applicationName: String = "Example Play App"
  lazy val pages = List(
    new DummyPage(),
    new ManifestPage(),
    new Switchboard(applicationName, Switches.all),
    StatusPage(applicationName, ExceptionCountMetric :: ServerErrorCounter :: ClientErrorCounter :: TimingMetrics.all),
    new HealthcheckManagementPage(),
    new PropertiesPage(Properties.all),
    new LogbackLevelPage(applicationName)
  )
}

{'fraction_non_alphanumeric': 0.10137825421133231, 'fraction_numerical': 0.002450229709035222, 'mean_word_length': 4.916666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6531481', 'n_tokens_mistral': 925, 'n_tokens_neox': 894, 'n_words': 284}