pinpoint-node-agent
Version:
Pinpoint APM agent for Node.js — distributed tracing, error analysis, and URI statistics
46 lines (35 loc) • 710 B
JavaScript
/**
* Pinpoint Node.js Agent
* Copyright 2020-present NAVER Corp.
* Apache License v2.0
*/
const AsyncContextLocalStorage = require('./async-context-local-storage')
class LocalStorage {
constructor() {
this.storage = new AsyncContextLocalStorage()
}
run(store, callback) {
return this.storage.run(store, callback)
}
getStore() {
return this.storage.getStore()
}
disable() {
this.storage.disable()
}
enterWith(store) {
this.storage.enterWith(store)
}
}
class EmptyLocalStorage {
run() {
}
getStore() {
}
disable() {
}
enterWith() {
}
}
module.exports = new LocalStorage()