diff -r 000000000000 -r 6474c204b198 toolkit/components/telemetry/nsITelemetry.idl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolkit/components/telemetry/nsITelemetry.idl Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,261 @@ +/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIFile.idl" + +[scriptable,function, uuid(3d3b9075-5549-4244-9c08-b64fefa1dd60)] +interface nsIFetchTelemetryDataCallback : nsISupports +{ + void complete(); +}; + +[scriptable, uuid(4e4bfc35-dac6-4b28-ade4-7e45760051d5)] +interface nsITelemetry : nsISupports +{ + /** + * Histogram types: + * HISTOGRAM_EXPONENTIAL - buckets increase exponentially + * HISTOGRAM_LINEAR - buckets increase linearly + * HISTOGRAM_BOOLEAN - For storing 0/1 values + * HISTOGRAM_FLAG - For storing a single value; its count is always == 1. + */ + const unsigned long HISTOGRAM_EXPONENTIAL = 0; + const unsigned long HISTOGRAM_LINEAR = 1; + const unsigned long HISTOGRAM_BOOLEAN = 2; + const unsigned long HISTOGRAM_FLAG = 3; + + /* + * An object containing a snapshot from all of the currently registered histograms. + * { name1: {data1}, name2:{data2}...} + * where data is consists of the following properties: + * min - Minimal bucket size + * max - Maximum bucket size + * histogram_type - HISTOGRAM_EXPONENTIAL, HISTOGRAM_LINEAR, or HISTOGRAM_BOOLEAN + * counts - array representing contents of the buckets in the histogram + * ranges - an array with calculated bucket sizes + * sum - sum of the bucket contents + * static - true for histograms defined in TelemetryHistograms.h, false for ones defined with newHistogram + */ + [implicit_jscontext] + readonly attribute jsval histogramSnapshots; + + /** + * The amount of time, in milliseconds, that the last session took + * to shutdown. Reads as 0 to indicate failure. + */ + readonly attribute uint32_t lastShutdownDuration; + + /** + * The number of failed profile lock attempts that have occurred prior to + * successfully locking the profile + */ + readonly attribute uint32_t failedProfileLockCount; + + /* + * An object containing information about slow SQL statements. + * + * { + * mainThread: { "sqlString1": [, ], "sqlString2": [...], ... }, + * otherThreads: { "sqlString3": [, ], "sqlString4": [...], ... } + * } + * + * where: + * mainThread: Slow statements that executed on the main thread + * otherThreads: Slow statements that executed on a non-main thread + * sqlString - String of the offending statement (see note) + * hit count - The number of times this statement required longer than the threshold time to execute + * total time - The sum of all execution times above the threshold time for this statement + * + * Note that dynamic SQL strings and SQL strings executed against addon DBs could contain private information. + * This property represents such SQL as aggregate database-level stats and the sqlString contains the database + * filename instead. + */ + [implicit_jscontext] + readonly attribute jsval slowSQL; + + /* + * See slowSQL above. + * + * An object containing full strings of every slow SQL statement if toolkit.telemetry.debugSlowSql = true + * The returned SQL strings may contain private information and should not be reported to Telemetry. + */ + [implicit_jscontext] + readonly attribute jsval debugSlowSQL; + + /** + * A number representing the highest number of concurrent threads + * reached during this session. + */ + readonly attribute uint32_t maximalNumberOfConcurrentThreads; + + /* + * An array of chrome hang reports. Each element is a hang report represented + * as an object containing the hang duration, call stack PCs and information + * about modules in memory. + */ + [implicit_jscontext] + readonly attribute jsval chromeHangs; + + /* + * An array of thread hang stats, + * [, , ...] + * represents a single thread, + * {"name": "", + * "activity":