1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-06-01 01:34:07 +02:00

Draft of statistic collector

This commit is contained in:
Alex Plate 2021-11-15 10:54:10 +03:00 committed by lippfi
parent abb93af3fb
commit 02dd52ccb9
2 changed files with 24 additions and 0 deletions
src/main
java/com/maddyhome/idea/vim/statistic
resources/META-INF

View File

@ -0,0 +1,22 @@
package com.maddyhome.idea.vim.statistic
import com.intellij.internal.statistic.beans.MetricEvent
import com.intellij.internal.statistic.eventLog.EventLogGroup
import com.intellij.internal.statistic.eventLog.events.BooleanEventField
import com.intellij.internal.statistic.eventLog.events.EventId1
import com.intellij.internal.statistic.service.fus.collectors.ApplicationUsagesCollector
import com.maddyhome.idea.vim.option.OptionsManager
class VimStatistic : ApplicationUsagesCollector() {
override fun getGroup(): EventLogGroup = GROUP
override fun getMetrics(): Set<MetricEvent> {
return setOf(OPTIONS.metric(OptionsManager.ideajoin.isSet))
}
companion object {
private val GROUP = EventLogGroup("vim.options", 1)
private val OPTIONS: EventId1<Boolean> = GROUP.registerEvent("ideajoin", BooleanEventField("ideajoin"))
}
}

View File

@ -109,6 +109,8 @@
<spellchecker.bundledDictionaryProvider implementation="com.maddyhome.idea.vim.VimBundledDictionaryProvider"/>
<notificationGroup displayType="STICKY_BALLOON" id="ideavim-sticky"/>
<statistics.applicationUsagesCollector implementation="com.maddyhome.idea.vim.statistic.VimStatistic"/>
</extensions>
<xi:include href="/META-INF/includes/ApplicationServices.xml" xpointer="xpointer(/idea-plugin/*)"/>