@@ -100,7 +100,8 @@ public Stream<LabelPropagationStats> labelPropagation(
100100 } else {
101101 graphLoader .withDirection (direction );
102102 }
103- HeavyGraph graph = load (graphLoader , configuration );
103+
104+ HeavyGraph graph = load (graphLoader , configuration , stats );
104105
105106 if (graph .nodeCount () == 0 ) {
106107 graph .release ();
@@ -143,15 +144,16 @@ public Stream<LabelPropagation.StreamResult> labelPropagationStream(
143144 } else {
144145 graphLoader .withDirection (direction );
145146 }
146- HeavyGraph graph = load (graphLoader , configuration );
147+ LabelPropagationStats .Builder stats = new LabelPropagationStats .Builder ();
148+ HeavyGraph graph = load (graphLoader , configuration , stats );
147149
148150
149151 if (graph .nodeCount () == 0 ) {
150152 graph .release ();
151153 return Stream .empty ();
152154 }
153155
154- int [] result = compute (direction , iterations , batchSize , concurrency , graph , new LabelPropagationStats . Builder () , propertyMappings );
156+ int [] result = compute (direction , iterations , batchSize , concurrency , graph , stats , propertyMappings );
155157
156158 graph .release ();
157159
@@ -166,11 +168,12 @@ private PropertyMapping[] createPropertyMappings(String partitionProperty, Strin
166168 };
167169 }
168170
169- private HeavyGraph load (GraphLoader graphLoader , ProcedureConfiguration config ) {
171+ private HeavyGraph load (GraphLoader graphLoader , ProcedureConfiguration config , LabelPropagationStats . Builder stats ) {
170172 Class <? extends GraphFactory > graphImpl = config .getGraphImpl (
171173 HeavyGraph .TYPE , HeavyGraph .TYPE , HeavyCypherGraphFactory .TYPE );
172- return (HeavyGraph ) graphLoader .load (graphImpl );
173-
174+ try (ProgressTimer timer = stats .timeLoad ()) {
175+ return (HeavyGraph ) graphLoader .load (graphImpl );
176+ }
174177 }
175178
176179 private GraphLoader graphLoader (ProcedureConfiguration config , String partitionProperty , String weightKey , PropertyMapping ... propertyMappings ) {
0 commit comments