Skip to content

Commit

Permalink
fix(interactive): refine the logs when fetching statistics from groot (
Browse files Browse the repository at this point in the history
  • Loading branch information
BingqingLyu authored Sep 29, 2024
1 parent 03fe273 commit 1eae4e7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ private Glogue create(GlogueSchema schema, int maxPatternSize) {
}
// compute pattern cardinality
this.glogueCardinalityEstimation = new GlogueBasicCardinalityEstimationImpl(this, schema);
logger.debug("GlogueGraph\n" + this.toString());
logger.info(
"GlogueGraph is created, with {} vertices and {} edges",
this.glogueGraph.vertexSet().size(),
this.glogueGraph.edgeSet().size());

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ public GlogueSchema(GraphSchema graphSchema) {
edgeTypeCardinality.put(edgeType, 1.0);
}
}
logger.debug("GlogueSchema created with default cardinality 1.0: {}", this);
logger.info("GlogueSchema created with default cardinality 1.0: {}", this);
}

public GlogueSchema(GraphSchema graphSchema, GraphStatistics statistics) {
logger.info(
"Creating GlogueSchema with statistics, vertex count: {}, edge count: {}",
statistics.getVertexCount(),
statistics.getEdgeCount());

schemaGraph = new DirectedPseudograph<Integer, EdgeTypeId>(EdgeTypeId.class);
vertexTypeCardinality = new HashMap<Integer, Double>();
edgeTypeCardinality = new HashMap<EdgeTypeId, Double>();
Expand Down Expand Up @@ -120,7 +125,7 @@ public GlogueSchema(GraphSchema graphSchema, GraphStatistics statistics) {
}
}
}
logger.debug("GlogueSchema created with statistics: {}", this);
logger.info("GlogueSchema created with statistics: {}", this);
}

public static GlogueSchema fromMeta(IrMetaStats irMeta) {
Expand Down
4 changes: 4 additions & 0 deletions interactive_engine/executor/store/groot/src/db/graph/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,10 @@ impl GraphStore {
let edge_labels_statistics = self.get_edge_statistics(si)?;
let vertex_count = vertex_labels_statistics.values().sum();
let edge_count = edge_labels_statistics.values().sum();
info!(
"get_statistics in groot store partition, vertex_count {}, edge_count {}",
vertex_count, edge_count
);
Ok(GraphPartitionStatistics::new(
si,
vertex_count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ private void syncStatistics() {
Map<Integer, Statistics> statisticsMap = graphDefFetcher.fetchStatistics();
Statistics statistics = aggregateStatistics(statisticsMap);
this.graphStatistics.set(statistics);
logger.info("Fetched statistics from groot store to groot coordinator successfully");
} catch (Exception e) {
logger.error("Fetch statistics failed", e);
logger.error("Fetched statistics from groot store to groot coordinator failed", e);
}
sendStatisticsToFrontend();
}
Expand All @@ -142,7 +143,7 @@ private void sendStatisticsToFrontend() {
for (int i = 0; i < frontendCount; ++i) {
try {
frontendSnapshotClients.getClient(i).syncStatistics(statistics);
logger.debug("Sent statistics to frontend#{}", i);
logger.info("Sent statistics from groot coordinator to frontend#{}", i);
} catch (Exception e) {
logger.error("Failed to sync statistics to frontend", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ public SnapshotWithSchema getSnapshotWithSchema() {
}

public void setGraphStatisticsRef(GraphStatistics statistics) {
logger.info(
"update graph statistics in frontend cache, vertex num: {}, edge num: {}",
statistics.getVertexCount(),
statistics.getEdgeCount());
this.graphStatisticsRef.set(statistics);
}

Expand Down

0 comments on commit 1eae4e7

Please sign in to comment.