It's all about the answers!

Ask a question

How to check which work item queries are not being used


Ian Wark (79713550) | asked Mar 02 '17, 7:27 p.m.
edited Mar 03 '17, 1:48 a.m. by Ralph Schoon (63.1k33646)

We have many work item queries that have piled up over a period of time and we want to cull the older ones that have not been used for a while and have a low frequency of usage.

Other than looking in the IHS access log for a query identifier and checking how many times and when the last time it was run, is there some log4j or similar log setting that displays a message in the ccm.log when a query is run (preferably something with the name of the query)?

We had a look at log options in repodebug, and there were many there, but we couldn't find one for this scenario.

I found that you can display the last time a query was edited and who did it with OSLC using URL similar to https://servername:9443/ccm/oslc/queries/<query_identifier>  but that only tells us when the query was edited, not run.

Does anyone have ideas for this?


Comments
Ian Wark commented Mar 02 '17, 7:28 p.m.

Note: We are using RTC 6.0.1 with WAS as application server.


Donald Nong commented Mar 02 '17, 9:05 p.m.

It's similar to asking when was the last time a work item was "viewed", which can be hard to get without some heaving tracing. IMO the data gathering and analyzing may not even be worthwhile in the end. Before getting into the technical details, let's clarify one thing first, why is there a concern about the number of work item queries to start with? Are we looking at public queries, shared queries or private queries?


Ian Wark commented Mar 02 '17, 10:01 p.m.

Public and shared queries. If there are too many of these it causes confusion. We just want to see what options exist. If the options are all too onerous we will fall back on the IHS access log.


Ian Wark commented Mar 13 '17, 8:45 p.m.

Donald, do you have any ideas for this?

2 answers



permanent link
Ian Wark (79713550) | answered Apr 05 '17, 4:15 a.m.
edited Apr 05 '17, 4:16 a.m.

I found a solution for this, so will share.

1. If you turn on debug log here, you can test and find the logger that interests you..
Default logging is for WARN and higher
log4j.rootLogger=DEBUG, file

In this case, that is repository.service.internal.rdb.TransactionalCache because it outputs the query UUID when it gets run:
2017-04-05 15:20:58,226 [ccm: AsynchronousTaskRunner-0 @@ 15:20] DEBUG repository.service.internal.rdb.TransactionalCache  etc.. etc.. runSavedQuery&id=_lye3wBjWEeeml6c6oIH6CA

2. Then you can turn off general DEBUG, reload the log settings:
Default logging is for WARN and higher
log4j.rootLogger=WARN, file

https://<servername>:9443/ccm/admin?internal=true#action=com.ibm.team.repository.admin.reloadLoggingSettings

3. Turn on repodebug service in CCM advanced properties (or JTS if required)
--> https://<servername>:9443/ccm/admin?internal=true#action=com.ibm.team.repository.admin.configureAdvanced
--> set com.ibm.team.repository.debug.DebugService to true

4. Go to https://<servername>:9443/ccm/repodebug/log/loggers and find your logger and click the link:
In this case "com.ibm.team.repository.service.internal.rdb.TransactionalCache".

5. Click EDITLEVEL and set to DEBUG

6. When done, go back and change the EDITLEVEL back to WARN or just Reload Log Settings again.


permanent link
Donald Nong (14.5k414) | answered Mar 13 '17, 11:49 p.m.

As far as I know, RTC does not record anything when a resource is "read", so unless you enable some debugging and logging, there is no existing method to reveal such information.

Actually if you think about it, it is very difficult to prove that something is "not being used". Let's say you have done 10 days of monitoring and see no access to a certain resource. Can you say it is "not being used"? No, because someone may try to access it on the 11th day.

I think a better approach is to survey the users and see which queries they are using and keep those and remove the rest. Or you can simply remove the ones you think not in use and see if anybody complains.


Comments
Ralph Schoon commented Mar 14 '17, 3:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I agree, to the best of my knowledge.Questions like this come up every now and then and the answer is simply that RTC does not track things like that so far. 

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.