New J2K: add FUS statistics for J2K conversions

This commit is contained in:
Ilya Kirillov
2019-06-17 15:08:25 +03:00
committed by Anton Yalyshev
parent cf885789ff
commit 01c866632d
4 changed files with 119 additions and 37 deletions
@@ -0,0 +1,33 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.j2k
import org.jetbrains.kotlin.idea.statistics.FUSEventGroups
import org.jetbrains.kotlin.idea.statistics.KotlinFUSLogger
enum class ConversionType(val text: String) {
FILES("Files"), PSI_EXPRESSION("PSI expression"), TEXT_EXPRESSION("Text expression");
}
fun logJ2kConversionStatistics(
type: ConversionType,
isNewJ2k: Boolean,
conversionTime: Long,
linesCount: Int,
filesCount: Int
) {
val data = mapOf(
"Lines count" to linesCount,
"Files count" to filesCount,
"Is new J2K" to isNewJ2k,
"Time" to conversionTime
).map { (key, value) ->
key to value.toString()
}.toMap()
KotlinFUSLogger.log(FUSEventGroups.J2K, type.text, data)
}