Skip to content

Refactor for consistency and clarity#316

Merged
harp-intel merged 10 commits into
mainfrom
tablenames
Apr 25, 2025
Merged

Refactor for consistency and clarity#316
harp-intel merged 10 commits into
mainfrom
tablenames

Conversation

@harp-intel
Copy link
Copy Markdown
Contributor

No description provided.

@harp-intel harp-intel requested a review from Copilot April 25, 2025 02:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors report and telemetry table names to improve consistency and clarity across the codebase. Key changes include:

  • Renaming and removal of legacy script definitions and obsolete table constants in internal packages.
  • Updating table name constants and associated helper functions in report and telemetry modules.
  • Adjusting configuration and benchmark mappings in CLI commands to reflect the new naming conventions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/script/script_defs.go Removed obsolete script definitions and updated naming.
internal/report/table_defs.go Renamed several table constants for clarity and consistency.
internal/report/html.go Updated renderer and helper function names accordingly.
cmd/telemetry/telemetry.go Revised telemetry table references to use new names.
cmd/report/report.go Updated benchmark and reporting mappings with new table names.
Comments suppressed due to low confidence (6)

internal/script/script_defs.go:49

  • The removal of the obsolete MaxCStateScriptName constant appears intended for standardization; please confirm that no remaining parts of the code reference this script.
-	MaxCStateScriptName                        = "max c-state"

internal/script/script_defs.go:100

  • Removing IpmitoolEventTimeScriptName requires checking that all references are updated; ensure that the new chassisStatusTableValues logic fully accounts for this change.
-	IpmitoolEventTimeScriptName                = "ipmitool event time"

internal/report/table_defs.go:85

  • [nitpick] Changing the table name from 'C-states' to 'C-state' improves consistency; verify that any external documentation or queries referencing the old name are updated accordingly.
CstateTableName            = "C-state"

internal/report/table_defs.go:100

  • [nitpick] Renaming the CXLDeviceTableName to CXLTableName (and adjusting PCIeSlots accordingly) aligns with the new naming convention; ensure that these updates are reflected in all related integrations.
CXLTableName               = "CXL"

cmd/telemetry/telemetry.go:91

  • [nitpick] The telemetry configuration now references updated table names; please verify that these new names are in sync with related metric aggregation logic.
{FlagName: flagCpuName, FlagVar: &flagCpu, DefaultValue: false, Help: "monitor cpu", TableNames: []string{report.CPUUtilizationTelemetryTableName, report.UtilizationCategoriesTelemetryTableName, report.AverageFrequencyTelemetryTableName, report.IRQRateTelemetryTableName}},

cmd/report/report.go:423

  • [nitpick] Ensure that the rename from the old CPU Speed table constant to SpeedBenchmarkTableName is consistently applied throughout the reporting metrics and any associated documentation.
{Name: "CPU Speed", Values: []string{getValueFromTableValues(getTableValues(allTableValues, report.SpeedBenchmarkTableName), "Ops/s", 0) + " Ops/s"}},

harp-intel and others added 2 commits April 24, 2025 20:16
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
* Enhance core frequency reporting for multi-die architectures

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>

* Refactor convertMsrToDecimals to use int instead of int64 for decimal values

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>

* Refactor frequency handling: rename functions and streamline frequency bucket processing

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>

* fix comment

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
…di telemetry

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
… and telemetry scripts

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel changed the title Refactor report and telemetry table names for consistency and clarity Refactor for consistency and clarity Apr 25, 2025
@harp-intel harp-intel requested a review from Copilot April 25, 2025 21:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors several reporting and telemetry functions for consistency and clarity. Key changes include updating copyright years from 2021–2024 to 2021–2025, renaming multiple functions (e.g. CPUFrequencyTableHtmlRenderer → FrequencyBenchmarkTableHtmlRenderer, MemoryLatencyTableHtmlRenderer → MemoryBenchmarkTableHtmlRenderer, etc.) for a consistent telemetry naming scheme, and adjusting test package references and calls accordingly.

Reviewed Changes

Copilot reviewed 42 out of 47 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/report/render_html_flamegraph.go Updated copyright year.
internal/report/render_html.go Renamed several table renderer functions to align naming conventions.
internal/report/render_excel.go Added new Excel report functionality and renamed associated functions; one loop construct appears incorrect.
internal/report/prefetcher_defs.go Renamed prefetcher types and definitions for clarity.
internal/report/gpu_defs.go Updated GPU def types and variable names.
internal/report/cpu_defs_test.go Updated package name and GetCPU function calls.
internal/report/cpu_defs.go Renamed CPU to CPUDefinition and updated related functions.
internal/cpudb/cpudb.go Deleted file; functionality is now within the report package.
internal/common/* Updated copyright year and comment formatting.
cmd/* Updated table name references in telemetry, report, metrics, and config commands to match renamed functions.
Files not reviewed (5)
  • Makefile: Language not supported
  • build.Dockerfile: Language not supported
  • builder/build.Dockerfile: Language not supported
  • builder/build.sh: Language not supported
  • cmd/metrics/resources/base.html: Language not supported

Comment thread internal/report/render_excel.go
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel merged commit 77f8ceb into main Apr 25, 2025
4 checks passed
@harp-intel harp-intel deleted the tablenames branch April 25, 2025 22:25
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.

2 participants