From 6123ba8b831ebc31b8de1303c22f7c2b6f1f195d Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Thu, 27 Aug 2015 13:35:54 -0700 Subject: [PATCH] Get average frequency of all CPUs so we can do average frequency * cores for total compute --- client/fingerprint/cpu.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/fingerprint/cpu.go b/client/fingerprint/cpu.go index 89b62515c..db9860715 100644 --- a/client/fingerprint/cpu.go +++ b/client/fingerprint/cpu.go @@ -42,6 +42,8 @@ func (f *CPUFingerprint) Fingerprint(cfg *config.Config, node *structs.Node) (bo } modelName = c.ModelName } + // Get average CPU frequency + mhz /= float64(len(cpuInfo)) if mhz > 0 { node.Attributes["cpu.frequency"] = fmt.Sprintf("%.6f", mhz)