Skip to content

Update gofish and adjust for changes#2401

Open
stmcginnis wants to merge 1 commit intosustainable-computing-io:mainfrom
stmcginnis:gofish-update
Open

Update gofish and adjust for changes#2401
stmcginnis wants to merge 1 commit intosustainable-computing-io:mainfrom
stmcginnis:gofish-update

Conversation

@stmcginnis
Copy link

The gofish library has had significant refactoring. This updates to accommodate those changes.

This is a mechanical change only - no extensive testing has been done beyond running linting and unit tests. Feel free to take this over for any necessary updates, and please report any issues for gofish.

The gofish library has had significant refactoring. This updates to
accommodate those changes.

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.21%. Comparing base (c164049) to head (015b13a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2401   +/-   ##
=======================================
  Coverage   91.21%   91.21%           
=======================================
  Files          52       52           
  Lines        4851     4851           
=======================================
  Hits         4425     4425           
  Misses        311      311           
  Partials      115      115           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📊 Profiling reports are ready to be viewed

⚠️ Variability in pprof CPU and Memory profiles
When comparing pprof profiles of Kepler versions, expect variability in CPU and memory. Focus only on significant, consistent differences.

💻 CPU Comparison with base Kepler
File: kepler
Build ID: 6985487da479911584994d01c33c9a56284228f2
Type: cpu
Time: 2026-02-04 10:25:07 UTC
Duration: 120s, Total samples = 3.93s ( 3.27%)
Active filters:
   show=github.com/sustainable-computing-io
Showing nodes accounting for -0.10s, 2.54% of 3.93s total
      flat  flat%   sum%        cum   cum%
         0     0%     0%     -0.11s  2.80%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).Collect
         0     0%     0%     -0.10s  2.54%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculatePower
         0     0%     0%     -0.10s  2.54%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).refreshSnapshot
         0     0%     0%     -0.10s  2.54%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh
         0     0%     0%     -0.10s  2.54%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh.func1
         0     0%     0%     -0.08s  2.04%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).Snapshot
    -0.08s  2.04%  2.04%     -0.08s  2.04%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).CPUTime
         0     0%  2.04%     -0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).ensureFreshData
         0     0%  2.04%     -0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh
         0     0%  2.04%     -0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshProcesses
         0     0%  2.04%     -0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).updateProcessCache
         0     0%  2.04%     -0.07s  1.78%  github.com/sustainable-computing-io/kepler/internal/resource.populateProcessFields
         0     0%  2.04%      0.05s  1.27%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*gpuInfoCollector).Collect
    -0.05s  1.27%  3.31%     -0.05s  1.27%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).CPUUsageRatio
         0     0%  3.31%     -0.04s  1.02%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh.func3
     0.01s  0.25%  3.05%     -0.04s  1.02%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshNode
         0     0%  3.05%     -0.03s  0.76%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).scheduleNextCollection.func1
    -0.03s  0.76%  3.82%     -0.03s  0.76%  github.com/sustainable-computing-io/kepler/internal/monitor.newProcess (inline)
     0.02s  0.51%  3.31%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).collectProcessMetrics
         0     0%  3.31%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*cpuInfoCollector).Collect
     0.02s  0.51%  2.80%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*realProcFS).CPUInfo
         0     0%  2.80%     -0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateProcessPower
         0     0%  2.80%      0.02s  0.51%  github.com/sustainable-computing-io/kepler/internal/resource.newProcess
         0     0%  2.80%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/device.(*AggregatedZone).Energy
    -0.01s  0.25%  3.05%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/device.sysfsRaplZone.Energy
         0     0%  3.05%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateNodePower
    -0.01s  0.25%  3.31%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Process).Clone (inline)
         0     0%  3.31%     -0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Snapshot).Clone
     0.01s  0.25%  3.05%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*TerminatedResourceTracker[go.shape.*uint8]).Add
     0.01s  0.25%  2.80%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).Cgroups
     0.01s  0.25%  2.54%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).Comm
         0     0%  2.54%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.computeTypeInfoFromProc.func1
         0     0%  2.54%      0.01s  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.containerInfoFromProc
💾 Memory Comparison with base Kepler (Inuse)
File: kepler
Build ID: 6985487da479911584994d01c33c9a56284228f2
Type: inuse_space
Time: 2026-02-04 10:27:07 UTC
Duration: 120.02s, Total samples = 8596.54kB 
Active filters:
   show=github.com/sustainable-computing-io
Showing nodes accounting for -1549.71kB, 18.03% of 8596.54kB total
      flat  flat%   sum%        cum   cum%
         0     0%     0% -2061.85kB 23.98%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculatePower
 -525.43kB  6.11%  6.11% -2061.85kB 23.98%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateProcessPower
         0     0%  6.11% -2061.85kB 23.98%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).refreshSnapshot
         0     0%  6.11% -2061.85kB 23.98%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh
         0     0%  6.11% -2061.85kB 23.98%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh.func1
         0     0%  6.11% -1549.71kB 18.03%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).scheduleNextCollection.func1
-1536.42kB 17.87% 23.98% -1536.42kB 17.87%  github.com/sustainable-computing-io/kepler/internal/monitor.newProcess (inline)
         0     0% 23.98%  -512.14kB  5.96%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).Collect
         0     0% 23.98%   512.14kB  5.96%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*gpuInfoCollector).Collect
         0     0% 23.98%  -512.14kB  5.96%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).ensureFreshData
         0     0% 23.98%   512.14kB  5.96%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Process).Clone (inline)
         0     0% 23.98%   512.14kB  5.96%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Snapshot).Clone
  512.14kB  5.96% 18.03%   512.14kB  5.96%  maps.Copy[go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.interface { Energy ; Index int; MaxEnergy github.com/sustainable-computing-io/kepler/internal/device.Energy; Name string; Path string; Power  },go.shape.struct { EnergyTotal github.com/sustainable-computing-io/kepler/internal/device.Energy; Power github.com/sustainable-computing-io/kepler/internal/device.Power }] (inline)
💾 Memory Comparison with base Kepler (Alloc)
File: kepler
Build ID: 6985487da479911584994d01c33c9a56284228f2
Type: alloc_space
Time: 2026-02-04 10:27:07 UTC
Duration: 120.02s, Total samples = 203238.72kB 
Active filters:
   show=github.com/sustainable-computing-io
Showing nodes accounting for -6266.05kB, 3.08% of 203238.72kB total
Dropped 3 nodes (cum <= 1016.19kB)
      flat  flat%   sum%        cum   cum%
         0     0%     0% -5215.85kB  2.57%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).scheduleNextCollection.func1
         0     0%     0% -4058.77kB  2.00%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).Collect
         0     0%     0%  3116.51kB  1.53%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*gpuInfoCollector).Collect
         0     0%     0%  3114.31kB  1.53%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).ensureFreshData
-1536.13kB  0.76%  0.76% -3072.55kB  1.51%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Process).Clone (inline)
   -4.58kB 0.0023%  0.76% -2723.55kB  1.34%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*cpuInfoCollector).Collect
-2718.96kB  1.34%  2.10% -2718.96kB  1.34%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*realProcFS).CPUInfo
-1050.86kB  0.52%  2.61% -2587.11kB  1.27%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateProcessPower
-2560.30kB  1.26%  3.87% -2560.30kB  1.26%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PowerCollector).collectProcessMetrics
         0     0%  3.87% -2101.54kB  1.03%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculatePower
         0     0%  3.87% -2101.54kB  1.03%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).refreshSnapshot
         0     0%  3.87% -2101.54kB  1.03%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh
         0     0%  3.87% -2101.54kB  1.03%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).synchronizedPowerRefresh.func1
         0     0%  3.87%  1618.04kB   0.8%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).Snapshot
-2088.04kB  1.03%  4.90% -1576.03kB  0.78%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).AllProcs
-1536.42kB  0.76%  5.66% -1536.42kB  0.76%  maps.Copy[go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.map[github.com/sustainable-computing-io/kepler/internal/device.EnergyZone]github.com/sustainable-computing-io/kepler/internal/monitor.Usage,go.shape.interface { Energy ; Index int; MaxEnergy github.com/sustainable-computing-io/kepler/internal/device.Energy; Name string; Path string; Power  },go.shape.struct { EnergyTotal github.com/sustainable-computing-io/kepler/internal/device.Energy; Power github.com/sustainable-computing-io/kepler/internal/device.Power }] (inline)
 1576.28kB  0.78%  4.88% -1496.27kB  0.74%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Snapshot).Clone
         0     0%  4.88%  1056.33kB  0.52%  github.com/sustainable-computing-io/kepler/internal/resource.computeTypeInfoFromProc.func1
 1056.33kB  0.52%  4.36%  1056.33kB  0.52%  github.com/sustainable-computing-io/kepler/internal/resource.containerInfoFromCgroupPaths
         0     0%  4.36%  1056.33kB  0.52%  github.com/sustainable-computing-io/kepler/internal/resource.containerInfoFromProc
 1043.27kB  0.51%  3.85%  1043.27kB  0.51%  github.com/sustainable-computing-io/kepler/internal/resource.(*procFSReader).CPUUsageRatio
         0     0%  3.85%  1043.27kB  0.51%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh.func3
         0     0%  3.85%  1043.27kB  0.51%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshNode
-1024.25kB   0.5%  4.35% -1024.25kB   0.5%  github.com/sustainable-computing-io/kepler/internal/monitor.newProcess (inline)
         0     0%  4.35%  -543.10kB  0.27%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).Refresh
  521.05kB  0.26%  4.09%  -543.10kB  0.27%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).refreshProcesses
  516.64kB  0.25%  3.84%   516.64kB  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateNodePower
         0     0%  3.84%   516.01kB  0.25%  github.com/sustainable-computing-io/kepler/internal/exporter/prometheus/collector.(*PlatformCollector).Collect
         0     0%  3.84%   516.01kB  0.25%  github.com/sustainable-computing-io/kepler/internal/platform/redfish.(*PowerReader).ReadAll
  516.01kB  0.25%  3.59%   516.01kB  0.25%  github.com/sustainable-computing-io/kepler/internal/platform/redfish.(*PowerReader).readPowerSubsystem
         0     0%  3.59%   516.01kB  0.25%  github.com/sustainable-computing-io/kepler/internal/platform/redfish.(*Service).Power
         0     0%  3.59%   512.04kB  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*PowerMonitor).calculateContainerPower
  512.04kB  0.25%  3.33%   512.04kB  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.newContainer (inline)
  512.02kB  0.25%  3.08%   512.02kB  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.WrapProc (inline)
 -512.01kB  0.25%  3.33%  -512.01kB  0.25%  github.com/sustainable-computing-io/kepler/internal/monitor.(*Process).StringID (inline)
  511.87kB  0.25%  3.08%   511.87kB  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.(*procWrapper).CPUTime
         0     0%  3.08%   511.87kB  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.(*resourceInformer).updateProcessCache
         0     0%  3.08%   511.87kB  0.25%  github.com/sustainable-computing-io/kepler/internal/resource.populateProcessFields

⬇️ Download the Profiling artifacts from the Actions Summary page

📦 Artifact name: profile-artifacts-2401

🔧 Or use GitHub CLI to download artifacts:

gh run download 21651984794 -n profile-artifacts-2401

github.com/prometheus/exporter-toolkit v0.14.0
github.com/prometheus/procfs v0.15.1
github.com/stmcginnis/gofish v0.20.0
github.com/stmcginnis/gofish v0.20.1-0.20260203173523-22b2013b7c28
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we wait until we have a proper released tagged version?

Copy link
Author

Choose a reason for hiding this comment

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

If you want, but there's no reason not to use interim SHAs here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@stmcginnis Thanks for the PR. when is ETA of next release/tag? the API could change before the next release is made, right?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure yet on the timing for the next release. I'll probably cut one soon. But if there are any further changes before then they will just be small incremental updates. This is the biggest part of the refactoring.

@vprashar2929
Copy link
Collaborator

@stmcginnis Good to use https://github.com/stmcginnis/gofish/releases/tag/v0.21.0 ?

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.

3 participants