Commit Graph

36 Commits

Author SHA1 Message Date
Alex Dadgar
3fbe8a1642 node-status -self command and docs 2016-03-29 12:36:24 -07:00
Alex Dadgar
0872c8effd node-status fix panic 2016-03-22 16:25:25 -07:00
Alex Dadgar
afbc8621ee less verbose output and show node's total resources 2016-03-20 17:36:40 -07:00
Diptanu Choudhury
3fd9aaafea Always defaulting to prefix match 2016-03-17 17:25:38 -07:00
Jake Champlin
9ed3150f6e Cleanup style, and make cleaner 2016-03-07 09:58:35 -05:00
Jake Champlin
35410e1487 Print resource usage w/ alloc-status + node-status
When alloc-status is called, in it's long form only, print the resource
utilization for that single allocation.

When node-status is called, in it's long form only, print the TOTAL
resource utilization that is occurring on that single node.

Nomad Alloc Status:

```
% nomad alloc-status 195d3bf2
ID              = 195d3bf2
Eval ID         = c917e3ee
Name            = example.cache[1]
Node ID         = 1b2520a7
Job ID          = example
Client Status   = running
Evaluated Nodes = 1
Filtered Nodes  = 0
Exhausted Nodes = 0
Allocation Time = 17.73µs
Failures        = 0

==> Task "redis" is "running"
Recent Events:
Time                   Type      Description
04/03/16 21:20:45 EST  Started   Task started by client
04/03/16 21:20:42 EST  Received  Task received by client

==> Status
Allocation "195d3bf2" status "running" (0/1 nodes filtered)
  * Score "1b2520a7-6714-e78d-a8f7-68467dda6db7.binpack" = 1.209464
  * Score "1b2520a7-6714-e78d-a8f7-68467dda6db7.job-anti-affinity" = -10.000000

==> Resources
CPU  MemoryMB  DiskMB  IOPS
500  256       300     0
```

Nomad Node Status:

```
% nomad node-status 57b3a55a
ID         = 57b3a55a
Name       = biscuits
Class      = <none>
DC         = dc1
Drain      = false
Status     = ready
Attributes = arch:amd64, cpu.frequency:3753.458875, cpu.modelname:Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz, cpu.numcores:8, cpu.totalcompute:30027.671000, driver.docker:1, driver.docker.version:1.10.2, driver.exec:1, driver.raw_exec:1, hostname:biscuits, kernel.name:linux, kernel.version:4.4.0-9-generic, memory.totalbytes:25208934400, os.name:ubuntu, os.version:16.04, unique.cgroup.mountpoint:/sys/fs/cgroup, unique.network.ip-address:127.0.0.1, unique.storage.bytesfree:219781419008, unique.storage.bytestotal:246059892736, unique.storage.volume:/dev/sdb3

==> Allocations
ID        Eval ID   Job ID   Task Group  Desired Status  Client Status
2c236883  aa11aca8  example  cache       run             running
32f6e3d6  aa11aca8  example  cache       run             running

==> Resource Utilization
CPU   MemoryMB  DiskMB  IOPS
1000  512       600     0
```
2016-03-07 09:58:35 -05:00
Jake Champlin
97e0c9795d Add -allocs to help output 2016-03-03 14:46:24 -05:00
Jake Champlin
859a556982 Only fetch running allocs, use args, add docs
Only fetch running allocations, not total allocated ids, add
documentation, and cleanup things.
2016-03-03 14:09:07 -05:00
Jake Champlin
1e7e9fb860 Include number of allocations in node-status
We recently ran into an issue on a small percentage of nomad-clients
where the nomad-client was running successfully, but due to a race
condition, could not correctly bind to the docker socket. This caused
all of our nomad jobs to be allocated to a single nomad-client instead
of being spread evenly across our clients. The only way to discover this
was to run `nomad node-status <node>` and count each job allocation per
node.

This can lead to a fairly long debugging process if there are several
nomad-clients. Including the number of allocations for each node in the
`node-status` command would save a large amount of debug time.

```
jake@biscuits [12:08:41] [~]
-> % nomad node-status
ID        Datacenter  Name      Class   Drain  Status  Allocations
2b0aabc5  dc1         biscuits  <none>  false  ready   0
```

```
jake@biscuits [12:08:55] [~]
-> % nomad node-status
ID        Datacenter  Name      Class   Drain  Status  Allocations
2b0aabc5  dc1         biscuits  <none>  false  ready   1
```
2016-03-03 12:19:56 -05:00
Alex Dadgar
bdb8512522 standardize on <> for required flags 2016-01-27 12:00:31 -08:00
Alex Dadgar
4836bd5656 limit length of string, taking into account its length 2016-01-27 10:42:10 -08:00
Alex Dadgar
7847357382 Merge pull request #692 from iverberk/f-detect-half-byte-prefix
Detect a half-byte prefix
2016-01-21 14:12:27 -08:00
Ivo Verberk
cc4fea99fc Provide a consistent user experience with prefix based lookups.
* Require at least two characters for identifier
* Automatically strip off the last character in case of uneven length
2016-01-21 22:21:35 +01:00
Alex Dadgar
b22cc67b0a Remove non-standard CLI element 2016-01-21 13:13:36 -08:00
Ivo Verberk
2559bd68c8 Do not use the exact internal field names in the CLI output 2016-01-21 21:35:56 +01:00
Ivo Verberk
de3bc00a00 Detect a half-byte prefix and display a user-friendly error. 2016-01-21 20:53:05 +01:00
Ivo Verberk
9770a95608 Refactoring of full-id argument and id length constants
* full-id argument is now called verbose to be more future-proof
* constants for identifier length are a little more concise
2016-01-15 23:32:38 +01:00
Ivo Verberk
ab9409184a Shorten CLI identifiers
* Truncate all UUID identifiers to eight characters by default
* Refactor the node identifier to an auto-generated UUID
* Created and updated tests and mocks
2016-01-14 21:57:43 +01:00
Alex Dadgar
012db31100 Change multiple match cli output 2016-01-06 15:08:47 -08:00
Ivo Verberk
62951082e2 Improvements for short identifiers
* Fix tests
* Update documentation
2016-01-06 22:46:57 +01:00
Ivo Verberk
905742249e Refactoring continued
* Refactor other cli commands to new design
* Add PrefixList method to api package
* Add more tests
2015-12-24 20:53:37 +01:00
Ivo Verberk
e89b5af338 Refactoring
* Reverted changes to get methods
* Added prefix query parameter
* Updated node status to use prefix based searching
* Fixed tests
* Removed truncation logic
2015-12-22 23:44:33 +01:00
Ivo Verberk
1af7c579f9 Revert "On cli node status list print the short Node ID when possible"
This reverts commit 5d3bd1b6f0.
2015-12-22 10:18:58 +01:00
Armin
5d3bd1b6f0 On cli node status list print the short Node ID when possible 2015-12-20 17:33:27 +01:00
Ivo Verberk
7ae975e1a2 Allow lookups based on short identifiers
This change introduces the ability to specify identifiers for jobs,
allocs, evals and nodes on the command line with as little as one
character, provided that it uniquely identifies the resource. An error
with the possible results will be provided when the short identifier
has multiple results.
2015-12-12 18:28:20 +01:00
Abhishek Chanda
db2dd3b614 Show node attribute in node-status
Adds node attributes to the node-status command when a single
node ID is passed
2015-10-22 10:34:21 +00:00
Armon Dadgar
8e11e8c3fa command/node-status: removing extra formating input 2015-09-22 21:48:43 -07:00
Ryan Uber
acd0d16a7a command: final adjustments for list output 2015-09-15 16:51:17 -07:00
Ryan Uber
210ee0bbb7 command: helpers for columns 2015-09-15 16:44:38 -07:00
Ryan Uber
c706942ece command: output adjustments 2015-09-15 13:21:49 -07:00
Ryan Uber
550434dc9b command: dump allocations for nodes in node-status 2015-09-15 11:20:08 -07:00
Ryan Uber
c778599e9e command: separate k/v pairs with an '=' 2015-09-14 20:29:08 -07:00
Ryan Uber
7e26f938a2 command: use meta struct for common options 2015-09-14 13:24:03 -07:00
Ryan Uber
0e16348052 command: cleanup 2015-09-14 13:24:03 -07:00
Ryan Uber
98708120f7 command: more cli tests 2015-09-14 13:24:03 -07:00
Ryan Uber
a0c8a0bc0d command: add node-status command 2015-09-14 13:24:03 -07:00