Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
NSAmelchev committed Jun 10, 2020
1 parent bfb8a8c commit e890188
Show file tree
Hide file tree
Showing 42 changed files with 626 additions and 4,004 deletions.
38 changes: 0 additions & 38 deletions assembly/dependencies-profiling.xml

This file was deleted.

130 changes: 0 additions & 130 deletions bin/profiling.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
import org.apache.ignite.internal.processors.metric.impl.HitRateMetric;
import org.apache.ignite.internal.processors.task.GridInternal;
import org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor;
import org.apache.ignite.internal.profiling.LogFileProfiling;
import org.apache.ignite.internal.profiling.FileProfiling;
import org.apache.ignite.internal.util.StripedExecutor;
import org.apache.ignite.internal.util.future.GridCompoundFuture;
import org.apache.ignite.internal.util.typedef.CX1;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.T4;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.spi.metric.HistogramMetric;
import org.apache.ignite.spi.metric.Metric;
Expand Down Expand Up @@ -242,7 +242,7 @@ public class GridMetricManager extends GridManagerAdapter<MetricExporterSpi> imp
private final MemoryUsageMetrics nonHeap;

/** Profiling. */
private final LogFileProfiling profiling;
private final FileProfiling profiling;

/**
* @param ctx Kernal context.
Expand Down Expand Up @@ -282,7 +282,7 @@ public GridMetricManager(GridKernalContext ctx) {
pmeReg.histogram(PME_OPS_BLOCKED_DURATION_HISTOGRAM, pmeBounds,
"Histogram of cache operations blocked PME durations in milliseconds.");

profiling = new LogFileProfiling(ctx);
profiling = new FileProfiling(ctx);
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -791,7 +791,7 @@ public boolean profilingEnabled() {
}

/** @return Profiling. */
public LogFileProfiling profiling() {
public FileProfiling profiling() {
return profiling;
}

Expand Down Expand Up @@ -926,7 +926,7 @@ public void update(MemoryUsage usage) {

/** Job to start/stop profiling. */
@GridInternal
private static class ProfilingJob implements IgniteClosure<T4<Boolean, Long, Integer, Integer>, Void> {
private static class ProfilingJob extends CX1<T4<Boolean, Long, Integer, Integer>, Void> {
/** Serial version uid. */
private static final long serialVersionUID = 0L;

Expand All @@ -935,11 +935,11 @@ private static class ProfilingJob implements IgniteClosure<T4<Boolean, Long, Int
private transient IgniteEx ignite;

/** @param t Tuple with settings. */
@Override public Void apply(T4<Boolean, Long, Integer, Integer> t) {
@Override public Void applyx(T4<Boolean, Long, Integer, Integer> t) throws IgniteCheckedException {
if (t.get1())
ignite.context().metric().profiling().startProfiling(t.get2(), t.get3(), t.get4());
else
ignite.context().metric().profiling().stopProfiling();
ignite.context().metric().profiling().stopProfiling().get();

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,9 @@
* <p>
* Each node collects statistics to a profiling file placed under {@link #PROFILING_DIR}.
* <p>
* To build the performance report follow:
* <ol>
* <li>Start profiling. See {@link #startProfiling(long, int, int)}</li>
* <li>Collect workload statistics.</li>
* <li>Stop profiling. See {@link #stopProfiling()}</li>
* <li>Collect profiling files from all nodes under an empty directory.</li>
* <li>Run script {@code ./bin/profiling.sh path_to_files} to build the performance report.</li>
* </ol>
* <b>Note:</b> Start profiling again will erase previous profiling files.
*/
public class LogFileProfiling implements IgniteProfiling {
public class FileProfiling implements IgniteProfiling {
/** Default Maximum file size in bytes. Profiling will be stopped when the size exceeded. */
public static final long DFLT_FILE_MAX_SIZE = 16 * 1024 * 1024 * 1024L;

Expand Down Expand Up @@ -93,7 +85,7 @@ public class LogFileProfiling implements IgniteProfiling {
private final IgniteLogger log;

/** @param ctx Kernal context. */
public LogFileProfiling(GridKernalContext ctx) {
public FileProfiling(GridKernalContext ctx) {
log = ctx.log(getClass());

this.ctx = ctx;
Expand Down
Loading

0 comments on commit e890188

Please sign in to comment.