Skip to content

Commit

Permalink
Merge pull request #9702 from lassewesth/rena
Browse files Browse the repository at this point in the history
renaming side effect timing
  • Loading branch information
lassewesth authored Oct 8, 2024
2 parents f8dfddb + d44c23c commit 6b09941
Show file tree
Hide file tree
Showing 120 changed files with 129 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
public class AlgorithmProcessingTimings {
public final long preProcessingMillis;
public final long computeMillis;
public final long mutateOrWriteMillis;
public final long sideEffectMillis; // rename

AlgorithmProcessingTimings(long preProcessingMillis, long computeMillis, long mutateOrWriteMillis) {
AlgorithmProcessingTimings(long preProcessingMillis, long computeMillis, long sideEffectMillis) {
this.preProcessingMillis = preProcessingMillis;
this.computeMillis = computeMillis;
this.mutateOrWriteMillis = mutateOrWriteMillis;
this.sideEffectMillis = sideEffectMillis;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AlgorithmProcessingTimingsBuilder {
// timings
protected long preProcessingMillis = NOT_AVAILABLE;
protected long computeMillis = NOT_AVAILABLE;
protected long mutateOrWriteMillis = NOT_AVAILABLE;
protected long sideEffectMillis = NOT_AVAILABLE; // rename

public void withPreProcessingMillis(long preProcessingMillis) {
this.preProcessingMillis = preProcessingMillis;
Expand All @@ -39,15 +39,15 @@ public void withComputeMillis(long computeMillis) {
this.computeMillis = computeMillis;
}

public void withMutateOrWriteMillis(long mutateOrWriteMillis) {
this.mutateOrWriteMillis = mutateOrWriteMillis;
public void withSideEffectMillis(long sideEffectMillis) {
this.sideEffectMillis = sideEffectMillis;
}

AlgorithmProcessingTimings build() {
return new AlgorithmProcessingTimings(
preProcessingMillis,
computeMillis,
mutateOrWriteMillis
sideEffectMillis
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private <RESULT_FROM_ALGORITHM, METADATA> Optional<METADATA> processSideEffect(
) {
if (sideEffect.isEmpty()) return Optional.empty();

try (var ignored = ProgressTimer.start(timingsBuilder::withMutateOrWriteMillis)) {
try (var ignored = ProgressTimer.start(timingsBuilder::withSideEffectMillis)) { // rename
return sideEffect.get().process(graphResources, result);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void shouldDoFourStepProcess() {
assertThat(result).hasValue("some result");
assertThat(timings.preProcessingMillis).isGreaterThan(-1);
assertThat(timings.computeMillis).isGreaterThan(-1);
assertThat(timings.mutateOrWriteMillis).isGreaterThan(-1);
assertThat(timings.sideEffectMillis).isGreaterThan(-1);
assertThat(metadata).hasValue("metadata from some side effect");

return "some rendered result";
Expand Down Expand Up @@ -129,7 +129,7 @@ void shouldSkipSideEffect() {
assertThat(result).hasValue("some other result");
assertThat(timings.preProcessingMillis).isGreaterThan(-1);
assertThat(timings.computeMillis).isGreaterThan(-1);
assertThat(timings.mutateOrWriteMillis).isEqualTo(-1); // no side effect, no timing
assertThat(timings.sideEffectMillis).isEqualTo(-1); // no side effect, no timing
assertThat(metadata).isEmpty();

return "some other rendered result";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Stream<AlphaHarmonicWriteResult> build(
graph.nodeCount(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
configuration.writeProperty(),
centralityDistributionAndTiming.getLeft()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Stream<ArticulationPointsWriteResult> build(
new ArticulationPointsWriteResult(
bitSet.cardinality(),
metadata.map(NodePropertiesWritten::value).orElseThrow(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
timings.computeMillis,
configuration.toMap()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Stream<CELFWriteResult> build(

return Stream.of(
new CELFWriteResult(
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
nodePropertiesWritten.orElseThrow().value(),
timings.computeMillis,
celfResult.totalSpread(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <CONFIGURATION extends ConcurrencyConfig & ToMapConvertible> CentralityWriteResu
timings.preProcessingMillis,
timings.computeMillis,
centralityDistributionAndTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
centralityDistributionAndTiming.getLeft(),
configurationMap
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Stream<PageRankWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
pageRankDistribution.postProcessingMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configurationMap
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ArticulationPointsMutateResult build(
return new ArticulationPointsMutateResult(
bitSet.cardinality(),
metadata.map(NodePropertiesWritten::value).orElseThrow(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
timings.computeMillis,
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public CELFMutateResult build(
.withNodeCount(graph.nodeCount())
.withPreProcessingMillis(timings.preProcessingMillis)
.withComputeMillis(timings.computeMillis)
.withMutateMillis(timings.mutateOrWriteMillis)
.withMutateMillis(timings.sideEffectMillis)
.withNodePropertiesWritten(metadata.orElseThrow().value())
.withConfig(configuration)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <CONFIGURATION extends ConcurrencyConfig & ToMapConvertible> CentralityMutateRes
timings.preProcessingMillis,
timings.computeMillis,
centralityDistributionAndTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
centralityDistributionAndTiming.getLeft(),
configurationMap
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public IndirectExposureMutateResult build(
indirectExposureResult.didConverge(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public PageRankMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
pageRankDistribution.postProcessingMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configurationMap
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Stream<K1ColoringWriteResult> build(
var k1ColoringWriteResult = new K1ColoringWriteResult(
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
k1ColoringResult.colors().size(),
usedColors,
k1ColoringResult.ranIterations(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Stream<KCoreDecompositionWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
0,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
configuration.toMap()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Stream<KmeansWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatistics.computeMilliseconds(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
communitySummary,
centroids,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Stream<LabelPropagationWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatistics.computeMilliseconds(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
nodePropertiesWrittenAndConvertedNodePropertyValues.getLeft().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Stream<LocalClusteringCoefficientWriteResult> build(
localClusteringCoefficientResult.localClusteringCoefficients().size(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Stream<LeidenWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatistics.computeMilliseconds(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
nodePropertiesWrittenAndConvertedNodePropertyValues.getLeft().value(),
communitySummary,
Arrays.stream(leidenResult.modularities()).boxed().collect(Collectors.toList()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Stream<LouvainWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatistics.computeMilliseconds(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public Stream<ModularityOptimizationWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatistics.computeMilliseconds(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
modularityOptimizationResult.asNodeProperties().nodeCount(),
modularityOptimizationResult.didConverge(),
modularityOptimizationResult.ranIterations(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Stream<AlphaSccWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
hugeLongArray.size(),
communityStatisticsWithTiming.getLeft(),
(long) communityDistribution.get("max"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Stream<SccWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Stream<TriangleCountWriteResult> build(
graph.nodeCount(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Stream<WccWriteResult> build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatistics.computeMilliseconds(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
nodePropertiesWrittenAndConvertedNodePropertyValues.getLeft().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ApproxMaxKCutMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
0,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
configurationMap
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public K1ColoringMutateResult build(
return new K1ColoringMutateResult(
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
k1ColoringResult.colors().size(),
usedColors,
k1ColoringResult.ranIterations(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public KCoreDecompositionMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
0,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
configuration.toMap()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public KmeansMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
communityStatisticsWithTiming.getMiddle(),
centroids,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public LabelPropagationMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public LocalClusteringCoefficientMutateResult build(
localClusteringCoefficientResult.localClusteringCoefficients().size(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public LeidenMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
nodePropertiesWrittenAndConvertedNodePropertyValues.getLeft().value(),
communityStatisticsWithTiming.getMiddle(),
Arrays.stream(leidenResult.modularities()).boxed().collect(Collectors.toList()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public LouvainMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public ModularityOptimizationMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
modularityOptimizationResult.asNodeProperties().nodeCount(),
modularityOptimizationResult.didConverge(),
modularityOptimizationResult.ranIterations(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public SccMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public TriangleCountMutateResult build(
graph.nodeCount(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public WccMutateResult build(
timings.preProcessingMillis,
timings.computeMillis,
communityStatisticsWithTiming.getRight(),
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
metadata.orElseThrow().value(),
configuration.toMap()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Stream<DefaultNodeEmbeddingsWriteResult> build(
nodePropertiesWritten.orElseThrow().value(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
configuration.toMap()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Stream<DefaultNodeEmbeddingsWriteResult> build(
nodePropertiesWritten.orElseThrow().value(),
timings.preProcessingMillis,
timings.computeMillis,
timings.mutateOrWriteMillis,
timings.sideEffectMillis,
configuration.toMap()
);

Expand Down
Loading

0 comments on commit 6b09941

Please sign in to comment.