Click or drag to resize

RepositoryGetCounters Method

Get the Perforce counters for this repository.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public IList<Counter> GetCounters(
	Options options
)

Parameters

options
Type: Perforce.P4Options

Return Value

Type: IListCounter
Remarks

p4 help counters

counters -- Display list of known counters

p4 counters [-e nameFilter -m max]

Lists the counters in use by the server. The server
uses the following counters directly:

change Current change number
job Current job number
journal Current journal number
lastCheckpointAction Data about the last complete checkpoint
logger Event log index used by 'p4 logger'
traits Internal trait lot number used by 'p4 attribute'
upgrade Server database upgrade level

The -e nameFilter flag lists counters with a name that matches
the nameFilter pattern, for example: -e 'mycounter-*'.

The -m max flag limits the output to the first 'max' counters.

The names 'minClient', 'minClientMessage', 'monitor',
'security', 'masterGenNumber', and 'unicode' are reserved names:
do not use them as ordinary counters.

For general-purpose server configuration, see 'p4 help configure'.

Examples
To get the counters on the server:
IList<Counter> target = Repository.GetCounters(null);
To get the counters on the server that start with the name "build_":
Options opts = new Options();
opts["-e"] = "build_*";
IList<Counter> target = Repository.GetCounters(opts);
See Also