调用 eventStart来开始计时,配置要计时的事件名称。
当该事件上传时,会自动在事件属性中加入 _duration 这一属性来表示事件的持续时长,单位为毫秒。
同一事件名只能有一个在计时的事件,多次设置同一事件名时,以最后一次设置为准。
启动时长事件
方法示例
public static eventStart(eventName: string)
参数说明
参数名称 | 参数含义 | 参数类型 | 是否必传 |
eventName | 开发者自定义时长事件名称 | string | 是 |
调用示例
import { SolarEngineManager } from '@solarengine/core'
SolarEngineManager.eventStart("xxx自定义eventNamexxx");
上报时长事件
方法示例
public static eventFinish(eventName: string, customProperties: Record<string, Object>)
参数说明
参数名称 | 参数含义 | 参数类型 | 是否必传 |
eventName | 开发者自定义时长事件名称 | string | 是 |
customProperties
|
事件自定义属性
|
Record<string,Object> | 否 |
调用示例
import { SolarEngineManager } from '@solarengine/core'
let custom_properties: Record<string, Object> = {};
custom_properties["key1"] = "value1";
custom_properties["key2"] = "value2";
SolarEngineManager.eventFinish("xxx自定义eventNamexxx", custom_properties);