-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
60 lines (59 loc) · 2.16 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
declare class SDC {
constructor({
host,
port,
protocol,
protocol_version,
MTU,
timeout,
tags,
scheme,
prefix,
sanitise,
errorHandler,
enforceRate
}: {
// StatsD host [127.0.0.1]
host?: string,
// StatsD port [8125]
port?: string|number,
// Internet Protocol (UDP/TCP) [UDP]
protocol?: string,
// Internet Protocol version (ipv4/ipv6) [ipv4]
protocol_version?: string
// Maximum Transmission Unit [576]
MTU?: number,
// Maximum cutoff time (ms) until flush current metric bulk [1000]
timeout?: number,
// Default tags to be sent with every metric []
tags?,
// Format stats metric as: `'datadog'`, `'graphite'`, custom format function [datadog]
scheme?: string|(
({
type, key, value, rate, tags
}: {
type: string,
key: string,
value: number,
rate: number,
tags: string[]
}) => string),
// Prefix all stats with this value []
prefix?: string,
// Sanitise stat keys [Default sanitisation: Allow characters, numbers, underscores and dots. Replace everything else with underscore. Lowercase everything]
sanitise?: (string: string) => string,
// Handle message sending errors (see section 'Throwing errors') []
errorHandler?: Function,
// Should I enforce rate (mark as false is rate was already enforced) [true]
enforceRate?: boolean,
});
count(key: string, value: number, rate?: number, tags?: string[]): void;
time(key: string, value: number, rate?: number, tags?: string[]): void;
gauge(key: string, value: number, rate?: number, tags?: string[]): void;
set(key: string, value: number, rate?: number, tags?: string[]): void;
generic(type: string, key: string, value: number, rate?: number, tags?: string[]): void;
histogram(key: string, value: number, rate?: number, tags?: string[]): void;
get size(): number;
destroy(): void;
}
export default SDC;