Get the Perforce counters for this repository.

Namespace: Perforce.P4
Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)

Syntax

C#
public IList<Counter> GetCounters(
	Options options
)
Visual Basic
Public Function GetCounters ( _
	options As Options _
) As IList(Of Counter)
Visual C++
public:
IList<Counter^>^ GetCounters(
	Options^ options
)

Parameters

options
Type: Perforce.P4..::..Options

Return Value

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:
CopyC#
IList<Counter> target = Repository.GetCounters(null);
To get the counters on the server that start with the name "build_":
CopyC#
Options opts = new Options();
opts["-e"] = "build_*";
IList<Counter> target = Repository.GetCounters(opts);

See Also