Add FUS support to move refactoring

This commit is contained in:
Anton Yalyshev
2020-02-03 09:37:02 +03:00
committed by Igor Yakovlev
parent f489eda0e7
commit 8877559c02
16 changed files with 279 additions and 59 deletions
@@ -0,0 +1,42 @@
/*
* Copyright 2010-2020 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.idea.statistics
object MoveRefactoringFUSCollector {
/**
* @param isDefault is something changed in Move Refactoring Dialog check-boxes state
*/
fun log(
timeStarted: Long,
timeFinished: Long,
numberOfEntities: Int,
entity: MovedEntity,
destination: MoveRefactoringDestination,
isDefault: Boolean,
isSucceeded: Boolean
) {
val data = mapOf(
"lagging" to (timeFinished - timeStarted).toString(),
"entity" to entity.toString(),
"destination" to destination.toString(),
"number_of_entities" to numberOfEntities.toString(),
"are_settings_changed" to isDefault.toString(),
"succeeded" to isSucceeded.toString()
)
KotlinFUSLogger.log(FUSEventGroups.Refactoring, "Move", data)
}
enum class MoveRefactoringDestination {
PACKAGE, FILE, DECLARATION
}
enum class MovedEntity {
FUNCTIONS, CLASSES, MIXED, MPPCLASSES, MPPFUNCTIONS, MPPMIXED, PACKAGE, FILES
}
}