Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
feat: remove recording methods from the API
Browse files Browse the repository at this point in the history
The new trace post-processing mechanism relies on a strict stack structure which can easily be broken via manual recording methods. We could change the API to make sure the stack structure is preserved but I'm not sure that anyone records event manually anyway. Let's disable this for the time being.

BREAKING CHANGES: the recording methods from the API are no longer available.
  • Loading branch information
lachrist committed Sep 2, 2022
1 parent 6ee1321 commit aa85b7d
Show file tree
Hide file tree
Showing 5 changed files with 407 additions and 380 deletions.
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Stop recording. Subsequent method invocations will throw exception.
* `url <string>` Script location.
* Returns `<string>` the instrumented code to run as a script.

### `appmap.recordBeginBundle()`
<!-- ### `appmap.recordBeginBundle()`

* Returns `recordEndBundle()`
* Returns `undefined`.
Expand Down Expand Up @@ -245,7 +245,7 @@ This methods record an anonymous jump. This event does not appear in the generat

### `appmap.recordClientRequest(request)`

Same type signature as `appmap.recordServerResponse` but without `route` property. Note that this method records a jump whereas `appmap.recordServerResponse` records a bundle.
Same type signature as `appmap.recordServerResponse` but without `route` property. Note that this method records a jump whereas `appmap.recordServerResponse` records a bundle. -->

## Configuration

Expand Down
1 change: 0 additions & 1 deletion components/recorder-api/default/.test.list
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
- record.mjs
- index.mjs
76 changes: 38 additions & 38 deletions components/recorder-api/default/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const _Set = Set;
const _String = String;
const _URL = URL;

import Record from "./record.mjs";
// import Record from "./record.mjs";

export default (dependencies) => {
const {
Expand All @@ -13,7 +13,7 @@ export default (dependencies) => {
"configuration-accessor": { resolveConfigurationManualRecorder },
hook: { hook, unhook },
agent: {
getSerializationEmptyValue,
// getSerializationEmptyValue,
openAgent,
closeAgent,
instrument,
Expand All @@ -23,14 +23,14 @@ export default (dependencies) => {
takeLocalAgentTrace,
},
} = dependencies;
const {
recordBeginBundle,
recordApply,
recordServerRequest,
recordBeforeJump,
recordQuery,
recordClientRequest,
} = Record(dependencies);
// const {
// recordBeginBundle,
// recordApply,
// recordServerRequest,
// recordBeforeJump,
// recordQuery,
// recordClientRequest,
// } = Record(dependencies);
let global_running = false;
const makeFile = (type, content, url = "file:///") => {
content = _String(content);
Expand Down Expand Up @@ -106,34 +106,34 @@ export default (dependencies) => {
closeAgent(this.agent);
}
/* c8 ignore start */
getEmptyValue() {
expectRunning(this.hooking);
return getSerializationEmptyValue(this.agent);
}
recordBeginBundle(data) {
expectRunning(this.hooking);
return recordBeginBundle(this.agent, data);
}
recordApply(data) {
expectRunning(this.hooking);
return recordApply(this.agent, data);
}
recordServerRequest(data) {
expectRunning(this.hooking);
return recordServerRequest(this.agent, data);
}
recordBeforeJump(data) {
expectRunning(this.hooking);
return recordBeforeJump(this.agent, data);
}
recordQuery(data) {
expectRunning(this.hooking);
return recordQuery(this.agent, data);
}
recordClientRequest(data) {
expectRunning(this.hooking);
return recordClientRequest(this.agent, data);
}
// getEmptyValue() {
// expectRunning(this.hooking);
// return getSerializationEmptyValue(this.agent);
// }
// recordBeginBundle(data) {
// expectRunning(this.hooking);
// return recordBeginBundle(this.agent, data);
// }
// recordApply(data) {
// expectRunning(this.hooking);
// return recordApply(this.agent, data);
// }
// recordServerRequest(data) {
// expectRunning(this.hooking);
// return recordServerRequest(this.agent, data);
// }
// recordBeforeJump(data) {
// expectRunning(this.hooking);
// return recordBeforeJump(this.agent, data);
// }
// recordQuery(data) {
// expectRunning(this.hooking);
// return recordQuery(this.agent, data);
// }
// recordClientRequest(data) {
// expectRunning(this.hooking);
// return recordClientRequest(this.agent, data);
// }
/* c8 ignore stop */
}
return { Appmap };
Expand Down
Loading

0 comments on commit aa85b7d

Please sign in to comment.