Commit 4444fb49 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents f4b0df8d 142a8678
...@@ -8,13 +8,13 @@ comments: false ...@@ -8,13 +8,13 @@ comments: false
## Unstage ## Unstage
- To remove files from stage use reset HEAD. Where HEAD is the last commit of the current branch. - To remove files from stage use reset HEAD where HEAD is the last commit of the current branch. This will unstage the file but maintain the modifications.
```bash ```bash
git reset HEAD <file> git reset HEAD <file>
``` ```
- This will unstage the file but maintain the modifications. To revert the file back to the state it was in before the changes we can use: - To revert the file back to the state it was in before the changes we can use:
```bash ```bash
git checkout -- <file> git checkout -- <file>
......
...@@ -15,18 +15,15 @@ Currently, only the following basic fields are imported: ...@@ -15,18 +15,15 @@ Currently, only the following basic fields are imported:
- Created at - Created at
- Closed at - Closed at
## Enabling this feature ## Enabling this feature
While this feature is incomplete, a feature flag is required to enable it so that While this feature is incomplete, a feature flag is required to enable it so that
we can gain early feedback before releasing it for everyone. To enable it: we can gain early feedback before releasing it for everyone. To enable it:
1. Enable Phabricator as an [import source](../../admin_area/settings/visibility_and_access_controls.md#import-sources) in the Admin area. 1. Run the following command in a Rails console:
``` {.ruby} ```ruby
Feature.enable(:phabricator_import) Feature.enable(:phabricator_import)
``` ```
The [import 1. Enable Phabricator as an [import source](../../admin_area/settings/visibility_and_access_controls.md#import-sources) in the Admin area.
source](../../admin_area/settings/visibility_and_access_controls.md#import-sources)
also needs to be activated by an admin in the admin interface.
...@@ -51,10 +51,11 @@ module Gitlab ...@@ -51,10 +51,11 @@ module Gitlab
set_master_metrics(stats) set_master_metrics(stats)
stats['worker_status'].each do |worker| stats['worker_status'].each do |worker|
last_status = worker['last_status']
labels = { worker: "worker_#{worker['index']}" } labels = { worker: "worker_#{worker['index']}" }
metrics[:puma_phase].set(labels, worker['phase']) metrics[:puma_phase].set(labels, worker['phase'])
set_worker_metrics(worker['last_status'], labels) set_worker_metrics(last_status, labels) if last_status.present?
end end
end end
......
...@@ -61,6 +61,33 @@ describe Gitlab::Metrics::Samplers::PumaSampler do ...@@ -61,6 +61,33 @@ describe Gitlab::Metrics::Samplers::PumaSampler do
end end
end end
context 'with empty worker stats' do
let(:puma_stats) do
<<~EOS
{
"workers": 2,
"phase": 2,
"booted_workers": 2,
"old_workers": 0,
"worker_status": [{
"pid": 32534,
"index": 0,
"phase": 1,
"booted": true,
"last_checkin": "2019-05-15T07:57:55Z",
"last_status": {}
}]
}
EOS
end
it 'does not log worker stats' do
expect(subject).not_to receive(:set_worker_metrics)
subject.sample
end
end
context 'in single mode' do context 'in single mode' do
let(:puma_stats) do let(:puma_stats) do
<<~EOS <<~EOS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment