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