1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 "namespace": "metricsPrivate",
11 "id": "MetricTypeType",
13 "enum": ["histogram-log", "histogram-linear"],
14 "description": "The type of metric, such as 'histogram-log' or 'histogram-linear'."
19 "description": "Describes the type of metric that is to be collected.",
21 "metricName": {"type": "string", "description": "A unique name within the extension for the metric."},
23 "$ref": "MetricTypeType"
25 "min": {"type": "integer", "description": "The minimum sample value to be recoded. Must be greater than zero."},
26 "max": {"type": "integer", "description": "The maximum sample value to be recoded."},
27 "buckets": {"type": "integer", "description": "The number of buckets to use when separating the recorded values."}
33 "name": "getIsCrashReportingEnabled",
34 "description": "Returns true if the user opted in to sending crash reports.",
42 { "name": "is_enabled", "type": "boolean" }
48 "name": "getFieldTrial",
49 "description": "Returns the group name chosen for the named trial, or the empty string if the trial does not exist or is not enabled.",
52 {"name": "name", "type": "string"},
58 { "name": "group", "type": "string" }
64 "name": "getVariationParams",
65 "description": "Returns variation parameters for the named trial if available, or undefined otherwise.",
68 {"name": "name", "type": "string"},
78 "additionalProperties": { "type": "string" }
85 "name": "recordUserAction",
87 "description": "Records an action performed by the user.",
89 {"name": "name", "type": "string"}
93 "name": "recordPercentage",
95 "description": "Records a percentage value from 1 to 100.",
97 {"name": "metricName", "type": "string"},
98 {"name": "value", "type": "integer"}
102 "name": "recordCount",
104 "description": "Records a value than can range from 1 to 1,000,000.",
106 {"name": "metricName", "type": "string"},
107 {"name": "value", "type": "integer"}
111 "name": "recordSmallCount",
113 "description": "Records a value than can range from 1 to 100.",
115 {"name": "metricName", "type": "string"},
116 {"name": "value", "type": "integer"}
120 "name": "recordMediumCount",
122 "description": "Records a value than can range from 1 to 10,000.",
124 {"name": "metricName", "type": "string"},
125 {"name": "value", "type": "integer"}
129 "name": "recordTime",
131 "description": "Records an elapsed time of no more than 10 seconds. The sample value is specified in milliseconds.",
133 {"name": "metricName", "type": "string"},
134 {"name": "value", "type": "integer"}
138 "name": "recordMediumTime",
140 "description": "Records an elapsed time of no more than 3 minutes. The sample value is specified in milliseconds.",
142 {"name": "metricName", "type": "string"},
143 {"name": "value", "type": "integer"}
147 "name": "recordLongTime",
149 "description": "Records an elapsed time of no more than 1 hour. The sample value is specified in milliseconds.",
151 {"name": "metricName", "type": "string"},
152 {"name": "value", "type": "integer"}
156 "name": "recordSparseValue",
158 "description": "Increments the count associated with |value| in the sparse histogram defined by the |metricName|.",
160 {"name": "metricName", "type": "string"},
161 {"name": "value", "type": "integer"}
165 "name": "recordValue",
167 "description": "Adds a value to the given metric.",
169 {"name": "metric", "$ref": "MetricType"},
170 {"name": "value", "type": "integer"}