Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

profile: Support merge of slightly different but similar Profiles.

未关闭
#147 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
go

调研方向

从 profile.Merge 开始,检查它如何验证 sample types、period types、periods、duration、time 和 symbolization。比较两种提议的方向——规范化兼容的 profiles,或支持多个 profile protobuf 消息——并围绕一种有文档记录且经过测试的、用于组合或可视化 Go 和 C++ profiles 的行为来定义完成标准。

由索引模型根据 Issue 内容生成。

描述

Priority: p3 type: feat

I want a way to combine memory profiles collected by different languages on the same process. (e.g. Go and C++)

profile.Merge provides merging of multiple profile.Profiles, but the merge operation is allowed only when the Profiles contain the same types and the period type.
Go's and C++'s memory profiles have the same period type, but the sample types are different, so profile.Merge is unhappy about it.

  • Go
    PeriodType: space bytes
    Period: 524288
    Samples: alloc_objects/count alloc_space/bytes inuse_objects/count inuse_space/bytes

  • C++
    PeriodType: space bytes
    Period: 2097152
    Samples: objects/count space/bytes[dflt]

I see two options:

  1. Extend or provide a variation of profile.Merge that accepts slightly different profiles, maps sample types, and outputs the intersection.
    a) Must be careful about handling of the different Periods. (may need normalization. I am afraid the current Merge doesn't do anything complex other than choosing max Period and adding up values.)
    b) Handling of Duration/Time should be carefully done.
    c) Also, it's possible the one profile may include symbolization info while another doesn't. Does the final output have to drop all symbols in this case?

  2. Extend the http endpoint or profile output format to include multiple profile proto messages, and let the pprof tool visualize and analyze the multiple profiles separately. For example, layout Go and C++ allocation graphs in separate groups, but in the same svg graph.

If the normalization required by 1) can't be done correctly, I'd prefer the option 2).

@rauls5382 @aalexand

主要语言
Go
星标
9.3k
派生
682
平均合并
2 天 4 小时
30 天内合并 PR
11

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/pprof 的其他 Issue

查看 google/pprof 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。