mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
e368dc9c85
This patch was generated by a script. Here's the source of the script for future reference: function convert() { echo "Converting $1 to $2..." find . ! -wholename "*nsprpub*" \ ! -wholename "*security/nss*" \ ! -wholename "*/.hg*" \ ! -wholename "obj-ff-dbg*" \ ! -name nsXPCOMCID.h \ ! -name prtypes.h \ -type f \ \( -iname "*.cpp" \ -o -iname "*.h" \ -o -iname "*.c" \ -o -iname "*.cc" \ -o -iname "*.idl" \ -o -iname "*.ipdl" \ -o -iname "*.ipdlh" \ -o -iname "*.mm" \) | \ xargs -n 1 sed -i -e "s/\b$1\b/$2/g" } convert PRInt8 int8_t convert PRUint8 uint8_t convert PRInt16 int16_t convert PRUint16 uint16_t convert PRInt32 int32_t convert PRUint32 uint32_t convert PRInt64 int64_t convert PRUint64 uint64_t convert PRIntn int convert PRUintn unsigned convert PRSize size_t convert PROffset32 int32_t convert PROffset64 int64_t convert PRPtrdiff ptrdiff_t convert PRFloat64 double
183 lines
6.7 KiB
Plaintext
183 lines
6.7 KiB
Plaintext
/* -*- 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, uuid(de54f594-4c20-4968-a27a-83b38ff952b9)]
|
|
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;
|
|
|
|
/*
|
|
* An object containing information about slow SQL statements.
|
|
*
|
|
* {
|
|
* mainThread: { "sqlString1": [<hit count>, <total time>], "sqlString2": [...], ... },
|
|
* otherThreads: { "sqlString3": [<hit count>, <total time>], "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;
|
|
|
|
/*
|
|
* 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 object whose properties are the names of histograms defined in
|
|
* TelemetryHistograms.h and whose corresponding values are the textual
|
|
* comments associated with said histograms.
|
|
*/
|
|
[implicit_jscontext]
|
|
readonly attribute jsval registeredHistograms;
|
|
|
|
/**
|
|
* Create and return a histogram. Parameters:
|
|
*
|
|
* @param name Unique histogram name
|
|
* @param min - Minimal bucket size
|
|
* @param max - Maximum bucket size
|
|
* @param bucket_count - number of buckets in the histogram.
|
|
* @param type - HISTOGRAM_EXPONENTIAL, HISTOGRAM_LINEAR or HISTOGRAM_BOOLEAN
|
|
* The returned object has the following functions:
|
|
* add(int) - Adds an int value to the appropriate bucket
|
|
* snapshot() - Returns a snapshot of the histogram with the same data fields as in histogramSnapshots()
|
|
* clear() - Zeros out the histogram's buckets and sum
|
|
*/
|
|
[implicit_jscontext]
|
|
jsval newHistogram(in ACString name, in uint32_t min, in uint32_t max, in uint32_t bucket_count, in unsigned long histogram_type);
|
|
|
|
/**
|
|
* Create a histogram using the current state of an existing histogram. The
|
|
* existing histogram must be registered in TelemetryHistograms.h.
|
|
*
|
|
* @param name Unique histogram name
|
|
* @param existing_name Existing histogram name
|
|
* The returned object has the same functions as a histogram returned from newHistogram.
|
|
*/
|
|
[implicit_jscontext]
|
|
jsval histogramFrom(in ACString name, in ACString existing_name);
|
|
|
|
/**
|
|
* Same as newHistogram above, but for histograms registered in TelemetryHistograms.h.
|
|
*
|
|
* @param id - unique identifier from TelemetryHistograms.h
|
|
*/
|
|
[implicit_jscontext]
|
|
jsval getHistogramById(in ACString id);
|
|
|
|
/**
|
|
* Set this to false to disable gathering of telemetry statistics.
|
|
*/
|
|
attribute boolean canRecord;
|
|
|
|
/**
|
|
* A flag indicating whether Telemetry can submit official results.
|
|
*/
|
|
readonly attribute boolean canSend;
|
|
|
|
/** Addon telemetry hooks */
|
|
|
|
/**
|
|
* Register a histogram for an addon. Throws an error if the
|
|
* histogram name has been registered previously.
|
|
*
|
|
* @param addon_id - Unique ID of the addon
|
|
* @param name - Unique histogram name
|
|
* @param min - Minimal bucket size
|
|
* @param max - Maximum bucket size
|
|
* @param bucket_count - number of buckets in the histogram
|
|
* @param histogram_type - HISTOGRAM_EXPONENTIAL, HISTOGRAM_LINEAR, or
|
|
* HISTOGRAM_BOOLEAN
|
|
*/
|
|
void registerAddonHistogram(in ACString addon_id, in ACString name,
|
|
in uint32_t min, in uint32_t max,
|
|
in uint32_t bucket_count,
|
|
in unsigned long histogram_type);
|
|
|
|
/**
|
|
* Return a histogram previously registered via
|
|
* registerAddonHistogram. Throws an error if the id/name combo has
|
|
* not been registered via registerAddonHistogram.
|
|
*
|
|
* @param addon_id - Unique ID of the addon
|
|
* @param name - Registered histogram name
|
|
*
|
|
* The returned object has the same functions as a histogram returned
|
|
* from newHistogram.
|
|
*/
|
|
[implicit_jscontext]
|
|
jsval getAddonHistogram(in ACString addon_id, in ACString name);
|
|
|
|
/**
|
|
* Delete all histograms associated with the given addon id.
|
|
*
|
|
* @param addon_id - Unique ID of the addon
|
|
*/
|
|
void unregisterAddonHistograms(in ACString addon_id);
|
|
|
|
/**
|
|
* An object containing a snapshot from all of the currently
|
|
* registered addon histograms.
|
|
* { addon-id1 : data1, ... }
|
|
*
|
|
* where data is an object whose properties are the names of the
|
|
* addon's histograms and whose corresponding values are as in
|
|
* histogramSnapshots.
|
|
*/
|
|
[implicit_jscontext]
|
|
readonly attribute jsval addonHistogramSnapshots;
|
|
};
|