Commit 6cd912ba authored by Pawel Chojnacki's avatar Pawel Chojnacki

Fix measure codde to work with seconds

parent 40e9fbb2
...@@ -102,8 +102,8 @@ module Gitlab ...@@ -102,8 +102,8 @@ module Gitlab
real_time = (real_stop - real_start) * 1000.0 real_time = (real_stop - real_start) * 1000.0
cpu_time = cpu_stop - cpu_start cpu_time = cpu_stop - cpu_start
Gitlab::Metrics.histogram("gitlab_#{name}_real_duration".to_sym, "Measure #{name}", {}, [1, 2, 5, 10, 20, 50, 100, 1000]).observe({}, real_time) Gitlab::Metrics.histogram("gitlab_#{name}_real_duration_seconds".to_sym, "Measure #{name}", {}, [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2]).observe({}, real_time / 1000.0)
Gitlab::Metrics.histogram("gitlab_#{name}_cpu_duration".to_sym, "Measure #{name}", {}, [1, 2, 5, 10, 20, 50, 100, 1000]).observe({}, cpu_time) Gitlab::Metrics.histogram("gitlab_#{name}_cpu_duration_seconds".to_sym, "Measure #{name}", {}, [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2]).observe({}, cpu_time / 1000.0)
trans.increment("#{name}_real_time", real_time, false) trans.increment("#{name}_real_time", real_time, false)
trans.increment("#{name}_cpu_time", cpu_time, false) trans.increment("#{name}_cpu_time", cpu_time, false)
......
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