Alex Dadgar
4173834231
Enable more linters
2017-09-26 15:26:33 -07:00
Alex Dadgar
07ed83fdd5
Non-locked accessors to common Node fields
...
This PR removes locking around commonly accessed node attributes that do
not need to be locked. The locking could cause nodes to TTL as the
heartbeat code path was acquiring a lock that could be held for an
excessively long time. An example of this is when Vault is inaccessible,
since the fingerprint is run with a lock held but the Vault
fingerprinter makes the API calls with a large timeout.
Fixes https://github.com/hashicorp/nomad/issues/2689
2017-09-14 14:08:26 -07:00
Alex Dadgar
3ec7946b3e
Fix invalid CPU stats on Windows
...
This PR fixes an issue introduced in Nomad 0.6.0 due to
https://github.com/shirou/gopsutil/issues/420 . The issue arised from the
fact that the Windows stats from gopsutil reports CPUs in
percentages where we expected ticks.
2017-09-10 15:30:48 -07:00
James Nugent
448145872f
client: Guard against "NaN" values from floats
...
This commit protects against finding `0.NaN` tokens in JSON streams
because of infinity representation on serialization.
2017-09-08 16:21:07 -05:00
Michael Schurter
78823d559b
Squelch logspam when unable to get disk usage stats
...
To reproduce logspam:
```
$ docker plugin install --grant-all-permissions vieux/sshfs
$ nomad agent -dev
...
2017/08/25 17:09:03.282868 [WARN] client: error fetching host disk usage stats for /var/lib/docker/plugins/a8b4a69b07e5180f828d19e1e9e102ccc0e26f9c9939eaef85357260c30b20a7/rootfs/mnt/volumes: permission denied
... repeats every collection period ...
```
2017-08-28 12:04:32 -07:00
Alex Dadgar
bb329977a4
Fix nil dereference
2017-01-10 14:14:58 -08:00
Diptanu Choudhury
6e6e0d364a
Added comments
2016-12-20 10:49:48 -08:00
Diptanu Choudhury
36b5545d6b
Making the gc allocator understand real disk usage
2016-12-16 18:34:59 -08:00
Diptanu Choudhury
e855cd587b
Refactored hoststats collector
2016-12-14 15:07:42 -08:00
Christoffer Kylvåg
6a1f32b8ba
#1680 : Continue after not being able to stat a mountpoint
2016-12-13 12:28:57 +01:00
Kenjiro Nakayama
fe13453012
Update after the review
2016-08-11 10:53:33 +09:00
Kenjiro Nakayama
c3b871e90d
Return error when client failed to collect host stats
2016-08-11 09:38:28 +09:00
Alex Dadgar
3cd9c9590b
guard against NaN
2016-06-20 10:29:46 -07:00
Diptanu Choudhury
a5e81ebc3a
Removing un-used code
2016-06-12 01:23:49 +02:00
Diptanu Choudhury
86e4f295da
Fixed the calculation of the host node ticks
2016-06-12 01:14:51 +02:00
Diptanu Choudhury
7fb507e810
Moving the clkspeed code to helper
2016-06-11 17:31:49 +02:00
Diptanu Choudhury
59540c3e93
Extracted a method for getting clock speed
2016-06-11 02:07:28 +02:00
Diptanu Choudhury
01054db4fa
Calculating total ticks consumed in the nomad client
2016-06-10 23:14:33 +02:00
Diptanu Choudhury
c0dc6cfbf2
Changing the api of the stats endpoints
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
2b37f08d49
creating the host cpu percent calculator lazily
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
c2da19bf11
Refactored the api for NewHostStatsCollector
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
05c221186b
Added disk usage to node status
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
cf247c1309
Added uptime to node stats
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
73fa700a88
Showing host resource usage stats
2016-05-28 19:59:20 -07:00
Diptanu Choudhury
91d2cf319e
Added some documentation
2016-05-28 19:42:34 -07:00
Diptanu Choudhury
7569b1af2e
Collecting host stats
2016-05-28 19:42:34 -07:00