Untitled

 avatar
unknown
kotlin
2 years ago
1.5 kB
9
Indexable
private fun initVWO() {
        val currentTime = System.currentTimeMillis()
        val vwoConfig: VWOConfig = VWOConfig.Builder().setEnableBenchmarking(true).build()
        VWO.with(context, BuildConfig.VWO_API_KEY).launch(object : VWOStatusListener {
            override fun onVWOLoaded() {
                val loadTime = System.currentTimeMillis() - currentTime
                VWOHelper.logTechEvent(pageName = "", eventCategory = Constants.LOAD_TIME, eventAction = com.airtel.analytics.constants.Constants.EventAction.vwo.value, cta = loadTime.toString())
                if (vwoConfig.isEnableBenchmarking) {
                    Log.e("VWOLATENCY", "loadTime = $loadTime")
                    Log.e("VWOLATENCY", "TimeTracker.getBeforeApiInitDuration() = " + TimeTracker.getBeforeApiInitDuration())
                    Log.e("VWOLATENCY", "TimeTracker.getApiInitDuration()"+TimeTracker.getApiInitDuration())
                    Log.e("VWOLATENCY", "TimeTracker.getAfterApiInitDuration()"+TimeTracker.getAfterApiInitDuration())
                    Log.e("VWOLATENCY", "TimeTracker.getTotalInitDuration()"+TimeTracker.getTotalInitDuration())
                }
            }

            override fun onVWOLoadFailure(error: String?) {
                VWOHelper.logTechEvent(pageName = "", eventCategory = VWOHelper.Keys.LOAD_FAILURE, eventAction = com.airtel.analytics.constants.Constants.EventAction.vwo.value, cta = null)
            }
        })
        if (BuildConfig.DEBUG) {
            VWOLog.setLogLevel(VWOLog.ALL)
        }
    }
Editor is loading...