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

ai.platon.pulsar.skeleton.crawl.fetch.privacy.Misc.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package ai.platon.pulsar.skeleton.crawl.fetch.privacy

import ai.platon.pulsar.skeleton.common.metrics.MetricsSystem

enum class CloseStrategy {
    ASAP,
    // it might be a bad idea to close lazily
    LAZY
}

open class PrivacyContextException(message: String) : Exception(message)

class PrivacyContextMetrics {
    private val registry get() = MetricsSystem.reg
    val tasks = registry.multiMetric(this, "tasks")
    val successes = registry.multiMetric(this, "successes")
    val finishes = registry.multiMetric(this, "finishes")
    val contextLeaks = registry.multiMetric(this, "contextLeaks")

    val smallPages = registry.meter(this, "smallPages")
    val minorLeakWarnings = registry.meter(this, "minorLeakWarnings")
    val contexts = registry.meter(this, "contexts")
    val leakWarnings = registry.meter(this, "leakWarnings")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy