subspace 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/ansible/roles/apache-rails/templates/project.conf +1 -0
- data/ansible/roles/collectd/tasks/main.yml +8 -0
- data/ansible/roles/collectd/templates/rails_lograge.conf +31 -1
- data/ansible/roles/puma/tasks/main.yml +2 -2
- data/lib/subspace/cli.rb +1 -0
- data/lib/subspace/commands/ssh.rb +9 -1
- data/lib/subspace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9292a51100ec75aaa115290b5220c7dc9dc6bb7
|
4
|
+
data.tar.gz: 791331cd64e3dcc1b450c8a1d4ba5839cdca0d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65cae20f78b81ada19a5ef63a0f61fc131059276a7b6fc892105b08eaef71d7596ba2add94dd3aa0803b522034652e1bb44287d24c2501f8ecf3ed55c9e05a51
|
7
|
+
data.tar.gz: 471bca6a702f80484fd7c7d92001103da6e6b712f5ef991434f6dde0fdcd67e8e039238ef8ce0f2b9db5ab8405d6261969318a8204a6e16d668d29d3ffcab6d6
|
data/README.md
CHANGED
@@ -117,11 +117,18 @@ Collectd is a super useful daemon that grabs and reports statistics about a serv
|
|
117
117
|
Aside from basic statistics like free memory, disk, load averages, etc, we have some custom things:
|
118
118
|
|
119
119
|
1. If Postgres and delayed job are installed, it will collect stats on number of outstanding delayed jobs.
|
120
|
+
a. If you have pg on a different server or in RDS, you can set this manually:
|
121
|
+
|
122
|
+
collectd_pgdj: true
|
123
|
+
|
120
124
|
2. If apache is installed, it will collect stats from the /server-status page
|
121
|
-
3.
|
125
|
+
3. If nginx is installed, it will collect stats from the "status port"
|
122
126
|
4. (TODO) add something for pumas
|
123
127
|
5. (TODO) add something for sidekiq
|
124
128
|
6. (TODO) add something for memcache
|
129
|
+
7. If you're using our standard lograge format, you can enable lograge collection which will provide stats on request count and timers (db/view/total)
|
130
|
+
|
131
|
+
rails_lograge: true
|
125
132
|
|
126
133
|
|
127
134
|
## common
|
@@ -65,3 +65,11 @@
|
|
65
65
|
notify: restart collectd
|
66
66
|
when: nginx_installed is defined
|
67
67
|
|
68
|
+
- name: create rails_lograge config
|
69
|
+
template:
|
70
|
+
src: rails_lograge.conf
|
71
|
+
dest: /etc/collectd/collectd.conf.d/rails_lograge.conf
|
72
|
+
sudo: true
|
73
|
+
notify: restart collectd
|
74
|
+
when: rails_lograge is defined
|
75
|
+
|
@@ -1 +1,31 @@
|
|
1
|
-
|
1
|
+
LoadPlugin "tail"
|
2
|
+
<Plugin "tail">
|
3
|
+
<File "/u/apps/{{project_name}}/shared/log/{{rails_env}}.log">
|
4
|
+
Instance "rails_lograge"
|
5
|
+
# controller=Api::V1::HabitQuestionsController action=answer status=200 duration=101.88 view=0.74 db=65.12
|
6
|
+
<Match>
|
7
|
+
Regex "duration="
|
8
|
+
DSType "CounterInc"
|
9
|
+
type "counter"
|
10
|
+
Instance "request"
|
11
|
+
</Match>
|
12
|
+
<Match>
|
13
|
+
Regex "duration=([\d.]+)"
|
14
|
+
DSType "GaugeAverage"
|
15
|
+
Type "response"
|
16
|
+
Instance "duration"
|
17
|
+
</Match>
|
18
|
+
<Match>
|
19
|
+
Regex "view=([\d.]+)"
|
20
|
+
DSType "GaugeAverage"
|
21
|
+
Type "response"
|
22
|
+
Instance "view"
|
23
|
+
</Match>
|
24
|
+
<Match>
|
25
|
+
Regex "db=([\d.]+)"
|
26
|
+
DSType "GaugeAverage"
|
27
|
+
Type "response"
|
28
|
+
Instance "db"
|
29
|
+
</Match>
|
30
|
+
</File>
|
31
|
+
</Plugin>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
tags: puma
|
7
7
|
|
8
8
|
- name: Add puma shared/config
|
9
|
-
template: src=puma.rb dest=/u/apps/{{project_name}}/shared/config/puma/{{rails_env}}.rb force=yes mode=755
|
9
|
+
template: src=puma.rb dest=/u/apps/{{project_name}}/shared/config/puma/{{rails_env}}.rb group=deploy owner=deploy force=yes mode=755
|
10
10
|
tags: puma
|
11
11
|
|
12
12
|
- name: Make shared/tmp/sockets
|
@@ -18,5 +18,5 @@
|
|
18
18
|
src: puma-monit-rc
|
19
19
|
dest: /etc/monit/conf.d/puma_{{project_name}}_{{rails_env}}
|
20
20
|
sudo: true
|
21
|
-
notify:
|
21
|
+
notify: restart_monit
|
22
22
|
|
data/lib/subspace/cli.rb
CHANGED
@@ -54,6 +54,7 @@ class Subspace::Cli
|
|
54
54
|
c.syntax = 'subspace ssh [options]'
|
55
55
|
c.summary = 'ssh to the remote server as the administrative user'
|
56
56
|
c.description = ''
|
57
|
+
c.option '--user USER', "Use a different user (eg deploy). Default is the ansible_ssh_user"
|
57
58
|
c.when_called Subspace::Commands::Ssh
|
58
59
|
end
|
59
60
|
|
@@ -2,12 +2,20 @@ require 'yaml'
|
|
2
2
|
class Subspace::Commands::Ssh < Subspace::Commands::Base
|
3
3
|
def initialize(args, options)
|
4
4
|
@host = args.first
|
5
|
+
@user = options.user
|
5
6
|
run
|
6
7
|
end
|
7
8
|
|
8
9
|
def run
|
10
|
+
if !File.exists? "config/provision/host_vars/#{@host}"
|
11
|
+
say "No host '#{@host}' found. "
|
12
|
+
all_hosts = Dir["config/provision/host_vars/*"].collect {|f| File.basename(f) }
|
13
|
+
say (["Available hosts:"] + all_hosts).join("\n\t")
|
14
|
+
return
|
15
|
+
end
|
9
16
|
host_vars = YAML.load_file("config/provision/host_vars/#{@host}")
|
10
|
-
|
17
|
+
user = @user || host_vars["ansible_ssh_user"]
|
18
|
+
cmd = "ssh #{user}@#{host_vars["ansible_ssh_host"]}"
|
11
19
|
say cmd
|
12
20
|
exec cmd
|
13
21
|
end
|
data/lib/subspace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Samson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|