Perforce 2005.2 Command Reference
<< Previous Chapter
p4 clients
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 counters

p4 counter

Synopsis

Access, set, or delete a persistent variable.

Syntax

p4 [g-opts] counter countername
p4 [g-opts] counter countername value
p4 [g-opts] counter -d countername
p4 [g-opts] counter -f [ change | job | journal | monitor [ 1 | 0 ] ]

Description

Counters provide long-term variable storage for scripts that access Perforce. For example, the Perforce review daemon uses a counter (review) that stores the number of the last processed changelist.

When used in the form p4 counter countername, the value of variable countername is returned. When p4 counter countername value is used, the value of variable countername is set to value, and if countername does not already exist, it is created.

The Perforce server uses three counters in the course of its regular operations: change, job, and journal. Superusers may use the -f flag to force changes to these counters. Changes to these counters are not without risk; see the Release Notes for examples of the types of situations in which manually resetting these counters might be appropriate.

You can enable or disable server process monitoring by setting the monitor counter to 1 or 0. You must stop and restart the Perforce server for this change to take effect. After enabling process monitoring, you can use p4 monitor to observe processes spawned by the Perforce server.

To configure password strength requirements or to require the use of the ticket-based authentication mechanism, set the security counter to the desired level. You must stop and restart the Perforce server for this change to take effect. See the System Administrator's Guide for details.

Options

-d countername

Delete variable countername from the Perforce server.

-f [change|job|journal]

Force a change to one of three internal counters used by Perforce. Most installations rarely, if ever, need to use this flag.

-f monitor [ 1 | 0 ]

Activate or deactivate server process monitoring.

See p4 monitor for details.

-f security [ 0 | 1 | 2 | 3 ]

Set the server security level.

See the System Administrator's Guide for details.

g-opts

See the Global Options section.

Usage Notes

Can File Arguments Use
Revision Specifier?

Can File Arguments Use
Revision Range?

Minimal Access Level Required

N/A

N/A

list to display a counter's value;
review to set a new value
super to use the -f flag

Examples

p4 counter mycounter 123

Set the value of a counter mycounter to 123. If mycounter does not exist, it is created.

Requires review access.

p4 counter mycounter

Display the value of mycounter. If mycounter does not exist, its value is displayed as 0.

Requires list access.

Related Commands

To list all counters and their values

p4 counters

List and track changelists

p4 review

List users who have subscribed to particular files

p4 reviews


Perforce 2005.2 Command Reference
<< Previous Chapter
p4 clients
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 counters
Please send comments and questions about this manual to [email protected].
Copyright 1999-2005 Perforce Software. All rights reserved.
Last updated: 12/15/05