@mozilla/glean
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -11,3 +11,3 @@ #!/usr/bin/env node | ||
const VIRTUAL_ENVIRONMENT_DIR = process.env.VIRTUAL_ENV || path.join(process.cwd(), ".venv"); | ||
const GLEAN_PARSER_VERSION = "5.1.0"; | ||
const GLEAN_PARSER_VERSION = "6.2.1"; | ||
const PYTHON_SCRIPT = ` | ||
@@ -14,0 +14,0 @@ import importlib |
export const GLEAN_SCHEMA_VERSION = 1; | ||
export const GLEAN_VERSION = "1.2.0"; | ||
export const GLEAN_VERSION = "1.3.0"; | ||
export const PING_INFO_STORAGE = "glean_ping_info"; | ||
@@ -4,0 +4,0 @@ export const CLIENT_INFO_STORAGE = "glean_client_info"; |
@@ -11,2 +11,20 @@ var TimeUnit; | ||
})(TimeUnit || (TimeUnit = {})); | ||
export function convertTimeUnitToNanos(duration, timeUnit) { | ||
switch (timeUnit) { | ||
case TimeUnit.Nanosecond: | ||
return duration; | ||
case TimeUnit.Microsecond: | ||
return duration * 10 ** 3; | ||
case TimeUnit.Millisecond: | ||
return duration * 10 ** 6; | ||
case TimeUnit.Second: | ||
return duration * 10 ** 9; | ||
case TimeUnit.Minute: | ||
return duration * 10 ** 9 * 60; | ||
case TimeUnit.Hour: | ||
return duration * 10 ** 9 * 60 * 60; | ||
case TimeUnit.Day: | ||
return duration * 10 ** 9 * 60 * 60 * 24; | ||
} | ||
} | ||
export default TimeUnit; |
@@ -27,2 +27,5 @@ import { v4 as UUIDv4 } from "uuid"; | ||
} | ||
export function isEmptyObject(v) { | ||
return Object.keys(v || {}).length === 0; | ||
} | ||
export function isUndefined(v) { | ||
@@ -98,1 +101,12 @@ return typeof v === "undefined"; | ||
} | ||
export function getCurrentTimeInNanoSeconds() { | ||
let now; | ||
if (typeof process === "undefined") { | ||
now = getMonotonicNow(); | ||
} | ||
else { | ||
const hrTime = process.hrtime(); | ||
now = hrTime[0] * 1000000000 + hrTime[1]; | ||
} | ||
return now; | ||
} |
export declare const GLEAN_SCHEMA_VERSION = 1; | ||
export declare const GLEAN_VERSION = "1.2.0"; | ||
export declare const GLEAN_VERSION = "1.3.0"; | ||
export declare const PING_INFO_STORAGE = "glean_ping_info"; | ||
@@ -4,0 +4,0 @@ export declare const CLIENT_INFO_STORAGE = "glean_client_info"; |
@@ -14,2 +14,10 @@ /** | ||
} | ||
/** | ||
* Converts a number from any `TimeUnit` to nanoseconds. | ||
* | ||
* @param duration Difference between start and stop time stamps. | ||
* @param timeUnit Time unit for the duration. | ||
* @returns Duration converted to nanoseconds. | ||
*/ | ||
export declare function convertTimeUnitToNanos(duration: number, timeUnit: TimeUnit): number; | ||
export default TimeUnit; |
@@ -25,2 +25,9 @@ import type { MetricType } from "./metrics/index.js"; | ||
/** | ||
* Checks whether or not `v` is an empty object. | ||
* | ||
* @param v The value to verify. | ||
* @returns A boolean value stating whether `v` is an empty object. | ||
*/ | ||
export declare function isEmptyObject(v: unknown): boolean; | ||
/** | ||
* Checks whether or not `v` is undefined. | ||
@@ -70,3 +77,3 @@ * | ||
* @param applicationId The application if to sanitize. | ||
* @returns The sanitized applicaiton id. | ||
* @returns The sanitized application id. | ||
*/ | ||
@@ -137,1 +144,8 @@ export declare function sanitizeApplicationId(applicationId: string): string; | ||
export declare function saturatingAdd(...args: number[]): number; | ||
/** | ||
* Generate timestamp for current time in nanoseconds. If process | ||
* is not defined, we fallback to `getMonotonicNow()`. | ||
* | ||
* @returns Timestamp of current time in nanoseconds. | ||
*/ | ||
export declare function getCurrentTimeInNanoSeconds(): number; |
{ | ||
"name": "@mozilla/glean", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "An implementation of the Glean SDK, a modern cross-platform telemetry client, for JavaScript environments.", | ||
@@ -102,3 +102,3 @@ "type": "module", | ||
"@types/assert": "^1.5.4", | ||
"@types/mocha": "^9.0.0", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^18.7.17", | ||
@@ -120,3 +120,3 @@ "@types/selenium-webdriver": "^4.0.14", | ||
"gh-pages": "^4.0.0", | ||
"jsdom": "20.0.0", | ||
"jsdom": "20.0.1", | ||
"jsdom-global": "3.0.2", | ||
@@ -136,2 +136,3 @@ "jsonschema": "^1.4.0", | ||
"ts-loader": "^9.0.1", | ||
"ts-mocha": "^10.0.0", | ||
"ts-node": "^10.8.0", | ||
@@ -138,0 +139,0 @@ "typedoc": "^0.23.11", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
366242
166
9351
40