-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added customMetric in Custom Event beacon (#27)
* Added customMetric * Update lib/customEvents.js with indent Co-authored-by: HUAI NAN ZHOU <[email protected]> * Added e2e test for customMetric in weasel * e2e test for exponential value cm --------- Co-authored-by: Gouri-Hariharan1 <“[email protected]”> Co-authored-by: HUAI NAN ZHOU <[email protected]>
- Loading branch information
1 parent
b742b58
commit 53f9c2e
Showing
5 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
test/e2e/09_customEvents/simpleEventReportingWithoutCustomMetric.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>error test</title> | ||
|
||
<script src="/e2e/initializer.js"></script> | ||
<script crossorigin="anonymous" defer src="/target/eum.min.js"></script> | ||
<script> | ||
eum('meta', 'name', 'Tom'); | ||
eum('meta', 'age', 23); | ||
eum('meta', 'kind', 'newbie'); | ||
|
||
eum('reportEvent', 'testWithEmptyCustomMetric', { | ||
duration: 42, | ||
backendTraceId: 'ab87128a1ff99345', | ||
error: new Error('Testing 123'), | ||
componentStack: 'a component stack', | ||
meta: { | ||
// one-off overwrite | ||
kind: 'experienced', | ||
state: 'broken' | ||
}, | ||
customMetric: null | ||
}); | ||
eum('reportEvent', 'testWithNoCustomMetric', { | ||
duration: 2, | ||
backendTraceId: 'ab87128a1ff99345', | ||
error: new Error('something wrong'), | ||
componentStack: 'some stack', | ||
meta: { | ||
// one-off overwrite | ||
kind: 'experienced', | ||
state: 'broken' | ||
} | ||
}); | ||
eum('reportEvent', 'testWithIncorrectCustomMetric', { | ||
duration: 2, | ||
backendTraceId: 'ab87128a1ff99345', | ||
error: new Error('something wrong'), | ||
componentStack: 'some stack', | ||
meta: { | ||
// one-off overwrite | ||
kind: 'experienced', | ||
state: 'broken' | ||
}, | ||
customMetric: 'some string' | ||
}); | ||
eum('reportEvent', 'testWithExponentialCustomMetric(1e5)', { | ||
duration: 2, | ||
backendTraceId: 'ab87128a1ff99345', | ||
error: new Error('something wrong'), | ||
componentStack: 'some stack', | ||
meta: { | ||
// one-off overwrite | ||
kind: 'experienced', | ||
state: 'broken' | ||
}, | ||
customMetric: 1e5 | ||
}); | ||
</script> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.js"></script> | ||
</head> | ||
<body> | ||
simple event reporting without proper CustomMetric | ||
</body> | ||
</html> |