right_chimp 2.1.7 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5ebf63eb4e362b8ca04cd63a9024783e4fe2da4
4
- data.tar.gz: 224050b386b01bfa51502c518a30236cc8abfe5d
3
+ metadata.gz: 83fd9994cdfae0dd10d1122dc7e645abc9923632
4
+ data.tar.gz: 243da13a5197c1504d1ed2825be68ef30dbdce1f
5
5
  SHA512:
6
- metadata.gz: e2cb89a0e116334d4489c5216096992c719236e30c0f518e5d4e22a175250a29dde39baa13abd7c95759c27c7959d86c1653abb0f65800dfaf1b09c31ac63b54
7
- data.tar.gz: eff590fd49f325549033f32d1f9c928734e0bff6f9b95e18fe58a6821327bd0fa44eec1f96fe10f6adaf348bda12a6b3a5c5d4814d50dd9b8b94143067310fad
6
+ metadata.gz: 658cbfc45bb6fcb49c64c46e2cb1517065a2cbdb5e82b2e09349299f653c65f2f31d99d3426dbd3c936c8c665f980f5a7435314e363ac64a124dceca2f320e92
7
+ data.tar.gz: a55a1b56dc09f4fec0409b80ab779828f6f530048abe93435700c29df23b4d8d15fac83628e7c133be4581632cdc4fc147efcfb91670d6ccb580fd7f68b0fc28
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- right_chimp (2.1.5)
4
+ right_chimp (2.1.8)
5
5
  highline (~> 1.7.2)
6
6
  nokogiri (~> 1.5.9)
7
7
  progressbar (~> 0.11.0)
@@ -12,14 +12,14 @@ GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
14
  diff-lcs (1.1.3)
15
- domain_name (0.5.24)
15
+ domain_name (0.5.25)
16
16
  unf (>= 0.0.5, < 1.0.0)
17
- highline (1.7.3)
17
+ highline (1.7.8)
18
18
  http-cookie (1.0.2)
19
19
  domain_name (~> 0.5)
20
20
  json (1.8.3)
21
21
  mime-types (1.25.1)
22
- netrc (0.10.3)
22
+ netrc (0.11.0)
23
23
  nokogiri (1.5.11)
24
24
  progressbar (0.11.0)
25
25
  rake (10.4.2)
@@ -27,7 +27,7 @@ GEM
27
27
  http-cookie (>= 1.0.2, < 2.0)
28
28
  mime-types (>= 1.16, < 3.0)
29
29
  netrc (~> 0.7)
30
- right_api_client (1.5.28)
30
+ right_api_client (1.6.1)
31
31
  json (~> 1.0)
32
32
  mime-types (~> 1.0)
33
33
  rest-client (~> 1.6)
@@ -532,7 +532,7 @@ module Chimp
532
532
  #
533
533
  # Check if we are asked for stats
534
534
  #
535
- if req.request_uri.path =~ /stats/
535
+ if req.request_uri.path =~ /stats$/
536
536
  queue = ChimpQueue.instance
537
537
  stats = ""
538
538
  stats << "running: #{queue.get_jobs_by_status(:running).size} / "
@@ -547,6 +547,47 @@ module Chimp
547
547
  raise WEBrick::HTTPStatus::OK
548
548
  end
549
549
 
550
+ if req.request_uri.path =~ /stats\.json$/
551
+ # instance the queue
552
+ queue = ChimpQueue.instance
553
+
554
+ stats_hash = {"running" => queue.get_jobs_by_status(:running).size,
555
+ "waiting" => queue.get_jobs_by_status(:waiting).size,
556
+ "failed" => queue.get_jobs_by_status(:error).size,
557
+ "done" => queue.get_jobs_by_status(:done).size,
558
+ "processing" => ChimpDaemon.instance.proc_counter.to_s,
559
+ "holding" => queue.get_jobs_by_status(:holding).size
560
+ }
561
+
562
+ resp.body = JSON.generate(stats_hash)
563
+
564
+ raise WEBrick::HTTPStatus::OK
565
+ end
566
+
567
+ if req.request_uri.path =~ /jobs\.json$/
568
+ #instance the queue
569
+ queue = ChimpQueue.instance
570
+
571
+ job_types = [ :running, :error, :done ]
572
+
573
+ jobs = {}
574
+
575
+ job_types.each do |type|
576
+ jobs[type] = queue.get_jobs_by_status(type).map do |job|
577
+ { :id => job.job_id,
578
+ :server => job.server.params["name"],
579
+ :name => job.exec.params["right_script"]["name"],
580
+ :error_message => job.error.nil? ? "" : job.error.message
581
+ }
582
+ end
583
+ end
584
+
585
+ resp.body = jobs.to_json
586
+
587
+ raise WEBrick::HTTPStatus::OK
588
+ end
589
+
590
+
550
591
  #
551
592
  # Check for static CSS files and serve them
552
593
  #
@@ -1,3 +1,3 @@
1
1
  module Chimp
2
- VERSION = "2.1.7"
2
+ VERSION = "2.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_chimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.7
4
+ version: 2.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - RightScale Operations
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-14 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake