View Source espace_opcount (espace v0.9.0)

Provide access to the operation counters.

Summary

Functions

Return the current counts for the unnamed instance as a map.

Return the current counts for a named instance as a map.

Increment a single espace op counter for the unnamed instance.

Increment a single espace op counter for a named instance.

Create a new ops counter array for the unnamed instance.

Create a new ops counter array for a named instance.

Reset all the op counters of the unnamed instance.

Reset all the op counters of a named instance.

Types

espace_op/0

-type espace_op() :: in | rd | inp | rdp | out | eval.

Functions

counts()

-spec counts() -> #{espace_op() => integer()}.

Return the current counts for the unnamed instance as a map.

See counts/1 for details.

counts(Inst_name)

-spec counts(atom()) -> #{espace_op() => integer()}.
Return the current counts for a named instance as a map.

incr(Op)

-spec incr(espace_op()) -> ok.

Increment a single espace op counter for the unnamed instance.

See incr/1 for details.

incr(Inst_name, Op)

-spec incr(Inst_name :: atom(), Op :: espace_op()) -> ok.

Increment a single espace op counter for a named instance.

In the interest of keeping the code simple, the counter index of each op corresponds to the position of Op in the record tuple, which ranges from 2 to 7.

new()

-spec new() -> ok.

Create a new ops counter array for the unnamed instance.

See new/1 for details.

new(Inst_name)

-spec new(atom()) -> ok.

Create a new ops counter array for a named instance.

The array will have one counter per espace operation. The counters ref is saved in as a persistent term.

reset()

-spec reset() -> ok.

Reset all the op counters of the unnamed instance.

See reset/1 for details.

reset(Inst_name)

-spec reset(atom()) -> ok.

Reset all the op counters of a named instance.

This function has been provided for investigating an application.