From fbf25ed06bf87af2d139ae58f208d9bb5b299e03 Mon Sep 17 00:00:00 2001 From: vlad Date: Wed, 12 Apr 2017 16:54:02 -0700 Subject: PDW-598 Getting rid of log wrapper --- src/main/scala/xyz/driver/core/stats.scala | 39 ------------------------------ 1 file changed, 39 deletions(-) (limited to 'src/main/scala/xyz/driver/core/stats.scala') diff --git a/src/main/scala/xyz/driver/core/stats.scala b/src/main/scala/xyz/driver/core/stats.scala index 5759012..dbcf6e4 100644 --- a/src/main/scala/xyz/driver/core/stats.scala +++ b/src/main/scala/xyz/driver/core/stats.scala @@ -4,47 +4,8 @@ import java.io.File import java.lang.management.ManagementFactory import java.lang.reflect.Modifier -import xyz.driver.core.logging.Logger -import xyz.driver.core.time.{Time, TimeRange} - object stats { - type StatsKey = String - type StatsKeys = Seq[StatsKey] - - trait Stats { - - def recordStats(keys: StatsKeys, interval: TimeRange, value: BigDecimal): Unit - - def recordStats(keys: StatsKeys, interval: TimeRange, value: Int): Unit = - recordStats(keys, interval, BigDecimal(value)) - - def recordStats(key: StatsKey, interval: TimeRange, value: BigDecimal): Unit = - recordStats(Vector(key), interval, value) - - def recordStats(key: StatsKey, interval: TimeRange, value: Int): Unit = - recordStats(Vector(key), interval, BigDecimal(value)) - - def recordStats(keys: StatsKeys, time: Time, value: BigDecimal): Unit = - recordStats(keys, TimeRange(time, time), value) - - def recordStats(keys: StatsKeys, time: Time, value: Int): Unit = - recordStats(keys, TimeRange(time, time), BigDecimal(value)) - - def recordStats(key: StatsKey, time: Time, value: BigDecimal): Unit = - recordStats(Vector(key), TimeRange(time, time), value) - - def recordStats(key: StatsKey, time: Time, value: Int): Unit = - recordStats(Vector(key), TimeRange(time, time), BigDecimal(value)) - } - - class LogStats(log: Logger) extends Stats { - def recordStats(keys: StatsKeys, interval: TimeRange, value: BigDecimal): Unit = { - val valueString = value.bigDecimal.toPlainString - log.audit(s"${keys.mkString(".")}(${interval.start.millis}-${interval.end.millis})=$valueString") - } - } - final case class MemoryStats(free: Long, total: Long, max: Long) final case class GarbageCollectorStats(totalGarbageCollections: Long, garbageCollectionTime: Long) -- cgit v1.2.3