[This is preliminary documentation and is subject to change.]

Get a named Perforce counter value from the repository.

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

Syntax

C#
public Counter GetCounter(
	string name,
	Options options
)
Visual Basic
Public Function GetCounter ( _
	name As String, _
	options As Options _
) As Counter
Visual C++
public:
Counter^ GetCounter(
	String^ name, 
	Options^ options
)

Parameters

name
Type: System..::..String
options
Type: Perforce.P4..::..Options

Return Value

Remarks


p4 help counter

counter -- Display, set, or delete a counter

p4 counter name
p4 counter [-f] name value
p4 counter [-f] -d name
p4 counter [-f] -i name

The first form displays the value of the specified counter.

The second form sets the counter to the specified value.

The third form deletes the counter. This option usually has the
same effect as setting the counter to 0.

The -f flag sets or deletes counters used by Perforce, which are
listed by 'p4 help counters'. Important: Never set the 'change'
counter to a value that is lower than its current value.

The -i flag increments a counter by 1 and returns the new value.
This option is used instead of a value argument and can only be
used with numeric counters.

Counters can be assigned textual values as well as numeric ones,
despite the name 'counter'.

'p4 counter' requires 'review' access granted by 'p4 protect'.
The -f flag requires that the user be an operator or have 'super'
access.

See Also