aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/core/stats.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/core/stats.scala')
-rw-r--r--src/main/scala/xyz/driver/core/stats.scala39
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)