Get average frequency of all CPUs so we can do average frequency * cores for total compute

This commit is contained in:
Chris Bednarski 2015-08-27 13:35:54 -07:00
parent e3348ad809
commit 6123ba8b83
1 changed files with 2 additions and 0 deletions

View File

@ -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)