Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11774)

Unified Diff: client/third_party/infra_libs/ts_mon/common/http_metrics.py

Issue 2991803002: Update infra_libs to 1.1.15 / 0b44aba87c1c6538439df6d24a409870810747ab (Closed)
Patch Set: fix Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: client/third_party/infra_libs/ts_mon/common/http_metrics.py
diff --git a/client/third_party/infra_libs/ts_mon/common/http_metrics.py b/client/third_party/infra_libs/ts_mon/common/http_metrics.py
index 35204682f9a16768063a8334bd81178b5533f82b..9c806f5f67be2998e41e622309520b44d64c02a5 100644
--- a/client/third_party/infra_libs/ts_mon/common/http_metrics.py
+++ b/client/third_party/infra_libs/ts_mon/common/http_metrics.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from infra_libs.ts_mon.common import distribution
from infra_libs.ts_mon.common import metrics
@@ -11,22 +12,35 @@ STATUS_ERROR = 901
STATUS_TIMEOUT = 902
STATUS_EXCEPTION = 909
+
+# 90% of durations are in the range 11-1873ms. Growth factor 10^0.06 puts that
+# range into 37 buckets. Max finite bucket value is 12 minutes.
+_duration_bucketer = distribution.GeometricBucketer(10**0.06)
+
+# 90% of sizes are in the range 0.17-217014 bytes. Growth factor 10^0.1 puts
+# that range into 54 buckets. Max finite bucket value is 6.3GB.
+_size_bucketer = distribution.GeometricBucketer(10**0.1)
+
+
request_bytes = metrics.CumulativeDistributionMetric('http/request_bytes',
'Bytes sent per http request (body only).', [
metrics.StringField('name'),
metrics.StringField('client'),
- ])
+ ],
+ bucketer=_size_bucketer)
response_bytes = metrics.CumulativeDistributionMetric('http/response_bytes',
'Bytes received per http request (content only).', [
metrics.StringField('name'),
metrics.StringField('client'),
- ])
+ ],
+ bucketer=_size_bucketer)
durations = metrics.CumulativeDistributionMetric('http/durations',
'Time elapsed between sending a request and getting a'
' response (including parsing) in milliseconds.', [
metrics.StringField('name'),
metrics.StringField('client'),
- ])
+ ],
+ bucketer=_duration_bucketer)
response_status = metrics.CounterMetric('http/response_status',
'Number of responses received by HTTP status code.', [
metrics.IntegerField('status'),
@@ -41,21 +55,24 @@ server_request_bytes = metrics.CumulativeDistributionMetric(
metrics.IntegerField('status'),
metrics.StringField('name'),
metrics.BooleanField('is_robot'),
- ])
+ ],
+ bucketer=_size_bucketer)
server_response_bytes = metrics.CumulativeDistributionMetric(
'http/server_response_bytes',
'Bytes sent per http request (content only).', [
metrics.IntegerField('status'),
metrics.StringField('name'),
metrics.BooleanField('is_robot'),
- ])
+ ],
+ bucketer=_size_bucketer)
server_durations = metrics.CumulativeDistributionMetric('http/server_durations',
'Time elapsed between receiving a request and sending a'
' response (including parsing) in milliseconds.', [
metrics.IntegerField('status'),
metrics.StringField('name'),
metrics.BooleanField('is_robot'),
- ])
+ ],
+ bucketer=_duration_bucketer)
server_response_status = metrics.CounterMetric('http/server_response_status',
'Number of responses sent by HTTP status code.', [
metrics.IntegerField('status'),
« no previous file with comments | « client/third_party/infra_libs/ts_mon/common/helpers.py ('k') | client/third_party/infra_libs/ts_mon/common/interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698