Skip to content

Commit

Permalink
DEV: regen
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Sep 2, 2023
1 parent 3564e4c commit 2aada37
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dist/cjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export type MetricOptions = {
spans?: SpanDef[];
table?: string;
ttl?: number;
type?: {
[key: string]: string;
};
tableName?: string;
};
export type MetricBufferOptions = {
Expand Down Expand Up @@ -120,6 +123,7 @@ export declare class CustomMetrics {
private spans;
private table;
private timestamp;
private type;
private ttl;
constructor(options?: MetricOptions);
emit(namespace: string, metricName: string, value: number, dimensionsList?: MetricDimensionsList, options?: MetricEmitOptions): Promise<Metric>;
Expand Down
6 changes: 5 additions & 1 deletion dist/cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class CustomMetrics {
}
this.primaryKey = options.primaryKey || 'pk';
this.sortKey = options.sortKey || 'sk';
this.type = options.type || { _type: 'Metric' };
if (options.client) {
this.client = options.client;
}
Expand All @@ -67,7 +68,6 @@ class CustomMetrics {
credentials,
region: credentials.region || options.region,
};
this.log.info(`@@ METRICS Constructor params`, { params });
this.client = new client_dynamodb_1.DynamoDBClient(params);
}
if (!options.table && !options.tableName) {
Expand Down Expand Up @@ -718,6 +718,10 @@ class CustomMetrics {
seq: item.seq,
_source: item._source,
};
if (this.type) {
let [key, model] = Object.entries(this.type)[0];
result[key] = model;
}
for (let span of result.spans) {
for (let p of span.pt) {
this.assert(p.s != null && !isNaN(p.s));
Expand Down
4 changes: 4 additions & 0 deletions dist/mjs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export type MetricOptions = {
spans?: SpanDef[];
table?: string;
ttl?: number;
type?: {
[key: string]: string;
};
tableName?: string;
};
export type MetricBufferOptions = {
Expand Down Expand Up @@ -120,6 +123,7 @@ export declare class CustomMetrics {
private spans;
private table;
private timestamp;
private type;
private ttl;
constructor(options?: MetricOptions);
emit(namespace: string, metricName: string, value: number, dimensionsList?: MetricDimensionsList, options?: MetricEmitOptions): Promise<Metric>;
Expand Down
7 changes: 6 additions & 1 deletion dist/mjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CustomMetrics {
spans;
table;
timestamp;
type;
ttl;
constructor(options = {}) {
this.log = new Log(options.log);
Expand Down Expand Up @@ -71,6 +72,7 @@ class CustomMetrics {
}
this.primaryKey = options.primaryKey || 'pk';
this.sortKey = options.sortKey || 'sk';
this.type = options.type || { _type: 'Metric' };
if (options.client) {
this.client = options.client;
}
Expand All @@ -80,7 +82,6 @@ class CustomMetrics {
credentials,
region: credentials.region || options.region,
};
this.log.info(`@@ METRICS Constructor params`, { params });
this.client = new client_dynamodb_1.DynamoDBClient(params);
}
if (!options.table && !options.tableName) {
Expand Down Expand Up @@ -731,6 +732,10 @@ class CustomMetrics {
seq: item.seq,
_source: item._source,
};
if (this.type) {
let [key, model] = Object.entries(this.type)[0];
result[key] = model;
}
for (let span of result.spans) {
for (let p of span.pt) {
this.assert(p.s != null && !isNaN(p.s));
Expand Down

0 comments on commit 2aada37

Please sign in to comment.