Commit Graph

136 Commits

Author SHA1 Message Date
Sean Chittenden
9656a2045c Initialize the stats helpers before accessing them for the first time 2016-06-17 13:23:30 -07:00
Alex Dadgar
f320b5a76f address comments 2016-06-13 17:32:18 -07:00
Alex Dadgar
1e4ec6b2b3 Fix IDs and domain scoping 2016-06-13 16:30:58 -07:00
Diptanu Choudhury
02b320c81e implemented reconciliation of unwanted services 2016-06-13 14:52:26 +02:00
Alex Dadgar
e90e92da9f register checks 2016-06-12 21:28:56 -07:00
Alex Dadgar
b1351a3564 Do not reconcile in client and cleanup executor a bit 2016-06-12 18:22:07 -07:00
Alex Dadgar
c5059fc7c4 Rename ConsulService back to Service 2016-06-12 16:36:49 -07:00
Alex Dadgar
54f6f57448 Merge pull request #1262 from hashicorp/remove-artifact-check
Removing artifact check for java and qemu drivers
2016-06-12 11:21:18 -07:00
Diptanu Choudhury
f795e215b4 Setting a flag to indicate whether fs isolation is indeed happening 2016-06-12 15:43:24 +02:00
Diptanu Choudhury
12f3da9ad4 Not converting the abs path relative to task dir for drivers which enforce FS isolation only in linux 2016-06-12 13:54:30 +02:00
Alex Dadgar
1a7df4e7d2 Allocation resources returned in a struct 2016-06-11 21:04:10 -07:00
Sean Chittenden
9b6e720fbe Merge pull request #1201 from hashicorp/f-dyn-server-list
Dynamic Server Lists/Client Bootstrapping via consul.
2016-06-11 18:58:25 -04:00
Sean Chittenden
183b51d819 Remove default values and use nil for the executor. Much better. 2016-06-11 17:52:09 -04:00
Sean Chittenden
2879c33c8f Perform a nil-check for Executor's consulServices.
Executors can `Shutdown()` before calling `SyncServices()`.
2016-06-10 23:43:54 -04:00
Diptanu Choudhury
304403a2f8 Extracted a method for getting clock speed 2016-06-11 02:07:28 +02:00
Diptanu Choudhury
446d3f22f2 Pruning out pids which are no longer present 2016-06-11 01:40:52 +02:00
Diptanu Choudhury
d31034941a Not reset-ing the list of pids if they don't change 2016-06-11 01:19:50 +02:00
Diptanu Choudhury
4ac1c673aa Implementing the total ticks per task for the docker driver 2016-06-10 23:33:25 +02:00
Diptanu Choudhury
c13e750a02 Calculating the cpu ticks in nomad client 2016-06-10 22:22:32 +02:00
Sean Chittenden
91582dc875 Always create a consul.Syncer. Use a default Consul Config if necessary. 2016-06-10 15:55:27 -04:00
Sean Chittenden
aff951ca4e Always create a consul.Syncer. Use a default Consul Config if necessary. 2016-06-10 15:55:27 -04:00
Sean Chittenden
d1ab21f2f7 Generate and sync Consul ServiceIDs consistently 2016-06-10 15:54:39 -04:00
Sean Chittenden
3052e7477a Move the start of the UniversalExecutor's consulSyncer to initialize once
This should be handled via a sync.Once primative, but I don't want to
unpack that atm.
2016-06-10 15:54:39 -04:00
Sean Chittenden
54838b9eba Rename structs.Task's Service attribute to ConsulService 2016-06-10 15:54:39 -04:00
Sean Chittenden
57c2c819e8 Move package client/consul/sync to command/agent/consul.
This has been done to allow the Server and Client to reuse the same
Syncer because the Agent may be running Client, Server, or both
simultaneously and we only want one Syncer object alive in the agent.
2016-06-10 15:54:39 -04:00
Sean Chittenden
e858928d68 Rename Syncer.SetServiceIdentifier to SetServiceRegPrefix()
This attribute isn't actually an identifier because it can represent
a collection of services.  Rename `serviceIdentifier` to
`serviceRegPrefix which more accurately conveys the intention of this
Syncer attribute.

While here, also rename `SetServiceIdentifier()` to `SetServiceRegPrefix()`
and `GenerateServiceIdentifier()` to `GenerateServicePrefix()`.
2016-06-10 15:54:39 -04:00
Sean Chittenden
74e691cab1 Change the API signature of Syncer.SyncServices().
SyncServices() immediately attempts to sync whatever information
the process has with Consul.  Previously this method would take an
argument of the exclusive list of services that should exist,
however this is not condusive to having a Nomad Client and Nomad
Server share the same consul.Syncer.
2016-06-10 15:54:39 -04:00
Sean Chittenden
1352f7f0e6 Change client/consul.NewSyncer() to accept a shutdown channel
In addition to the API changing, consul.Syncer can now be signaled
to shutdown via the Shutdown() method, which will call the Run()'ing
sync task to exit gracefully.
2016-06-10 15:54:39 -04:00
Sean Chittenden
d268dcb85d Reduce all forms of ConsulConfig down to a single struct
nomad/structs/config/consul.go's ConsulConfig is the canonical definition
for all things Consul now.
2016-06-10 15:50:11 -04:00
Sean Chittenden
7c6ad53d89 Rename NewConsulService to NewSyncer 2016-06-10 15:49:37 -04:00
Sean Chittenden
f280c59633 Rename client/consul/sync.PeriodicSync to Run 2016-06-10 15:49:37 -04:00
Sean Chittenden
d84d71847c Rename client/consul/sync.ConsulService to client/consul/sync.Syncer
Syncer describes the responsibility and actions of the type.
2016-06-10 15:49:37 -04:00
Sean Chittenden
8e256471a9 Rename ConsulConfig to ConsulAgentConfig 2016-06-10 15:48:36 -04:00
Sean Chittenden
0e1bdad2a0 Rename consul.ConsulConfig to consul.AgentConfig
There were two `ConsulConfig` structs running around, one of them
needed to go away.  Rely on the package's path to provide context
for the type of AgentConfig.
2016-06-10 15:48:36 -04:00
Alex Dadgar
2be78d2ba8 fix types 2016-06-10 11:52:15 -07:00
Alex Dadgar
a8b1d31812 use time.Second instead of our own const 2016-06-10 11:38:59 -07:00
Alex Dadgar
693c8f9e42 Alloc-status only shows measured statistics and fixes to CPU calculations 2016-06-10 10:38:29 -07:00
Diptanu Choudhury
d594d95012 Fixed merge conflicts 2016-06-10 04:47:34 +01:00
Diptanu Choudhury
06e90cb6c0 Using named variables 2016-06-10 04:45:16 +01:00
Diptanu Choudhury
8d52390aca Fixed calculation of cpu usage percent in user and sys mode for pids 2016-06-10 04:06:32 +01:00
Alex Dadgar
17af581d93 Annotate what is measured 2016-06-09 19:45:41 -07:00
Alex Dadgar
757bc66321 fix wait result being nil and some panics in the cli 2016-05-31 23:09:05 +00:00
Diptanu Choudhury
15e79c3783 Changing the api of the stats endpoints 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
f765e82a11 Stopping the metrics collector timers using defer and starting to collect host stats right away 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
b51b08b39e Added a test to validate we are collecting stats 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
c99733e8c7 Fixed the compilation on linux 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
2c5233814a simplified the stats method in basic executor 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
f59ad3da53 Fixed the logic of scanpids 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
584c1e34fb Incorporated review comments for executor 2016-05-28 19:59:20 -07:00
Diptanu Choudhury
6132ccc230 Added pidstats in task resource usage struct 2016-05-28 19:59:20 -07:00