Skip to content

log node/edge counts when writing graphs #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2025
Merged

log node/edge counts when writing graphs #320

merged 3 commits into from
May 7, 2025

Conversation

maltek
Copy link
Contributor

@maltek maltek commented May 7, 2025

No description provided.

@maltek maltek requested a review from bbrehm May 7, 2025 13:26
@@ -156,7 +156,7 @@ class Graph(val schema: Schema, val storagePathMaybe: Option[Path] = None) exten
this.closed = true

storagePathMaybe.foreach { storagePath =>
logger.info(s"closing graph: writing to storage at `$storagePath`")
logger.info(s"closing graph: writing $nodeCount nodes and $edgeCount edges to storage at `$storagePath`")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info(s"closing graph: writing $nodeCount nodes and $edgeCount edges to storage at `$storagePath`")
logger.info(s"closing graph: writing $nodeCount nodes (and their edges) to storage at `$storagePath`")

We don't store an edgeCount anywhere - it's calculated on demand by walking the graph.
Of course we could change that, but not sure if it's really super important for this log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that we want to quickly spot from a log trace whether the graph loaded in separate runs was 'the same' or not. Ideally we'd output some sort of identity hash - but that's hard (and even more expensive to compute). We used to output nodes and edges in overflowdb, so that was my thought here too. So - edges aren't vital, but potentially still a useful signal.

It seems we can quite easily collect these counts one layer deeper during serialization. So I'll adjust this PR to do that, instead of walking the graph just for this log message.

@maltek maltek requested a review from mpollmeier May 7, 2025 14:26
@maltek maltek merged commit fd7fa8e into master May 7, 2025
1 check passed
@maltek maltek deleted the mkraus/counts branch May 7, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants