TraceContext#newTimer: Separate message from arguments

We plan to add a new extension point that allows to write recorded times
into a dedicated performance log. To be able to aggregate data in the
performance log by message, the message string should be constant
(without parameters which differ for each invocation). Meta data that is
specific to one invocation should be recorded in a separate field in the
performance log.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I6417d8ddc4755cc7bfb60f3e57f050c262c28f17
This commit is contained in:
Edwin Kempin
2019-05-24 10:23:12 +02:00
parent b2ed5d7afd
commit 1b9244d7f3
16 changed files with 163 additions and 78 deletions

View File

@@ -152,7 +152,8 @@ public class SearchingChangeCacheImpl implements GitReferenceUpdatedListener {
@Override
public List<CachedChange> load(Project.NameKey key) throws Exception {
try (TraceTimer timer = TraceContext.newTimer("Loading changes of project %s", key);
try (TraceTimer timer =
TraceContext.newTimer("Loading changes of project", "projectName", key);
ManualRequestContext ctx = requestContext.open()) {
List<ChangeData> cds =
queryProvider