Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Cobb <rcobb@gitlab.com>2019-04-25 02:05:09 +0300
committerRyan Cobb <rcobb@gitlab.com>2019-04-25 02:05:09 +0300
commitbb27bf4a1c7153f2f5074eb058d8659dd9f198ad (patch)
treea97200488452580d04f50ad16d5ab0d7a26fb95f /lib/gitlab/metrics/system.rb
parent174a03dfc284781d811df1874ce3cf11d451a8f5 (diff)
Update docs and calculate process start time via proc table
This updates monitor docs to reflect the new ruby and unicorn metrics as well as making it so we fetch process start time via the proc table instead of via CLOCK_BOOTTIME
Diffstat (limited to 'lib/gitlab/metrics/system.rb')
-rw-r--r--lib/gitlab/metrics/system.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb
index a269a8688e9..ecd558d7ec7 100644
--- a/lib/gitlab/metrics/system.rb
+++ b/lib/gitlab/metrics/system.rb
@@ -33,6 +33,13 @@ module Gitlab
max_fds
end
+
+ def self.process_start_time
+ start_time_in_jiffies = Sys::ProcTable.ps(pid: Process.pid).starttime
+ return 0 unless start_time_in_jiffies
+
+ start_time_in_jiffies / 100
+ end
else
def self.memory_usage
0.0
@@ -45,6 +52,10 @@ module Gitlab
def self.max_open_file_descriptors
0
end
+
+ def self.process_start_time
+ 0
+ end
end
# THREAD_CPUTIME is not supported on OS X
@@ -60,17 +71,6 @@ module Gitlab
end
end
- # CLOCK_BOOTTIME is not supported on OS X
- if Process.const_defined?(:CLOCK_BOOTTIME)
- def self.process_start_time
- Process
- .clock_gettime(Process::CLOCK_BOOTTIME, :float_second)
- end
- else
- def self.process_start_time
- 0.0
- end
- end
# Returns the current real time in a given precision.
#
# Returns the time as a Float for precision = :float_second.