mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed excessive Confidence Interval metric calculation skip warnings
GitOrigin-RevId: a89212ba1557ad9eaf3401774b162198eba49ffa
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d62bdb3c40
commit
92e53f14a1
@@ -36,10 +36,8 @@ interface Metric {
|
||||
val maximumSessions: Int
|
||||
get() = 75000
|
||||
|
||||
fun shouldComputeIntervals(numberOfSessions: Int): Boolean {
|
||||
if (numberOfSessions > maximumSessions) LOG.warn("Confidence Interval not calculated for metric $name because number of sessions $numberOfSessions exceeds maximum threshold $maximumSessions")
|
||||
return numberOfSessions <= maximumSessions && System.getenv("cce_compute_confidence_intervals")?.toBooleanStrictOrNull() == true
|
||||
}
|
||||
fun shouldComputeIntervals(numberOfSessions: Int): Boolean =
|
||||
numberOfSessions <= maximumSessions && System.getenv("cce_compute_confidence_intervals")?.toBooleanStrictOrNull() == true
|
||||
|
||||
companion object {
|
||||
val LOG: Logger = thisLogger()
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package com.intellij.cce.metric
|
||||
|
||||
import com.intellij.cce.core.Session
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
|
||||
class MetricsEvaluator private constructor(private val evaluationType: String) {
|
||||
companion object {
|
||||
@@ -16,6 +18,8 @@ class MetricsEvaluator private constructor(private val evaluationType: String) {
|
||||
evaluator.registerMetrics(metrics)
|
||||
return evaluator
|
||||
}
|
||||
|
||||
val LOG: Logger = thisLogger()
|
||||
}
|
||||
|
||||
private val metrics = mutableListOf<Metric>()
|
||||
@@ -36,6 +40,9 @@ class MetricsEvaluator private constructor(private val evaluationType: String) {
|
||||
|
||||
fun evaluate(sessions: List<Session>, numberOfSessions: Int): List<MetricInfo> {
|
||||
return metrics.map { metric ->
|
||||
if(numberOfSessions > metric.maximumSessions)
|
||||
LOG.warn("Confidence Interval not calculated for metric ${metric.name} because number of sessions $numberOfSessions exceeds maximum threshold of ${metric.maximumSessions} maximumSessions")
|
||||
|
||||
val (overallScore, individualScores) = if (metric.supportsIndividualScores) {
|
||||
val evaluationResult = metric.evaluateWithIndividualScores(sessions)
|
||||
evaluationResult.overallScore.toDouble() to evaluationResult.sessionIndividualScores
|
||||
|
||||
Reference in New Issue
Block a user