diff options
author | Vlad Uspensky <v.uspenskiy@icloud.com> | 2017-04-13 10:22:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-13 10:22:34 -0700 |
commit | e53941b339c08269c40b0f2bb9eb123917a2f971 (patch) | |
tree | 1c88759d0cd63e5009d3173f695011c447a2e500 /src/main/scala/xyz/driver/core/stats.scala | |
parent | 24596a3a6f27c53f6c2de844c0f89a9194adb8fb (diff) | |
parent | 2d0aba0eaf360c521d9bcfbf48dc748b777301d2 (diff) | |
download | driver-core-0.12.0.tar.gz driver-core-0.12.0.tar.bz2 driver-core-0.12.0.zip |
Merge pull request #33 from drivergroup/PDW-598v0.12.0
PDW-598 Getting rid of log wrapper
Diffstat (limited to 'src/main/scala/xyz/driver/core/stats.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/stats.scala | 39 |
1 files changed, 0 insertions, 39 deletions
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) |