Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[venus-worker] request received和request done 日志增加具体的sectorNum #443

Closed
1 of 4 tasks
alisazhang777 opened this issue Sep 22, 2022 · 7 comments
Closed
1 of 4 tasks
Labels
enhancement New feature or request P1 High - we should be working on this now or in the immediate future

Comments

@alisazhang777
Copy link

alisazhang777 commented Sep 22, 2022

模块 / Components

  • venus-sector-manager
  • venus-worker
  • 工具链 / toolchains
  • 文档 / docs

描述 / Description

现状:p2阶段的pid和p1阶段的pid是不同的,无法统计同一个扇区p1结束的时间和p2开始的时间,只能统计不同扇区的单个阶段时间。

建议:每个任务request received和request done 日志里增加具体的sectorNum,为了便于查看任务调度(即同一个任务上一个阶段结束和下一个阶段开始的时间)。
当前日志:

2022-07-24T14:29:16.206698598+08:00 DEBUG ThreadId(04) sub{name="PC1" pid=xxx}:request{id=2 size=682}: vc_processors::core::ext::consumer: request received
                                                    
2022-07-24T14:29:16.206862453+08:00 DEBUG ThreadId(05) sub{name="PC1" pid=xxx}:request{id=3 size=682}: vc_processors::core::ext::consumer: request done

优化后的日志:

2022-07-24T14:29:16.206698598+08:00 DEBUG ThreadId(04) sub{SectorNum(xxx),name="PC1" pid=xxx}:request{id=2 size=682}: vc_processors::core::ext::consumer: request received
                                                       
2022-07-24T14:29:16.206862453+08:00 DEBUG ThreadId(05) sub{SectorNum(xxx),name="PC1" pid=xxx}:request{id=3 size=682}: vc_processors::core::ext::consumer: request done
                                                 
@alisazhang777 alisazhang777 added the enhancement New feature or request label Sep 22, 2022
@0x5459 0x5459 self-assigned this Sep 22, 2022
@alisazhang777 alisazhang777 changed the title [venus-worker] 建议增加每个阶段开始和结束时间的关键字 [venus-worker] request received和request done 日志增加具体的sectorNum Sep 22, 2022
@0x5459 0x5459 added the good first issue Good for newcomers label Sep 22, 2022
@0x5459 0x5459 added this to the v0.5.0 milestone Sep 22, 2022
@0x5459 0x5459 removed the good first issue Good for newcomers label Sep 22, 2022
@0x5459
Copy link
Collaborator

0x5459 commented Sep 22, 2022

这个地方不太方便加 SectorNum. 可能在 worker planner 相关的地方加上?
cc @dtynn

@dtynn
Copy link
Contributor

dtynn commented Sep 22, 2022

这个地方不太方便加 SectorNum. 可能在 worker planner 相关的地方加上? cc @dtynn

几种方案思路:

  1. Processor 的调用入口增加耗时统计的日志,然后利用 tracing span 携带额外的上下文
  2. 直接统计对应的扇区和其某两个状态转换之间的间隔时间
  3. 在worker planner 中的各个阶段逻辑中手工编码计时逻辑

优雅程度递减

@0x5459

This comment was marked as spam.

@dtynn
Copy link
Contributor

dtynn commented Sep 23, 2022

应该是类似

impl SealerPlaner {
    fn handle_some() {
        let sector_id = ...;
        let params = ...;
        let _span = warn_span!("process", ?sector_id).entered();
        let res = ctx.global.processors.pc2.exec(params).perm()?;
    }
}

这样的思路。
计时的 log 在这里的 exec 中

这样并不需要一路将 sector id 向下传递

@0x5459 0x5459 modified the milestones: v0.5.0, v0.6.0 Oct 11, 2022
@Fatman13 Fatman13 added the community issues from community members label Jan 3, 2023
@0x5459 0x5459 modified the milestones: v0.6.0, v0.7.0 Mar 29, 2023
@0x5459 0x5459 modified the milestones: v0.7.0, v0.8.0 Jun 16, 2023
@elvin-du elvin-du added the P1 High - we should be working on this now or in the immediate future label Jun 16, 2023
@elvin-du
Copy link
Collaborator

运维优先级非常高。
运维的需求是:VSM中扇区各个阶段的时间,打印在日志中。

@elvin-du elvin-du changed the title [venus-worker] request received和request done 日志增加具体的sectorNum [venus-worker] request received和request done 日志增加具体的sectorNum(优先级最高) Jun 16, 2023
@0x5459 0x5459 removed their assignment Jun 16, 2023
@0x5459
Copy link
Collaborator

0x5459 commented Jun 16, 2023

这个暂时不做。 准备实现这个 #768

@0x5459 0x5459 removed the community issues from community members label Jun 16, 2023
@elvin-du elvin-du changed the title [venus-worker] request received和request done 日志增加具体的sectorNum(优先级最高) [venus-worker] request received和request done 日志增加具体的sectorNum Jun 29, 2023
@elvin-du
Copy link
Collaborator

采用数据库方案。#443

@0x5459 0x5459 removed this from the v0.8.0 milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1 High - we should be working on this now or in the immediate future
Projects
Status: Done
Status: No status
Development

No branches or pull requests

5 participants