Commit graph

1342 commits

Author SHA1 Message Date
Scott Schneider
fd90756b83 Merge pull request #77 from colinPL/qeng_1906
(QENG-1906) Refactor initialize to allow config passing
2015-03-31 10:10:42 -07:00
Colin
1408f35867 (QENG-1906) Refactor initialize to allow config passing
Prior to this commit, several pieces of vmpooler performed configuration
and initialization steps within 'initialize'. This made it difficult to
pass in mock objects for testing purposes.

This commit performs a single configuration and passes the results to
the various pieces of vmpooler.
2015-03-30 14:23:06 -07:00
Colin
34fd054a48 Merge pull request #75 from sschneid/query_destroyed_vms
Use 'checkout' time to calculate 'running' time
2015-03-25 13:52:15 -07:00
Scott Schneider
858d4c7541 Use 'checkout' time to calculate 'running' time 2015-03-25 13:41:26 -07:00
Colin
91563c0408 Merge pull request #71 from sschneid/historic_redis_vm_metadata
(QENG-2057) Historic Redis VM metadata
2015-03-25 12:48:56 -07:00
Colin
5a7b3c45de Merge pull request #73 from sschneid/vm_tagging
Catch improperly-formatted data payloads
2015-03-20 13:06:53 -07:00
Scott Schneider
10db0c4c6a Catch improperly-formatted data payloads 2015-03-20 13:03:29 -07:00
Colin
32ead5f43a Merge pull request #72 from sschneid/vm_tagging
(QENG-1905) Adding VM-tagging support via PUT /vm/:hostname endpoint
2015-03-20 13:01:52 -07:00
Scott Schneider
d48d487de0 Validate data payload before operating on it 2015-03-20 12:52:17 -07:00
Scott Schneider
7b97e58e0f Clean up Redis VM objects after redis['data_ttl'] 2015-03-20 10:25:51 -07:00
Scott Schneider
48a9ef0dfd Store checkout and destroy timestamps 2015-03-20 09:57:47 -07:00
Scott Schneider
99a18c781a Adding VM-tagging support via PUT /vm/:hostname endpoint 2015-03-19 11:27:39 -07:00
Scott Schneider
1b8435a63a Merge pull request #67 from colinPL/readme_summary
(QENG-1899) Add documentation for /summary
2015-03-11 13:22:05 -07:00
Colin
0f12cc2716 (QENG-1899) Add documentation for /summary
Add documentation to the README file for the /summary end point,
including how to call with and without parameters as well as the
resulting JSON responses.
2015-03-11 13:09:46 -07:00
Roger Ignazio
fa4147fb68 Merge pull request #66 from sschneid/hgetall_not_hget_in_a_loop
Use $redis.hgetall rather than hget in a loop
2015-03-09 11:43:19 -07:00
Scott Schneider
558c70ab0d Use $redis.hgetall rather than hget in a loop
This cuts down on render-time for the /api/v1/summary endpoint drastically.
2015-03-09 11:12:39 -07:00
Colin
6409dedd3e Merge pull request #65 from sschneid/per_pool_summary_metrics
/summary per-pool metrics
2015-03-06 14:49:19 -08:00
Scott Schneider
d1e4acbd55 /summary per-pool metrics
This commit also consolidates the 'get_boot_metrics' and
'get_clone_metrics' methods into a single parameterized
'get_task_metrics' method.
2015-03-06 14:40:39 -08:00
Scott Schneider
e83b3e47af (maint) fix typo 2015-03-04 20:03:16 -08:00
Colin
89ee786908 Merge pull request #64 from sschneid/boot_metrics
Show boot metrics in /status and /summary endpoints
2015-03-04 16:09:45 -08:00
Scott Schneider
c86f680a41 Show boot metrics in /status and /summary endpoints 2015-03-04 16:06:42 -08:00
Colin
1fa2da575a Merge pull request #61 from sschneid/more_granular_metrics
More granular metrics
2015-03-04 16:02:38 -08:00
Scott Schneider
18703efd60 Guard against nil VM clone time 2015-03-04 13:06:49 -08:00
Colin
5454352039 Merge pull request #63 from sschneid/syntax_spacing
(maint) Fixing spacing
2015-03-04 11:38:01 -08:00
Scott Schneider
7f8d4111ef (maint) Fixing spacing 2015-03-04 11:36:37 -08:00
Colin
c4b3dda2f5 Merge pull request #62 from sschneid/metric_calc_via_helper
Metric calc via helpers
2015-03-04 11:31:52 -08:00
Scott Schneider
e347e2b6b4 Don't include daily_clone durations in average if nothing was cloned 2015-03-04 11:28:31 -08:00
Scott Schneider
35e78aacb5 Use 'date_str' instead of 'date' 2015-03-04 11:12:23 -08:00
Scott Schneider
5453ec6206 Use new helper methods in /summary route 2015-03-04 10:28:19 -08:00
Scott Schneider
201897214b Move clone metric-gathering to 'get_clone_metrics' helper 2015-03-04 09:58:11 -08:00
Scott Schneider
1397ff93c1 Move capacity metric-gathering to 'get_capacity_metrics' helper 2015-03-04 09:49:16 -08:00
Scott Schneider
fd0e5cb438 Move queue metric-gathering to 'get_queue_metrics' helper 2015-03-04 09:41:10 -08:00
Scott Schneider
0c3f84e072 Slight rework of data param validation 2015-03-04 09:31:56 -08:00
Scott Schneider
c1099a8273 Add 'get_clone_times' helper 2015-03-04 09:21:06 -08:00
Scott Schneider
4f880497b7 Alphabetize existing helpers 2015-03-04 09:15:04 -08:00
Scott Schneider
ba01b60541 Store template (pool) name with hostname in Redis metric keys 2015-03-03 15:21:06 -08:00
Scott Schneider
a2a8515728 Track 'boot' (pending -> ready) durations 2015-03-03 15:16:17 -08:00
Colin
a50b9bae10 Merge pull request #60 from sschneid/versioned_api
Versioned API restructure
2015-02-27 13:25:21 -08:00
Scott Schneider
6d6dbfa2c8 Initial 2015-02-26 15:13:24 -08:00
Colin
b965ce3a55 Merge pull request #59 from sschneid/maint
Set HTTP status codes, a bit of code standardization
2015-02-26 09:54:47 -08:00
Scott Schneider
0a9d4e4a3f Don't return 503 for a valid GET /status request 2015-02-26 09:51:14 -08:00
Scott Schneider
a8ecd59014 Merge pull request #58 from colinPL/json_gen_error
(maint) Fix Divide by 0 Bug
2015-02-25 17:47:22 -08:00
Scott Schneider
bfbcde24be set proper HTTP status codes 2015-02-25 17:46:31 -08:00
Scott Schneider
c66315ce26 deprecate 'Hash.new' for '{}' 2015-02-25 17:46:29 -08:00
Scott Schneider
2fa7e1e736 move 'content_type :json' to the beginning of endpoint defs 2015-02-25 17:24:28 -08:00
Colin
67ee061776 (maint) Fix Divide by 0 Bug
When a redis key does not exist for a single-day summary, the
total_clones_per_day array has a length of 1 with a single value of 0.
This gets past an initial check of array length, but is then reduced to
a value of 0, which is then used as the denominator of an average
calculation. The result of this calculation is NaN and later causes
JSON.pretty_generate to raise an exception.

This also includes a check on the min_max_clone_times array, because
[].minmax returns [nil, nil].
2015-02-25 15:52:26 -08:00
Colin
251ae36aa7 Merge pull request #56 from sschneid/summary_default_from
Use today as a default 'from' value
2015-02-25 15:51:21 -08:00
Colin
b044ea6c8e Merge pull request #57 from sschneid/not_found_ok_false
Set Sinatra not_found to JSON ok: false
2015-02-25 15:20:28 -08:00
Scott Schneider
e121adb76b Set Sinatra not_found to JSON ok: false 2015-02-25 15:02:29 -08:00
Scott Schneider
7d013a4c2f Use today as a default 'from' value 2015-02-25 14:49:29 -08:00