All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gu.monitoring.Metrics.scala Maven / Gradle / Ivy

There is a newer version: 0.605
Show newest version
package com.gu.monitoring

import com.amazonaws.regions.{Regions, Region}

trait ApplicationMetrics extends CloudWatch {
  val region = Region.getRegion(Regions.EU_WEST_1)
  val application: String
  val stage: String
}


trait StatusMetrics extends CloudWatch {
  def putResponseCode(status: Int, responseMethod: String) {
    val statusClass = status / 100
    put(s"${statusClass}XX-response-code", 1, responseMethod)
  }
}

trait RequestMetrics extends CloudWatch {
  def putRequest {
    put("request-count", 1)
  }
}

trait AuthenticationMetrics extends CloudWatch {
  def putAuthenticationError {
    put("auth-error", 1)
  }
}

object CloudWatchHealth {
  var hasPushedMetricSuccessfully = false
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy