8 Commits

Author SHA1 Message Date
clz 96f183c2c0 feat: 启动监控维度字段 is_first_install 对齐为 app_install_status
- LaunchMonitor:维度字段改为 app_install_status(normal/new_install/over_written 三值),getAppInstallStatus() 以 StartManager 布尔值映射两值,over_written 待完整 workspace 对齐;分桶指标维度名与 record 同步
- demo LaunchDiagnostics 同步:appInstallStatus 以 preferences 自实现(无记录→new_install,有记录→normal),展示与类头注释更新,over_written 无法区分已注明
- 真机验证:首启 app_install_status=new_install,二次启动=normal

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 14:51:39 +08:00
clz 9e29282be3 refactor: 启动监控 Startup 命名统一为 Launch
- demo 页面与诊断类重命名:StartupLogin/StartupNetwork/StartupPrivacy → LaunchLogin/LaunchNetwork/LaunchPrivacy,StartupDiagnostics → LaunchDiagnostics(含 main_pages.json 注册与全部引用)
- 生产监控类重命名:StartupMonitor → LaunchMonitor,StartupElkBuilder → LaunchElkBuilder(含 EntryAbility/Index/LauncherPage/NetworkAnomalyPage 引用)
- 命名与 APP_LAUNCH 事件及 launch 模块对齐
- 接入方案文档同步页面名与类名,并修正 6 处过时内容:4 维度(is_first_install 入维度出候选)、分桶 4 维度、4.1 阶段时间已上传、§6 章节顺序(6.1 在 6.2 前)、§2 双通道链路
- demo 改名后 devecocli build 编译通过;真机运行回归待设备恢复补跑

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 14:24:31 +08:00
clz 6fe0d2ec7a feat: demo 同步 is_first_install 维度并修复 preferences 落盘
- StartupDiagnostics 新增 is_first_install 维度展示:preferences 无启动记录视为安装后首启,随后写入标记并 flushSync 同步落盘(与生产 StartManager.getAppInstallStatus 语义等价,演示工程无 biz_common 依赖故自实现)
- 修复 putSync 仅写内存缓存不落盘的问题:force-stop 后数据丢失,二次启动误判为首启;对比 AuthSession.flushSync 用法定位根因
- EntryAbility 调用 initialize 时传入 UIAbilityContext
- 真机验证:安装/清数据后首启 is_first_install=true,二次启动=false;全场景 3 组(拦截/登录/冷启动/热启动/强杀/补报)24 断言全部通过,耗时 127~165ms

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 11:16:28 +08:00
clz 0312555501 feat: 启动监控接入分桶指标并精简追溯字段
- StartupMonitor 新增 HXEventMonitor 分桶指标(链路 B):launch 模块 cold_start_time,桶 [500,600,700,800,1000,1500,2000,3000],record 原始耗时由 SDK 按桶聚合,负责看板分布
- 分桶按实测主体分布(600-800ms)在主体区间细分,尾部保留劣化告警锚点
- ElkService 追溯通道定稿上传字段(11 个):cold_start_time、start_type、entry_page、app_version、is_first_install、response_latency、animation_finish_time、startability_processstart_dur、appattach_to_appforeground_dur、git_commit、is_backfill;指标 1 + 维度 4(含 is_first_install,区分安装后首启的偏高耗时)+ 启动生命周期各阶段时间 4(劣化分段定位,response_latency 需 API 22+、两个 *dur 仅冷启动存在)+ 代码级追溯 git_commit + 补报标识;去重为客户端行为(§3.2 进程内存 20 键缓存),负载不携带去重键与事件时间字段
- 分桶指标同步 4 维度(含 setDimension4Name('is_first_install')),与追溯维度对齐
- 上传负载抽象为 ColdStartMetricPayload 强类型接口,各字段含义注释
- 删除未使用环境字段 getter 与 import,文件从 387 行精简至 278 行
- CrashDiagnosticsDemo 阶段时间展示顺序按启动生命周期对齐,构建通过
- 接入方案文档同步:第 4 节追溯字段与分桶实现、第 4.1 节按需启用、第 5 节发送机制、第 6.2 节双通道
- 待确认:链路 B 的 HXEventMonitor API(DataMonitorBuilder/getEventFactory/setBuckets/setDimension_4/record)形态基于 Android APM 文档推断,本机无 @kernel/app_monitor_event 类型声明,需在完整 workspace 以 .d.ts 核对后编译验证

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 10:53:18 +08:00
clz 10bbfc4c82 feat: 启动监控扩展追溯字段并修复补报事件语义
- StartupMonitor 上报新增时间拆解与客户端环境字段:response_latency、startability_processstart_dur、appattach_to_appforeground_dur、bundle_name、device_type、system_version、build_mode、target_name、git_commit、is_first_install
- 新增 is_backfill 补报标识:以 watcher 注册时间为锚点判定系统补投递的上次启动遗留事件,entry_page 置 unknown,避免错误归因
- CrashDiagnosticsDemo 同步字段展示与补报判定逻辑,devecocli build 构建通过
- 真机验证(nova 14 Pro):冷启动/多入口拦截/热启动/5 秒退出/补报判定/全场景 3 组全部通过,耗时 126~180ms
- 接入方案文档更新:第 4 节追溯字段与时间拆解、第 6 节 5 秒退出边界、第 8 节验证记录

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-05 19:09:22 +08:00
clz d8513d1f1d feat: 完善启动性能监控流程
- 增加登录、网络异常和隐私确认启动场景
- 持久化登录状态并支持首页退出登录
- 保证每个进程只提交一次 reportDrawnCompleted
- 按启动事件唯一键去重 APP_LAUNCH 上报
- 同步优化逻辑到 future_entry_demo 并在 CrashDiagnosticsDemo 真机验证
2026-08-05 16:19:08 +08:00
clz 56ad003e04 chore: save current workspace changes 2026-08-05 14:11:51 +08:00
clz 2134f54010 docs: add crash diagnostics and startup safeguards 2026-08-04 21:17:45 +08:00