View Source MyspaceIPFS.Diag (Myspace IPFS v0.2.0-alpha.1)

MyspaceIPFS.Diag is where the diag commands of the IPFS API reside.

Link to this section Summary

Types

A commands element from the Diag Cmds command.

Functions

Clear the command history.

List commands run by the daemon. A history.

Collect a performance profile for debugging.

Set retention time for command history.

Print system diagnostic information.

Link to this section Types

@type cmd() :: %MyspaceIPFS.DiagCmd{
  active: boolean(),
  args: list(),
  command: binary(),
  end_time: binary(),
  id: integer(),
  options: map(),
  start_time: binary()
}

A commands element from the Diag Cmds command.

@type profile() :: %MyspaceIPFS.DiagProfile{
  output: Path.t(),
  query_options: list(),
  ref: reference(),
  timeout: binary(),
  writer: pid()
}

Link to this section Functions

@spec clear() :: {:ok, any()} | MyspaceIPFS.Api.error_response()

Clear the command history.

@spec cmds() :: {:ok, list()} | MyspaceIPFS.Api.error_response()

List commands run by the daemon. A history.

@spec profile(list()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()

Collect a performance profile for debugging.

NB! The recv_timeout is set to 35s. This is because the profile can take a while to generate. If you are getting a timeout error, try decreasing the profile-time. The default is 30s.

parameters

Parameters

timeout: The timeout for the request. Default is 35_000 milliseonds.

     This should be set to the profile-time + 5_000 milliseconds.

output: The output file for the profile. Default is "ipfs-profile-1676500690.zip".

options

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-diag-profile

[
  "output": <string>, # Output file for the profile. Default: "ipfs-profile-1676500690.zip".
  "collectors": <array>, # List of collectors to use.
  "profile-time": <string>, # Time to run the profiler for.
  "mutex-profile-fraction": <number>, # Fraction of mutex contention events to profile.
  "block-profile-rate": <number>, # Rate to sample goroutine blocking events.
]
@spec set_time(binary()) :: {:ok, any()} | MyspaceIPFS.Api.error_response()

Set retention time for command history.

parameters

Parameters

time: The time to set the retention time to.

@spec sys() :: {:ok, map()} | MyspaceIPFS.Api.error_response()

Print system diagnostic information.