diff --git a/app/build.gradle b/app/build.gradle index 11bdc001fd..3bd1cb4b54 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,13 +19,61 @@ apply plugin: 'bytex.threadOpt' thread_opt { enable true enableInDebug true - rxJavaIoReplacer 'com/mogo/eagle/core/utilcode/util/ThreadUtils@@getIoPool@@()Ljava/util/concurrent/ExecutorService;' rxJavaComputationReplacer 'com/mogo/eagle/core/utilcode/util/ThreadUtils@@getCpuPool@@()Ljava/util/concurrent/ExecutorService;' coroutineIoReplacer 'com/mogo/eagle/core/utilcode/util/ThreadUtils@@getIoPool@@()Ljava/util/concurrent/ExecutorService;' coroutineDefaultReplacer 'com/mogo/eagle/core/utilcode/util/ThreadUtils@@getCpuPool@@()Ljava/util/concurrent/ExecutorService;' } +/** + * 方便使用systrace工具,在工程侧打点,便于分析工程侧性能问题 + */ +apply plugin: 'bytex.systrace' +systrace { + /** + * 交付时要关闭,会有性能损耗 + */ + enable false + enableInDebug false + /** + * - 是否使用[Trace.beginAsyncSection(String, int)/Trace.endAsyncSection(String, int)]进行打点 + * - 默认使用[Trace.beginSection(String)/Trace.endSection()]进行打点 + */ + isTraceAsync false + /** + * - 是否在运行时只针对主线程打点,其它线程不打 + */ + isOnlyMainThread false + + /** + * - 是否忽略对类的静态构造方法打点 + * - 默认不忽略 + */ + isIgnoreClinitMethod false + + /** + * - 是否忽略对类中的简单方法打点 + * 简单方法定义: + * - 空方法 + * - get/set 方法 + * - 单独的方法,方法体内没有调用其它方法 + * - 默认不忽略 + */ + isIgnoreSampleMethod false + + /** + * - 针对特定类集合,配置打点白名单,在此集合中的类中的所有方法不打点 + * - 支持正则表达式 + */ + whiteListForClass = [] + + /** + * - 针对特定包名集合,配置打点白名单,所有类以此包名为前缀的类不打点 + * - 支持正则表达式 + */ + whiteListForPackage = [] +} + /*apply plugin: 'chain.log.hook' hooklog{ enableLoggerToServer true diff --git a/build.gradle b/build.gradle index d953654699..95ee9b6c7f 100644 --- a/build.gradle +++ b/build.gradle @@ -34,6 +34,8 @@ buildscript { classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}" classpath 'com.volcengine:apm_insight_plugin:1.4.1' classpath 'com.mogo.cloud:thread_opt:1.0.0' + classpath 'com.mogo.cloud:systrace:1.0.1' + // classpath "com.bytedance.android.byteX:base-plugin:0.3.0" // classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"