Netdump

Netdump

A connection to netdump running on an instance.

Instances of this class are returned from Instance#netdump and Instance#newNetdump. They should not be created using the constructor.

Methods

(async) clearLog()

Description:
  • Clear captured netdump data

Source:
Example
let netdump = await instance.newNetdump();
netdump.clearLog();

disconnect()

Description:
  • Disconnect netdump connection. This is usually only required if a new netdump connection has been created and is no longer needed

Source:
Example
netdump.disconnect();

handleMessage(handler)

Description:
  • Set message handler

Source:
Example
let netdump = await instance.newNetdump();
netdump.handleMessage((message) => {
  if (Buffer.isBuffer(message)) {
    console.log(message.toString())
  } else {
    console.log(message)
  }
});
Parameters:
Name Type Description
handler NetworkMonitorProcessMap~newEntryCallback

the callback for captured entry

(async) isEnabled() → {boolean}

Description:
  • Check if netdump is enabled

Source:
Example
let enabled = await netdump.isEnabled();
if (enabled) {
    console.log("enabled");
} else {
    console.log("disabled");
}
Returns:
Type
boolean

(async) start()

Description:
  • Start netdump

Source:
Example
let netdump = await instance.newNetdump();
netdump.start();

(async) stop()

Description:
  • Stop Netdump

Source:
Example
let netdump = await instance.newNetdump();
netdump.stop();