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

com.twitter.finagle.mux.lease.exp.GarbageCollectorAddable.scala Maven / Gradle / Ivy

There is a newer version: 24.2.0
Show newest version
package com.twitter.finagle.mux.lease.exp

import java.lang.management.GarbageCollectorMXBean

class GarbageCollectorAddable(self: GarbageCollectorMXBean) {
  def +(other: GarbageCollectorMXBean): GarbageCollectorMXBean = new GarbageCollectorMXBean {
    def getCollectionCount() =
      self.getCollectionCount() + other.getCollectionCount()
    def getCollectionTime() =
      self.getCollectionTime() + other.getCollectionTime()
    def getMemoryPoolNames() =
      Array.concat(self.getMemoryPoolNames(), other.getMemoryPoolNames())
    def getName() = self.getName() + "+" + other.getName()
    def isValid() = self.isValid || other.isValid
    def getObjectName = throw new UnsupportedOperationException
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy