Skip to content

Add energy metrics to load-watcher#73

Merged
lenhattan86 merged 2 commits intopaypal:masterfrom
jpedro1992:energy
Nov 12, 2024
Merged

Add energy metrics to load-watcher#73
lenhattan86 merged 2 commits intopaypal:masterfrom
jpedro1992:energy

Conversation

@jpedro1992
Copy link
Copy Markdown
Contributor

What type of PR is this?

Addition of energy metrics in load-watcher.

Related issue

#72

Summary

Additional metrics:

promScaphHostPower           = "scaph_host_power_microwatts"
promScaphHostJoules          = "scaph_host_energy_microjoules"
promKeplerHostCoreJoules     = "kepler_node_core_joules_total"
promKeplerHostUncoreJoules   = "kepler_node_uncore_joules_total"
promKeplerHostDRAMJoules     = "kepler_node_dram_joules_total"
promKeplerHostPackageJoules  = "kepler_node_package_joules_total"
promKeplerHostOtherJoules    = "kepler_node_other_joules_total"
promKeplerHostGPUJoules      = "kepler_node_gpu_joules_total"
promKeplerHostPlatformJoules = "kepler_node_platform_joules_total"
promKeplerHostEnergyStat     = "kepler_node_energy_stat"

metricType = watcher.Memory
} else if metric == promDiskIOMetric {
metricType = watcher.Storage
} else if metric == promScaphHostPower {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should use switch case for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree. What about something like this:

switch metric {
	case promCpuMetric: // CPU metrics
		metricType = watcher.CPU
	case promMemMetric: // Memory metrics
		metricType = watcher.Memory
	case promDiskIOMetric: // Storage metrics
		metricType = watcher.Storage
	case promScaphHostPower, promScaphHostJoules, // Energy-related metrics
		promKeplerHostCoreJoules, promKeplerHostUncoreJoules,
		promKeplerHostDRAMJoules, promKeplerHostPackageJoules,
		promKeplerHostOtherJoules, promKeplerHostGPUJoules,
		promKeplerHostPlatformJoules, promKeplerHostEnergyStat: 
		metricType = watcher.Energy
	case promTransBandMetric, promTransBandDropMetric, // Bandwidth-related metrics
	promRecBandMetric, promRecBandDropMetric:
		metricType = watcher.Bandwidth
	default:
		metricType = watcher.Unknown
	}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good to me.

@lenhattan86 lenhattan86 merged commit 500faea into paypal:master Nov 12, 2024
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