mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Move packages from root to types (#15953)
* Move files * Fix lint and remove node-jose
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import metrics = require('datadog-metrics');
|
||||
metrics.init({ host: 'myhost', prefix: 'myapp.' });
|
||||
metrics.gauge('mygauge', 42);
|
||||
metrics.increment('test.requests_served');
|
||||
metrics.increment('test.awesomeness_factor', 10);
|
||||
metrics.histogram('test.service_time', 0.248);
|
||||
metrics.flush();
|
||||
metrics.flush(() => {});
|
||||
metrics.flush(() => {}, err => {});
|
||||
|
||||
const metricsLogger = new metrics.BufferedMetricsLogger({
|
||||
apiKey: 'TESTKEY',
|
||||
host: 'myhost',
|
||||
prefix: 'myapp.',
|
||||
flushIntervalSeconds: 15,
|
||||
defaultTags: ['env:staging', 'region:us-east-1']
|
||||
});
|
||||
metricsLogger.gauge('mygauge', 42);
|
||||
metricsLogger.increment('test.requests_served');
|
||||
metricsLogger.increment('test.awesomeness_factor', 10);
|
||||
metricsLogger.histogram('test.service_time', 0.248);
|
||||
metricsLogger.flush();
|
||||
metricsLogger.flush(() => {});
|
||||
metricsLogger.flush(() => {}, err => {});
|
||||
Vendored
+102
@@ -0,0 +1,102 @@
|
||||
// Type definitions for datadog-metrics 0.4
|
||||
// Project: https://github.com/dbader/node-datadog-metrics
|
||||
// Definitions by: Jeffery Grajkowski <https://github.com/pushplay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface BufferedMetricsLoggerOptions {
|
||||
/**
|
||||
* Sets the DataDog API key.
|
||||
*/
|
||||
apiKey?: string;
|
||||
|
||||
/**
|
||||
* Sets the DataDog APP key.
|
||||
*/
|
||||
appKey?: string;
|
||||
|
||||
/**
|
||||
* Default tags used for all metric reporting.
|
||||
*/
|
||||
defaultTags?: string[];
|
||||
|
||||
/**
|
||||
* How often to send metrics to DataDog.
|
||||
*/
|
||||
flushIntervalSeconds?: number;
|
||||
|
||||
/**
|
||||
* Sets the hostname reported with each metric.
|
||||
*/
|
||||
host?: string;
|
||||
|
||||
/**
|
||||
* Sets a default prefix for all metrics.
|
||||
*/
|
||||
prefix?: string;
|
||||
}
|
||||
|
||||
export class BufferedMetricsLogger {
|
||||
constructor(options: BufferedMetricsLoggerOptions);
|
||||
|
||||
/**
|
||||
* Record the current value of a metric. They most recent value in a given flush
|
||||
* interval will be recorded. Optionally, specify a set of tags to associate with
|
||||
* the metric. This should be used for sum values such as total hard disk space,
|
||||
* process uptime, total number of active users, or number of rows in a database table.
|
||||
*/
|
||||
gauge(key: string, value: number, ...tags: string[]): void;
|
||||
|
||||
/**
|
||||
* Increment the counter by the given value (or 1 by default). Optionally, specify a
|
||||
* list of tags to associate with the metric. This is useful for counting things such
|
||||
* as incrementing a counter each time a page is requested.
|
||||
*/
|
||||
increment(key: string, value?: number, ...tags: string[]): void;
|
||||
|
||||
/**
|
||||
* Sample a histogram value. Histograms will produce metrics that describe the distribution
|
||||
* of the recorded values, namely the minimum, maximum, average, count and the 75th, 85th,
|
||||
* 95th and 99th percentiles. Optionally, specify a list of tags to associate with the metric.
|
||||
*/
|
||||
histogram(key: string, value: number, ...tags: string[]): void;
|
||||
|
||||
/**
|
||||
* Calling flush sends any buffered metrics to DataDog. Unless you set flushIntervalSeconds
|
||||
* to 0 it won't be necessary to call this function.
|
||||
* It can be useful to trigger a manual flush by calling if you want to make sure pending
|
||||
* metrics have been sent before you quit the application process, for example.
|
||||
*/
|
||||
flush(onSuccess?: () => void, onError?: (err: Error) => void): void;
|
||||
}
|
||||
|
||||
export function init(options: BufferedMetricsLoggerOptions): void;
|
||||
|
||||
/**
|
||||
* Record the current value of a metric. They most recent value in a given flush
|
||||
* interval will be recorded. Optionally, specify a set of tags to associate with
|
||||
* the metric. This should be used for sum values such as total hard disk space,
|
||||
* process uptime, total number of active users, or number of rows in a database table.
|
||||
*/
|
||||
export function gauge(key: string, value: number, ...tags: string[]): void;
|
||||
|
||||
/**
|
||||
* Increment the counter by the given value (or 1 by default). Optionally, specify a
|
||||
* list of tags to associate with the metric. This is useful for counting things such
|
||||
* as incrementing a counter each time a page is requested.
|
||||
*/
|
||||
export function increment(key: string, value?: number, ...tags: string[]): void;
|
||||
|
||||
/**
|
||||
* Sample a histogram value. Histograms will produce metrics that describe the distribution
|
||||
* of the recorded values, namely the minimum, maximum, average, count and the 75th, 85th,
|
||||
* 95th and 99th percentiles. Optionally, specify a list of tags to associate with the metric.
|
||||
*/
|
||||
export function histogram(key: string, value: number, ...tags: string[]): void;
|
||||
|
||||
/**
|
||||
* Calling flush sends any buffered metrics to DataDog. Unless you set flushIntervalSeconds
|
||||
* to 0 it won't be necessary to call this function.
|
||||
* It can be useful to trigger a manual flush by calling if you want to make sure pending
|
||||
* metrics have been sent before you quit the application process, for example.
|
||||
*/
|
||||
export function flush(onSuccess?: () => void, onError?: (err: Error) => void): void;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"datadog-metrics-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as globBase from "glob-base";
|
||||
|
||||
const result = globBase("**/*.ts");
|
||||
|
||||
const isGlob = result.isGlob;
|
||||
const glob = result.glob;
|
||||
const base = result.base;
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for glob-base 0.3
|
||||
// Project: https://github.com/jonschlinkert/glob-base
|
||||
// Definitions by: Alan Agius <https://github.com/alan-agius4>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function globbase(basePath?: string): globbase.GlobBaseResult;
|
||||
|
||||
declare namespace globbase {
|
||||
interface GlobBaseResult {
|
||||
base: string;
|
||||
isGlob: boolean;
|
||||
glob: string;
|
||||
}
|
||||
}
|
||||
|
||||
export = globbase;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"glob-base-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user