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",
13 "description": "Describes the type of metric that is to be collected.",
15 "metricName": {"type": "string", "description": "A unique name within the extension for the metric."},
18 "enum": ["histogram-log", "histogram-linear"],
19 "description": "The type of metric, such as 'histogram-log' or 'histogram-linear'."
21 "min": {"type": "integer", "description": "The minimum sample value to be recoded. Must be greater than zero."},
22 "max": {"type": "integer", "description": "The maximum sample value to be recoded."},
23 "buckets": {"type": "integer", "description": "The number of buckets to use when separating the recorded values."}
29 "name": "getIsCrashReportingEnabled",
30 "description": "Returns true if the user opted in to sending crash reports.",
38 { "name": "is_enabled", "type": "boolean" }
44 "name": "getFieldTrial",
45 "description": "Returns the group name chosen for the named trial, or the empty string if the trial does not exist or is not enabled.",
48 {"name": "name", "type": "string"},
54 { "name": "group", "type": "string" }
60 "name": "getVariationParams",
61 "description": "Returns variation parameters for the named trial if available, or undefined otherwise.",
64 {"name": "name", "type": "string"},
73 "additionalProperties": { "type": "string" }
80 "name": "recordUserAction",
82 "description": "Records an action performed by the user.",
84 {"name": "name", "type": "string"}
88 "name": "recordPercentage",
90 "description": "Records a percentage value from 1 to 100.",
92 {"name": "metricName", "type": "string"},
93 {"name": "value", "type": "integer"}
97 "name": "recordCount",
99 "description": "Records a value than can range from 1 to 1,000,000.",
101 {"name": "metricName", "type": "string"},
102 {"name": "value", "type": "integer"}
106 "name": "recordSmallCount",
108 "description": "Records a value than can range from 1 to 100.",
110 {"name": "metricName", "type": "string"},
111 {"name": "value", "type": "integer"}
115 "name": "recordMediumCount",
117 "description": "Records a value than can range from 1 to 10,000.",
119 {"name": "metricName", "type": "string"},
120 {"name": "value", "type": "integer"}
124 "name": "recordTime",
126 "description": "Records an elapsed time of no more than 10 seconds. The sample value is specified in milliseconds.",
128 {"name": "metricName", "type": "string"},
129 {"name": "value", "type": "integer"}
133 "name": "recordMediumTime",
135 "description": "Records an elapsed time of no more than 3 minutes. The sample value is specified in milliseconds.",
137 {"name": "metricName", "type": "string"},
138 {"name": "value", "type": "integer"}
142 "name": "recordLongTime",
144 "description": "Records an elapsed time of no more than 1 hour. The sample value is specified in milliseconds.",
146 {"name": "metricName", "type": "string"},
147 {"name": "value", "type": "integer"}
151 "name": "recordSparseValue",
153 "description": "Increments the count associated with |value| in the sparse histogram defined by the |metricName|.",
155 {"name": "metricName", "type": "string"},
156 {"name": "value", "type": "integer"}
160 "name": "recordValue",
162 "description": "Adds a value to the given metric.",
164 {"name": "metric", "$ref": "MetricType"},
165 {"name": "value", "type": "integer"}