Module espace_opcount

Provide access to the operation counters.

Copyright © 2022, Fred Youhanaie

Authors: Fred Youhanaie (fyrlang@anydata.co.uk).

Description

Provide access to the operation counters.

Data Types

espace_op()

espace_op() = in | rd | inp | rdp | out | eval

Function Index

counts/0Return the current counts for the unnamed instance as a map.
counts/1Return the current counts for a named instance as a map.
incr/1Increment a single espace op counter for the unnamed instance.
incr/2Increment a single espace op counter for a named instance.
new/0Create a new ops counter array for the unnamed instance.
new/1Create a new ops counter array for a named instance.
reset/0Reset all the op counters of the unnamed instance.
reset/1Reset all the op counters of a named instance.

Function Details

counts/0

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

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

See counts/1 for details.

counts/1

counts(Inst_name::atom()) -> #{espace_op() => integer()}

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

incr/1

incr(Op::espace_op()) -> ok

Increment a single espace op counter for the unnamed instance.

See incr/1 for details.

incr/2

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

Increment a single espace op counter for a named instance.

In the interested 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/0

new() -> ok

Create a new ops counter array for the unnamed instance.

See new/1 for details.

new/1

new(Inst_name::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/0

reset() -> ok

Reset all the op counters of the unnamed instance.

See reset/1 for details.

reset/1

reset(Inst_name::atom()) -> ok

Reset all the op counters of a named instance.

This function has been provided for investigating an application.


Generated by EDoc