Commit Graph

191 Commits

Author SHA1 Message Date
Michael Schurter
ca38020521 0 compute == error 2017-07-03 14:51:02 -07:00
Michael Schurter
c10f530964 Fix cpu_total_compute override 2017-07-03 14:51:02 -07:00
Diptanu Choudhury
b0a20b4dc9 Fixed typo 2017-04-10 11:45:11 -07:00
Diptanu Choudhury
536fdde121 Added a test 2017-04-08 13:44:21 -07:00
Diptanu Choudhury
bee4b57368 Removed redundant code 2017-04-07 18:28:22 -07:00
Diptanu Choudhury
ad00ec861b Ignoring link local addresses 2017-04-07 16:04:36 -07:00
Diptanu Choudhury
94f9542a04 Finding the appropriate cidr block 2017-04-06 16:04:59 -07:00
Diptanu Choudhury
8b93d40298 Making the fingerprinter support ipv6 ips 2017-04-06 01:06:32 -07:00
Alex Dadgar
bfebe1afdc rename cpu_total_compute and docs 2017-03-14 14:15:49 -07:00
Alex Dadgar
36dc330737 Various fixes
This PR:
* Uses Go 1.8 executable lookup
* Stores any err message from stats init method
* Allows overriding of Cpu Compute for hosts where it can't be detected
2017-03-14 12:56:31 -07:00
Dave Walker (Daviey)
5d484dcb96 Enable kernel.version on Windows
Previously, this value was guarded against running on Windows
because it called the `uname` command which is unlikely to
be there.

This change now sets the value from gopsutil, which might
well be an empty string.

Signed-off-by: Dave Walker (Daviey) <email@daviey.com>
2017-03-01 18:48:23 +00:00
Dave Walker (Daviey)
5875bc1066 Don't exec uname for node attribute kernel.version
Previously with client fingerprinting, sys/exec's Command
function was being used to execute `uname -r` and the return
string processed into the kernel.version node attribute.

This change uses gopsutil/host KernelVersion function
instead.  This means we can drop the os/exec, strings and
fmt imports... and not execute an external binary.

Signed-off-by: Dave Walker (Daviey) <email@daviey.com>
2017-03-01 09:45:56 +00:00
Diptanu Choudhury
863120cc1a Fixed namespacing for the cpu arch 2017-01-06 14:23:22 -08:00
Alex Dadgar
cce384e0f1 Remove old TODOs 2016-11-15 16:23:37 -08:00
Alex Dadgar
5d4e0f18bc Updated AWS speeds and network_speed now overrides
This PR:

* Makes AWS network speeds more granular
* Makes `network_speed` an override and not a default
* Adds a default of 1000 MBits if no network link speed is detected.

Fixes #1985
2016-11-15 13:55:51 -08:00
Alex Dadgar
87201fa510 Run environmental fingerprinters after host fingerprinters and do an override 2016-11-07 12:21:50 -08:00
Alex Dadgar
008d91aa56 Advertise signalling abilities 2016-10-19 15:06:23 -07:00
Alex Dadgar
9ff2bf0bff Fix Vault parsing of booleans 2016-10-10 18:04:39 -07:00
Alex Dadgar
ca906ac660 small fixes 2016-09-01 13:38:31 -07:00
Alex Dadgar
f9391f041c Fingerprint 2016-09-01 11:10:14 -07:00
Kenjiro Nakayama
5e4dbd0ff3 tiny: Fix duplicated error message in CPU fingerprint 2016-08-07 12:49:40 +09:00
Michal Wieczorek
f60d2aed58 Link speed for windows network fingerprinting - tests 2016-07-22 22:49:03 +02:00
Michal Wieczorek
59b0e627d0 Link speed for windows network fingerprinting 2016-07-20 22:13:50 +02:00
Sean Chittenden
dd7c28165b Alpha-sort the build platforms 2016-07-11 12:23:46 -07:00
Sean Chittenden
fc8110ba96 Merge branch 'master' into f-resource-isolation-fingerprinter 2016-07-11 12:23:09 -07:00
Sean Chittenden
bb8b47d478 Remove cgroup fingerprinter from non-linux systems.
If someone wants to extend or reuse Cgroup detenction in the future they
can move `cgroup_linux.go` to `cgroup.go` and add the relevant build
tags.

Requested by: @dadgar
2016-07-11 12:16:56 -07:00
Alex Dadgar
3a98201f50 Get windows to build 2016-07-11 11:52:41 -06:00
Sean Chittenden
3d207247ad Merge branch 'f-resource-isolation-cleanup' into f-resource-isolation-fingerprinter 2016-07-11 00:10:21 -07:00
Sean Chittenden
c26bdebc28 Improve readability: use of a switch vs two if's 2016-07-10 20:18:57 -07:00
Sean Chittenden
226df7dea9 Skip the network fingerprinter test when offline.
Conditionalize the network fingerprinter test so that it works when a
user is offline.  Similarly, when the network fingerprint test fails in
the future pass a HINT to the user to set an env var to allow the test
to be skipped in the future.
2016-07-10 20:16:06 -07:00
Sean Chittenden
44487cc7f1 Build the Cgroup fingerprinter on only Linux.
Change the logic from `!linux` to an empty build tag so that *if*
another platform picks up Cgroups support they can add themselves to the
necessary build tags for this fingerprinter and be on their way.
Because this technology isn't inherently Linux-specific and isn't
mutually exclusive of other resource isolation containers, resist the
urge to rename the Cgroup fingerprinter to something generic like the
ResourceContainerFingerprinter.
2016-07-10 13:55:06 -07:00
Sean Chittenden
7524c13a16 Centralize the fingerprintrs.
Add platform specific fingerprinters per platform.

Requested by: @diptanu
2016-07-09 22:31:14 -07:00
Sean Chittenden
962cf7b07d Initialize the list of available fingerprinters per platform. 2016-07-09 00:22:42 -07:00
Sean Chittenden
762973e15f Consolidate fingerprinters into a single map. 2016-07-08 23:37:14 -07:00
Jake Champlin
b5b7b7d16e Update failing tests 2016-06-23 11:28:17 -04:00
Alex Dadgar
f2e28735a5 Treat float as int 2016-06-22 15:09:39 -07:00
Alex Dadgar
d87d988491 Floor CPU MHz and total compute and mark hostname as unique 2016-06-22 15:01:36 -07:00
Sean Chittenden
e26606acfd Memoize the CPU stats. Error if CPU fingerprinting fails. 2016-06-17 12:13:53 -07:00
Sean Chittenden
e42f7d5c23 Record and use only the first Mhz from the CPU fingerprinter.
Assume all cores are the same speed.
2016-06-17 11:06:57 -07:00
Sean Chittenden
b0490efb38 In the debug log, split the unit from the measurement
awk(1) friendly is UNIX(tm) friendly.
2016-06-16 23:07:13 -07:00
Sean Chittenden
e0b4f7a080 Warn when we're unable to fingerprint the CPU Mhz 2016-06-16 23:07:13 -07:00
Sean Chittenden
a6dc002415 Explicitly call cpu.Counts() to determine the CPU core count
Much safer than counting the number of InfoStat structs returned.
2016-06-16 23:07:13 -07:00
Sean Chittenden
8e1777ae3a Test for errors 2016-06-16 14:43:46 -07:00
Sean Chittenden
329057e22b Only actively test Consul when env CONSUL_HTTP_ADDR is set 2016-06-10 15:50:11 -04:00
Sean Chittenden
6785e7632c Provide a default ConsulConfig for client/config.DefaultConfig()
Change the unit test to only test if the consul link exists, not the
value of the link.  The old test was hostname specific and therefore
would always be different based on the environment running the tests.
2016-06-10 15:50:11 -04:00
Sean Chittenden
ab99e89bd9 Reconcile, clean up, and centralize API version numbers (major and minor).
Reduce future confusion by introducing a minor version that is gossiped out
via the `mvn` Serf tag (Minor Version Number, `vsn` is already being used for
to communicate `Major Version Number`).

Background: hashicorp/consul/issues/1346#issuecomment-151663152
2016-06-10 15:50:11 -04:00
Sean Chittenden
e6397da738 Centralize the creation of a consul/api.Config struct.
While documented, the consul.timeout parameter wasn't ever set
except one-off in the Consul fingerprinter.
2016-06-10 15:50:11 -04:00
Diptanu Choudhury
445b181fec Updated gopsutil 2016-05-28 19:42:34 -07:00
Sean Chittenden
29be52f762 Speling police 2016-05-15 09:41:34 -07:00
Sean Chittenden
a91f41ce14 Establish a floor of one core for the number of cores.
In most cases the upstream library [shirou/gopsutil](https://github.com/shirou/gopsutil)
needs to be fixed.
2016-05-09 12:22:40 -07:00