[p4] p4 opened -a too expensive ?
steve at vance.com
steve at vance.com
Thu Dec 15 03:36:50 PST 2005
This command will return all the clients for that user. The question is
whether it will return *exactly* the clients for that user. What if the
user name appears as a substring of another field or even another user name?
You can limit the vulnerability with 'grep " userA "'. You can limit it
even more in Perl (or any other language) by actually isolating the field
and testing it.
Steve
Original Message:
-----------------
From: Steven Bougon SBougon at ariba.com
Date: Wed, 14 Dec 2005 23:33:06 -0800
To: starwar at gmail.com, perforce-user at perforce.com
Subject: Re: [p4] p4 opened -a too expensive ?
Hi William,
thanks for the answer. But it does not work for me:
- given a user, how do you find all the client ?
(p4 clients | grep userA *might* return you all the clients for that
user, but there is no guarantee)
Else, I agree, for other scripts, we did find out that using smaller
queries can be faster.
Steven
PS: I'm on 2004.2
-----Original Message-----
From: William Yan [mailto:starwar at gmail.com]
Sent: Wednesday, December 14, 2005 11:27 PM
To: Steven Bougon
Cc: perforce-user at perforce.com
Subject: Re: [p4] p4 opened -a too expensive ?
this command is indeed expensive. It scans several tables as the
whole. Loading those tables may cause memory swap as well.
You can consider running 'p4 -c <client> opened' or 'p4 opened -c
<client>' depending on your p4d version. Of course you need find out
all clients and probably their owners first. We found that breaking a
huge query into multiple small ones can avoid the server lockup and
give others chances. But they come with panelties, such as overhead of
new tcp connections, p4d forking, etc. So You have to try to find the
balance of the pros and cons
-William
2005/12/14, Steven Bougon <SBougon at ariba.com>:
> Hi there,
>
> SCENARIO:
> some users sometimes have a lot of files opened and when I
> ask about why they have these files opened for more than
> 6 months, they often reply: "That's news to me" !
> So I wrote a script that parse the output of "p4 opened -a"
> to return a list of opened files per client, which gives
> something like that:
> $ perl p4opened.pl -u user1
> user1:
> -client client1
> | //a/b/c/file1.java
> | //a/b/c/file2.java
> | //a/b/c/file4.pl
> -client client4
> | //a/d/f/file10.java
> | //a/d/g/file20.java
> -client client12
> | //a/x/z/file100.java
>
> PROBLEM:
> Now, a colleague of mine would not let me check-in my script
> arguing that "p4 opened -a" is too expensive for the server
> (scans too many rows).
>
> QUESTIONS:
> - are there any alternative to, given a user, list *all* the opened
> files
> from *all* the user' clients ? (I can't use p4 clients to find *all*
the
>
> clients given a user because there is no option to do so ...)
>
> - as a p4 admin, how can I find out how expensive a request is ? (how
> many
> rows it scanned ?)
>
> thanks guys,
> Steven
> PS: I'm on 2004.2
>
> _______________________________________________
> perforce-user mailing list - perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
_______________________________________________
perforce-user mailing list - perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
More information about the perforce-user
mailing list