UNPKG

@khulnasoft/cdk

Version:

Define your observability as code using the AWS CDK

193 lines 8.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.variance = exports.stdDev = exports.p999 = exports.p99 = exports.p95 = exports.p90 = exports.p75 = exports.p25 = exports.p10 = exports.p05 = exports.p01 = exports.p001 = exports.median = exports.avg = exports.sum = exports.min = exports.max = exports.countDistinct = exports.count = void 0; /** * Creates a calculation object that computes the count of all events * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function count(alias) { return { operation: "COUNT", alias }; } exports.count = count; /** * Creates a calculation object that computes the count of distinct events * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function countDistinct(key, alias) { return { operation: "COUNT_DISTINCT", key, alias }; } exports.countDistinct = countDistinct; /** * Creates a calculation object that computes the maximum value of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function max(key, alias) { return { operation: "MAX", key, alias }; } exports.max = max; /** * Creates a calculation object that computes the minimum value of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function min(key, alias) { return { operation: "MIN", key, alias }; } exports.min = min; /** * Creates a calculation object that computes the sum of all values of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function sum(key, alias) { return { operation: "SUM", key, alias }; } exports.sum = sum; /** * Creates a calculation object that computes the average value of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function avg(key, alias) { return { operation: "AVG", key, alias }; } exports.avg = avg; /** * Creates a calculation object that computes the median value of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function median(key, alias) { return { operation: "MEDIAN", key, alias }; } exports.median = median; /** * Creates a calculation object that computes the 0.1-th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p001(key, alias) { return { operation: "P001", key, alias }; } exports.p001 = p001; /** * Creates a calculation object that computes the 1st percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p01(key, alias) { return { operation: "P01", key, alias }; } exports.p01 = p01; /** * Creates a calculation object that computes the 5th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p05(key, alias) { return { operation: "P05", key, alias }; } exports.p05 = p05; /** * Creates a calculation object that computes the 10th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p10(key, alias) { return { operation: "P10", key, alias }; } exports.p10 = p10; /** * Creates a calculation object that computes the 25th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p25(key, alias) { return { operation: "P25", key, alias }; } exports.p25 = p25; /** * Creates a calculation object that computes the 75th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p75(key, alias) { return { operation: "P75", key, alias }; } exports.p75 = p75; /** * Creates a calculation object that computes the 90th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p90(key, alias) { return { operation: "P90", key, alias }; } exports.p90 = p90; /** * Creates a calculation object that computes the 95th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p95(key, alias) { return { operation: "P95", key, alias }; } exports.p95 = p95; /** * Creates a calculation object that computes the 99th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p99(key, alias) { return { operation: "P99", key, alias }; } exports.p99 = p99; /** * Creates a calculation object that computes the 99.9th percentile of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function p999(key, alias) { return { operation: "P999", key, alias }; } exports.p999 = p999; /** * Creates a calculation object that computes the standard deviation of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function stdDev(key, alias) { return { operation: "STDDEV", key, alias }; } exports.stdDev = stdDev; /** * Creates a calculation object that computes the variance of the provided key * @param {string} key The key to perform the calculation on * @param {string} [alias] The temporary name to give to the results of the calculation * @returns {Object} A calculation object with the operation, key, and alias properties. */ function variance(key, alias) { return { operation: "VARIANCE", key, alias }; } exports.variance = variance; //# sourceMappingURL=calc.js.map