From: Cédric Biancheri Date: Mon, 6 Jun 2016 14:02:39 +0000 (-0400) Subject: lttng: add names of traces in sync algorithm stats X-Git-Url: http://git.efficios.com/?p=deliverable%2Ftracecompass.git;a=commitdiff_plain;h=649c89d002abb7f1fbc887c29d8b9afeaeabbc9c lttng: add names of traces in sync algorithm stats Two lines were added to match traces Ids with traces names so it can be easier to see which pairs were synchronized. Change-Id: Iec69283080a12668c02d5886b4bbf95e1440ac00 Signed-off-by: Cédric Biancheri Reviewed-on: https://git.eclipse.org/r/74674 Reviewed-by: Hudson CI Reviewed-by: Genevieve Bastien Tested-by: Genevieve Bastien Reviewed-by: Matthew Khouzam --- diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/synchronization/SyncAlgorithmFullyIncremental.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/synchronization/SyncAlgorithmFullyIncremental.java index 723b958b51..26b1db5dcd 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/synchronization/SyncAlgorithmFullyIncremental.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/synchronization/SyncAlgorithmFullyIncremental.java @@ -89,7 +89,7 @@ public class SyncAlgorithmFullyIncremental extends SynchronizationAlgorithm { for (int i = 0; i < traceArr.length; i++) { for (int j = i + 1; j < traceArr.length; j++) { if (!traceArr[i].getHostId().equals(traceArr[j].getHostId())) { - ConvexHull algo = new ConvexHull(traceArr[i].getHostId(), traceArr[j].getHostId()); + ConvexHull algo = new ConvexHull(traceArr[i], traceArr[j]); fSyncs.add(algo); } } @@ -98,8 +98,10 @@ public class SyncAlgorithmFullyIncremental extends SynchronizationAlgorithm { @Override protected void processMatch(TmfEventDependency match) { - String host1 = match.getSourceEvent().getTrace().getHostId(); - String host2 = match.getDestinationEvent().getTrace().getHostId(); + ITmfTrace trace1 = match.getSourceEvent().getTrace(); + ITmfTrace trace2 = match.getDestinationEvent().getTrace(); + String host1 = trace1.getHostId(); + String host2 = trace2.getHostId(); /* Process only if source and destination are different */ if (host1.equals(host2)) { @@ -114,7 +116,7 @@ public class SyncAlgorithmFullyIncremental extends SynchronizationAlgorithm { } } if (algo == null) { - algo = new ConvexHull(host1, host2); + algo = new ConvexHull(trace1, trace2); fSyncs.add(algo); } algo.processMatch(match); @@ -210,7 +212,9 @@ public class SyncAlgorithmFullyIncremental extends SynchronizationAlgorithm { private static final long serialVersionUID = 8309351175030935291L; private final String fReferenceHost; + private final String fReferenceHostName; private final String fOtherHost; + private final String fOtherHostName; /** * Slopes and ordinate at origin of respectively fLmin, fLmax and the @@ -241,18 +245,24 @@ public class SyncAlgorithmFullyIncremental extends SynchronizationAlgorithm { /** * Initialization of the attributes * - * @param host1 - * ID of the first host - * @param host2 - * ID of the second host + * @param trace1 + * Trace of the first host + * @param trace2 + * Trace of the second host */ - public ConvexHull(String host1, String host2) { + public ConvexHull(ITmfTrace trace1, ITmfTrace trace2) { + String host1 = trace1.getHostId(); + String host2 = trace2.getHostId(); if (host1.compareTo(host2) > 0) { fReferenceHost = host2; + fReferenceHostName = trace2.getName(); fOtherHost = host1; + fOtherHostName = trace1.getName(); } else { fReferenceHost = host1; + fReferenceHostName = trace1.getName(); fOtherHost = host2; + fOtherHostName = trace2.getName(); } fAlpha = BigDecimal.ONE; fAlphamax = BigDecimal.ONE; @@ -482,8 +492,8 @@ public class SyncAlgorithmFullyIncremental extends SynchronizationAlgorithm { break; } - fStats.put(Messages.SyncAlgorithmFullyIncremental_refhost, fReferenceHost); - fStats.put(Messages.SyncAlgorithmFullyIncremental_otherhost, fOtherHost); + fStats.put(Messages.SyncAlgorithmFullyIncremental_refhost, fReferenceHostName + " (" + fReferenceHost + ")"); + fStats.put(Messages.SyncAlgorithmFullyIncremental_otherhost, fOtherHostName + " (" + fOtherHost + ")"); fStats.put(Messages.SyncAlgorithmFullyIncremental_quality, syncQuality); fStats.put(Messages.SyncAlgorithmFullyIncremental_alpha, fAlpha); fStats.put(Messages.SyncAlgorithmFullyIncremental_beta, fBeta);