Skip to content

Feature/deduplication #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fd0f3bb
Start work to make the deduplication plugin work like the .NET one
srijken May 13, 2016
0fc7f0c
Cleanup and make sure we have stacks
srijken Sep 19, 2016
7c12490
Better hashcode calculation
srijken Sep 19, 2016
c609e4c
Merge master
srijken Sep 26, 2016
1e57e9e
Use the configured error parser
srijken Sep 26, 2016
93b29f0
Fix lint error
srijken Sep 27, 2016
8a1ebc3
Merge master
srijken Sep 27, 2016
0f8261a
Files from previous commit; merge from master
srijken Sep 27, 2016
e41652d
Increase timeouts
srijken Sep 27, 2016
b3419f1
load default settings / injects in testsuite
srijken Sep 27, 2016
4cfc5fa
use fake XMLHttpRequests
srijken Sep 27, 2016
fff0f69
Add sinon
srijken Sep 27, 2016
09cd805
Remove unused variable
srijken Sep 27, 2016
06d81f2
Create a real exception in the reference id test
srijken Sep 27, 2016
ef44761
Get rid of higher timeout values
srijken Sep 27, 2016
e2968cc
use the same priority as the .NET client
srijken Sep 28, 2016
1bbe4bf
Use += instead of =
srijken Sep 28, 2016
2a35c09
Also take the message into account, to deal with errors without stack…
srijken Sep 28, 2016
f7c9b2d
Add logging
srijken Sep 28, 2016
b26971a
correct the case where no stack trace is found
srijken Sep 28, 2016
bf1baab
use 30 secs as deduplication interval
srijken Oct 3, 2016
be062f7
Add check on error.message
srijken Oct 3, 2016
63c94a1
Fix lint messages
srijken Oct 3, 2016
66f40c3
Fix unit test
srijken Oct 3, 2016
cdf55c8
Run build
srijken Oct 3, 2016
bb0414d
Change some .info calls to .trace
srijken Oct 4, 2016
9651726
Merge branch 'master' into feature/deduplication
srijken Oct 4, 2016
ef5f477
ran the build
srijken Oct 4, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dist/exceptionless.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface IEvent {
value?: number;
data?: any;
reference_id?: string;
count?: number;
}
export declare class SubmissionResponse {
success: boolean;
Expand Down Expand Up @@ -426,9 +427,11 @@ export declare class SubmissionMethodPlugin implements IEventPlugin {
export declare class DuplicateCheckerPlugin implements IEventPlugin {
priority: number;
name: string;
private _mergedEvents;
private _processedHashcodes;
private _getCurrentTime;
constructor(getCurrentTime?: () => number);
private _interval;
constructor(getCurrentTime?: () => number, interval?: number);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should interval have a default value (you can do defaults in typescript)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that it's there, I just wonder if the definition needs to be regenerated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the definition needs to contain the default value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that it generates it correctly?

run(context: EventPluginContext, next?: () => void): void;
}
export declare class EventExclusionPlugin implements IEventPlugin {
Expand Down
82 changes: 60 additions & 22 deletions dist/exceptionless.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/exceptionless.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/exceptionless.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/exceptionless.min.js.map

Large diffs are not rendered by default.

82 changes: 60 additions & 22 deletions dist/exceptionless.node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/exceptionless.node.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ gulp.task('exceptionless.test.umd', ['typescript.test'], function () {
gulp.task('test-node', ['exceptionless.test.umd'], function(done) {
return gulp.src('dist/temp/exceptionless-nodespec.js', { read: false })
.pipe($.mocha({
require: ['source-map-support/register']
require: ['source-map-support/register'],
timeout: 5000
}))
.once('end', function () {
process.exit();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"rewire": "^2.5.2",
"rimraf": "2.5.3",
"run-sequence": "^1.2.2",
"sinon": "^1.17.6",
"source-map-support": "0.4.2",
"systemjs": "^0.19.39",
"tracekit": "0.4.3",
Expand Down
24 changes: 23 additions & 1 deletion src/ExceptionlessClient-spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import { ExceptionlessClient } from './ExceptionlessClient';
import { EventPluginContext } from './plugins/EventPluginContext';
import { expect } from 'chai';
import * as sinon from 'sinon';

describe('ExceptionlessClient', () => {
let xhr: any;

beforeEach(() => {
xhr = sinon.useFakeXMLHttpRequest();
});

afterEach(() => {
xhr.restore();
});

it('should use event reference ids', (done) => {
let error = new Error('From Unit Test');
let error = createException();

let client = new ExceptionlessClient('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw', 'http://localhost:50000');
expect(client.config.lastReferenceIdManager.getLast()).to.be.null;
Expand Down Expand Up @@ -71,4 +82,15 @@ describe('ExceptionlessClient', () => {
expect(client.config.apiKey).to.equal('LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw');
expect(client.config.serverUrl).to.equal('http://localhost:50000');
});

function createException() {
function throwError() {
throw new ReferenceError('This is a test');
}
try {
throwError();
} catch (e) {
return e;
}
}
});
1 change: 1 addition & 0 deletions src/models/IEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export interface IEvent {
value?: number;
data?: any;
reference_id?: string;
count?: number;
}
Loading