Skip to content

Commit

Permalink
Merge pull request #76 from pgj/remove-field-cache-metrics
Browse files Browse the repository at this point in the history
chore: remove metrics on field cache size
  • Loading branch information
pgj authored Jun 2, 2023
2 parents c59127d + b99f969 commit 1f2c5e9
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/main/scala/com/cloudant/clouseau/IndexManagerService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import org.slf4j.LoggerFactory
import scalang._
import com.yammer.metrics.scala._
import scala.collection.JavaConversions._
import org.apache.lucene.search.FieldCache
import org.apache.lucene.util.RamUsageEstimator

class IndexManagerService(ctx: ServiceContext[ConfigurationArgs]) extends Service(ctx) with Instrumented {

Expand Down Expand Up @@ -97,20 +95,6 @@ class IndexManagerService(ctx: ServiceContext[ConfigurationArgs]) extends Servic
val lru = new LRU()
val waiters = Map[String, List[(Pid, Any)]]()

def getFieldCacheSize(): Long = {
val fieldCache = FieldCache.DEFAULT
var result = 0L
for (cacheEntry <- fieldCache.getCacheEntries) {
result += RamUsageEstimator.sizeOf(cacheEntry.getValue())
}
result
}

val fieldCacheMetrics = ctx.args.config.getBoolean("clouseau.field_cache_metrics", false)
if (fieldCacheMetrics) {
metrics.gauge("field_cache.size")(getFieldCacheSize)
}

override def handleCall(tag: (Pid, Any), msg: Any): Any = msg match {
case OpenIndexMsg(peer: Pid, path: String, options: Any) =>
lru.get(path) match {
Expand Down

0 comments on commit 1f2c5e9

Please sign in to comment.