-
Notifications
You must be signed in to change notification settings - Fork 95
[WIP] Optimize data visualization on the tracing page #120
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
base: main
Are you sure you want to change the base?
Conversation
|
jzst seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Summary of ChangesHello @jzstkarol, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求主要致力于提升追踪数据(特别是 AI 相关操作)的可视化和处理能力。通过引入彩色瀑布图条形、交互式 JSON 查看器以及更健壮的数据提取机制,旨在为用户提供更清晰、更便捷的追踪分析体验,并确保在不同数据结构下属性和 token 计数的准确性。 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
本次 PR 主要包含两方面的优化:一是引入了瀑布图(火焰图)来更直观地展示 trace 的时间线,二是优化了 attributes 和输入/输出的展示方式,改用 react-json-view 并兼容了扁平与嵌套两种数据结构。
整体来看,这些改动大大提升了 Trace 页面的可读性和用户体验。代码重构方面,通过更新 getNestedValue 工具函数来统一处理不同数据结构,使代码更具健壮性。
我在代码中发现了一个关键的 bug 和一些可以改进的地方,请查看具体的 review comments。
| const op = (getNestedValue(attrs, 'gen_ai.operation.name') ?? | ||
| attrs['gen_ai.operation.name']) as | ||
| | string | ||
| | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Number((start - min) * 10000n / range) / 100; | ||
| const widthPercent = | ||
| Number((end - start) * 10000n / range) / 100; | ||
| return { left: leftPercent, width: Math.max(widthPercent, 1) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
[Please describe the background, purpose, changes made, and how to test this PR]
Checklist
Please check the following items before code is ready to be reviewed.
npm run formatcommand in the root directory