barbeque 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/models/barbeque/job_definition.rb +10 -3
- data/lib/barbeque/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a43082ae404cbe883e4ba07cbd59e6704c928ab3
|
4
|
+
data.tar.gz: a2f5fabeb566ac7c2345c5b77f7e4093d43243f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb8b997431c6661bd6c5fd03dfcc17a1c86146b8e88db452aa43b1d668ea1473375c6dd42ce6c54057c965cc6a6fab7181818e01a9aab337f6acf1cee2149e5d
|
7
|
+
data.tar.gz: 833426bd91b0901351f491b4962ebc7f15460cb181b66f2d9242358279e9ae288a49a13563c96a4d705ffffe512c26d7bfa5268072717b977fc7af90053f62f6
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Job queue system to run job with Docker
|
|
8
8
|
## Project Status
|
9
9
|
|
10
10
|
Barbeque is under development but already used on production at Cookpad.
|
11
|
-
Documentation
|
11
|
+
Documentation is work in progress.
|
12
12
|
|
13
13
|
## What's Barbeque?
|
14
14
|
|
@@ -24,8 +24,8 @@ In Barbeque worker, they are done on Docker container.
|
|
24
24
|
|
25
25
|
## Why Barbeque?
|
26
26
|
|
27
|
-
- You can achieve job-level auto scaling using tools like [Amazon ECS](https://aws.amazon.com/ecs/)
|
28
|
-
-
|
27
|
+
- You can achieve job-level auto scaling using tools like [Amazon ECS](https://aws.amazon.com/ecs/) [EC2 Auto Scaling group](https://aws.amazon.com/autoscaling/)
|
28
|
+
- For Amazon ECS, Barbeque has Hako runner
|
29
29
|
- You don't have to manage infrastructure for each application like Resque or Sidekiq
|
30
30
|
|
31
31
|
For details, see [Scalable Job Queue System Built with Docker // Speaker Deck](https://speakerdeck.com/k0kubun/scalable-job-queue-system-built-with-docker).
|
@@ -15,12 +15,19 @@ class Barbeque::JobDefinition < Barbeque::ApplicationRecord
|
|
15
15
|
DATE_HOUR_SQL = 'date_format(created_at, "%Y-%m-%d %H:00:00")'
|
16
16
|
|
17
17
|
def execution_stats(from, to)
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
from = from.beginning_of_hour
|
19
|
+
to = to.beginning_of_hour
|
20
|
+
stats = Hash.new { |h, k| h[k] = { count: 0, avg_time: 0 } }
|
21
|
+
job_executions.where(created_at: from .. to).group(DATE_HOUR_SQL).order(DATE_HOUR_SQL).pluck("#{DATE_HOUR_SQL}, count(1), avg(timestampdiff(second, created_at, finished_at))").each do |date_hour, count, avg_time|
|
22
|
+
time = Time.zone.parse("#{date_hour} UTC")
|
23
|
+
stats[time] = {
|
21
24
|
count: count,
|
22
25
|
avg_time: avg_time,
|
23
26
|
}
|
24
27
|
end
|
28
|
+
(from.to_i ... to.to_i).step(1.hour).map do |t|
|
29
|
+
time = Time.at(t)
|
30
|
+
stats[time].merge(date_hour: time)
|
31
|
+
end
|
25
32
|
end
|
26
33
|
end
|
data/lib/barbeque/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barbeque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: adminlte2-rails
|
@@ -387,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
387
387
|
version: '0'
|
388
388
|
requirements: []
|
389
389
|
rubyforge_project:
|
390
|
-
rubygems_version: 2.
|
390
|
+
rubygems_version: 2.6.8
|
391
391
|
signing_key:
|
392
392
|
specification_version: 4
|
393
393
|
summary: Job queue system to run job with Docker
|