Skip to content

Commit c24d435

Browse files
authored
Merge pull request #58 from exceptionless/feature/deduplication
Feature/deduplication
2 parents 0813e47 + ef5f477 commit c24d435

20 files changed

+784
-115
lines changed

dist/exceptionless.d.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface IEvent {
88
value?: number;
99
data?: any;
1010
reference_id?: string;
11+
count?: number;
1112
}
1213
export declare class SubmissionResponse {
1314
success: boolean;
@@ -27,6 +28,7 @@ export interface ILastReferenceIdManager {
2728
setLast(eventId: string): void;
2829
}
2930
export interface ILog {
31+
trace(message: string): void;
3032
info(message: string): void;
3133
warn(message: string): void;
3234
error(message: string): void;
@@ -96,12 +98,14 @@ export declare class DefaultLastReferenceIdManager implements ILastReferenceIdMa
9698
setLast(eventId: string): void;
9799
}
98100
export declare class ConsoleLog implements ILog {
101+
trace(message: string): void;
99102
info(message: string): void;
100103
warn(message: string): void;
101104
error(message: string): void;
102105
private log(level, message);
103106
}
104107
export declare class NullLog implements ILog {
108+
trace(message: string): void;
105109
info(message: string): void;
106110
warn(message: string): void;
107111
error(message: string): void;
@@ -426,9 +430,11 @@ export declare class SubmissionMethodPlugin implements IEventPlugin {
426430
export declare class DuplicateCheckerPlugin implements IEventPlugin {
427431
priority: number;
428432
name: string;
433+
private _mergedEvents;
429434
private _processedHashcodes;
430435
private _getCurrentTime;
431-
constructor(getCurrentTime?: () => number);
436+
private _interval;
437+
constructor(getCurrentTime?: () => number, interval?: number);
432438
run(context: EventPluginContext, next?: () => void): void;
433439
}
434440
export declare class EventExclusionPlugin implements IEventPlugin {

dist/exceptionless.js

+77-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js

+77-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ gulp.task('exceptionless.test.umd', ['typescript.test'], function () {
119119
gulp.task('test-node', ['exceptionless.test.umd'], function(done) {
120120
return gulp.src('dist/temp/exceptionless-nodespec.js', { read: false })
121121
.pipe($.mocha({
122-
require: ['source-map-support/register']
122+
require: ['source-map-support/register'],
123+
timeout: 5000
123124
}))
124125
.once('end', function () {
125126
process.exit();

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"rewire": "^2.5.2",
5050
"rimraf": "2.5.3",
5151
"run-sequence": "^1.2.2",
52+
"sinon": "^1.17.6",
5253
"source-map-support": "0.4.2",
5354
"systemjs": "^0.19.39",
5455
"tracekit": "0.4.3",

src/ExceptionlessClient-spec.ts

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import { ExceptionlessClient } from './ExceptionlessClient';
22
import { EventPluginContext } from './plugins/EventPluginContext';
33
import { expect } from 'chai';
4+
import * as sinon from 'sinon';
45

56
describe('ExceptionlessClient', () => {
7+
let xhr: any;
8+
9+
beforeEach(() => {
10+
xhr = sinon.useFakeXMLHttpRequest();
11+
});
12+
13+
afterEach(() => {
14+
xhr.restore();
15+
});
16+
617
it('should use event reference ids', (done) => {
7-
let error = new Error('From Unit Test');
18+
let error = createException();
819

920
let client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
1021
expect(client.config.lastReferenceIdManager.getLast()).to.be.null;
@@ -71,4 +82,15 @@ describe('ExceptionlessClient', () => {
7182
expect(client.config.apiKey).to.equal('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
7283
expect(client.config.serverUrl).to.equal('http://localhost:50000');
7384
});
85+
86+
function createException() {
87+
function throwError() {
88+
throw new ReferenceError('This is a test');
89+
}
90+
try {
91+
throwError();
92+
} catch (e) {
93+
return e;
94+
}
95+
}
7496
});

0 commit comments

Comments
 (0)