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

feat: add zookeeper current metrics #241

Merged
merged 1 commit into from
May 18, 2024
Merged

feat: add zookeeper current metrics #241

merged 1 commit into from
May 18, 2024

Conversation

duyet
Copy link
Owner

@duyet duyet commented May 18, 2024

No description provided.

Copy link

vercel bot commented May 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clickhouse-monitoring ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 4:35pm

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @duyet - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 5 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -50,7 +50,7 @@ export async function RelatedCharts({

return (
<div className={cn('mb-5 grid gap-5', gridCols, className)}>
{charts.map(([_name, Chart, props], i) => {
{charts.map(([name, Chart, props], i) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider renaming 'name' to 'chartName' for clarity.

Renaming 'name' to 'chartName' can improve readability and avoid potential conflicts with other variables named 'name' in the broader scope.

Suggested change
{charts.map(([name, Chart, props], i) => {
{charts.map(([chartName, Chart, props], i) => {

Comment on lines +64 to +66
console.debug(
`${name} add col-span-2 due to next chart being a break`
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (performance): Remove or conditionally compile debug statements.

Leaving debug statements in production code can lead to performance issues and cluttered logs. Consider removing them or using a conditional compilation approach.

@@ -22,6 +22,7 @@ export async function ChartReplicationSummaryTable({
COUNT() as total
FROM system.replication_queue
GROUP BY 1, 2
ORDER BY total DESC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider adding an index on the 'total' column.

Ordering by 'total' might benefit from an index on the 'total' column to improve query performance, especially with large datasets.

Suggested change
ORDER BY total DESC
CREATE INDEX idx_total ON system.replication_queue (total);
ORDER BY total DESC

Comment on lines +51 to +52
{Object.values(row).map((value, i) => {
return <TableCell key={i}>{value || ''} </TableCell>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Avoid using index as key in list rendering.

Using the index as a key can lead to issues with component state and performance. Consider using a unique identifier from the data instead.

}[]
>({ query })

const uptime = rows[0] || { uptime: 'N/A' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Handle case where rows array is empty.

Ensure that the code handles the case where the rows array is empty to avoid potential runtime errors.

@duyet duyet merged commit b209397 into main May 18, 2024
14 checks passed
@duyet duyet deleted the chore/ui branch May 18, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant