[telemetry] IJ-CR-140721 Naming

GitOrigin-RevId: e0b09a824c3a4264e44659d4e1d848e9d2c5bca9
This commit is contained in:
Nikita Kudrin
2024-07-26 12:09:47 +03:00
committed by intellij-monorepo-bot
parent 23d3717b6c
commit e439da09f9
3 changed files with 6 additions and 17 deletions

View File

@@ -12,7 +12,7 @@ interface AsyncSpanExporter {
suspend fun flush() {}
/** Should clean any previously exported metrics */
/** Should discard any previously exported metrics */
suspend fun reset() {}
suspend fun shutdown() {}

View File

@@ -92,11 +92,7 @@ interface TelemetryManager {
@TestOnly
suspend fun forceFlushMetrics()
/**
* Blocking forceFlushMetrics function for test purposes.
*
* @see forceFlushMetrics
*/
/** Blocking [forceFlushMetrics] function for test purposes. */
@Suppress("unused")
@TestOnly
fun forceFlushMetricsBlocking() {
@@ -110,18 +106,11 @@ interface TelemetryManager {
@TestOnly
suspend fun resetExporters()
/**
* Discard previously collected metrics and invoke flush.
* @see resetExporters
* @see forceFlushMetrics
*/
/** Blocking [resetExporters] counterpart for test purposes and for simplicity of use from Java. */
@Suppress("unused")
@TestOnly
fun reset() {
runBlocking {
resetExporters()
forceFlushMetrics()
}
fun resetExportersBlocking() {
runBlocking { resetExporters() }
}
}

View File

@@ -112,7 +112,7 @@ public class BenchmarkTestInfoImpl implements BenchmarkTestInfo {
private static void cleanupOutdatedMetrics() {
try {
// force spans and meters to be exported and discarded to minimize interference of the same metric on different tests
TelemetryManager.getInstance().reset();
TelemetryManager.getInstance().resetExportersBlocking();
// remove content of the previous tests from the idea.log
IJPerfMetricsPublisher.Companion.truncateTestLog();