Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IProfile

Follows Chrome DevTools cpuprofile format. See Chrome DevTools protocol docs for more details.

In order to analyze resulting Profile - serialize this class as JSON and put to a .cpuprofile file. It will be available to use in DevTools on "Performance" tab, or in Visual Studio Code.

example
// server
alt.onClient("saveProfile", (player, name, content) => {
    fs.writeFileSync("./" + name + ".cpuprofile", content);
});

// client
alt.Profile.startProfiling("test");
// do some stuff
const profile = alt.Profile.stopProfiling("test");
const content = JSON.stringify(profile);
alt.emitServer("saveProfile", "test", content);

Hierarchy

  • IProfile

Index

Properties

Readonly endTime

endTime: number

Profiling end timestamp in microseconds.

Readonly nodes

nodes: readonly IProfileNode[]

The list of profile nodes. First item is the root node.

Readonly samples

samples: readonly number[]

Ids of samples top nodes.

Readonly startTime

startTime: number

Profiling start timestamp in microseconds.

Readonly timeDeltas

timeDeltas: readonly number[]

Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.