Skip to content

Commit 173d83d

Browse files
committed
Accumulating neo4j results.
1 parent 31160d3 commit 173d83d

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

nodestream_plugin_neo4j/result.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,88 @@
99

1010
# Timing metrics
1111
PLANNING_TIME = Metric(
12-
"neo4j_query_planning_time_ms", "Time taken to plan the Neo4j query."
12+
"neo4j_query_planning_time_ms", "Time taken to plan the Neo4j query.", accumulator=True,
1313
)
1414
PROCESSING_TIME = Metric(
15-
"neo4j_query_processing_time_ms", "Time taken to execute the Neo4j query."
15+
"neo4j_query_processing_time_ms", "Time taken to execute the Neo4j query.", accumulator=True,
1616
)
1717
TOTAL_TIME = Metric(
18-
"neo4j_query_total_time_ms", "Total time taken to execute the Neo4j query."
18+
"neo4j_query_total_time_ms", "Total time taken to execute the Neo4j query.", accumulator=True,
1919
)
2020
APOC_TIME = Metric(
21-
"neo4j_query_apoc_time_ms", "Time taken to execute the Neo4j query using APOC."
21+
"neo4j_query_apoc_time_ms", "Time taken to execute the Neo4j query using APOC.", accumulator=True,
2222
)
2323

2424
# Write metrics
2525
NODES_CREATED = Metric(
2626
"neo4j_query_write_metrics_nodes_created",
2727
"Number of nodes created in the Neo4j query.",
28+
accumulator=True,
2829
)
2930
NODES_DELETED = Metric(
3031
"neo4j_query_write_metrics_nodes_deleted",
3132
"Number of nodes deleted in the Neo4j query.",
33+
accumulator=True,
3234
)
3335
RELATIONSHIPS_CREATED = Metric(
3436
"neo4j_query_write_metrics_relationships_created",
3537
"Number of relationships created in the Neo4j query.",
38+
accumulator=True,
3639
)
3740
RELATIONSHIPS_DELETED = Metric(
3841
"neo4j_query_write_metrics_relationships_deleted",
3942
"Number of relationships deleted in the Neo4j query.",
43+
accumulator=True,
4044
)
4145
PROPERTIES_SET = Metric(
4246
"neo4j_query_write_metrics_properties_set",
4347
"Number of properties set in the Neo4j query.",
48+
accumulator=True,
4449
)
4550
LABELS_ADDED = Metric(
4651
"neo4j_query_write_metrics_labels_added",
4752
"Number of labels added in the Neo4j query.",
53+
accumulator=True,
4854
)
4955
LABELS_REMOVED = Metric(
5056
"neo4j_query_write_metrics_labels_removed",
5157
"Number of labels removed in the Neo4j query.",
58+
accumulator=True,
5259
)
5360
CONSTRAINTS_ADDED = Metric(
5461
"neo4j_query_write_metrics_constraints_added",
5562
"Number of constraints added in the Neo4j query.",
63+
accumulator=True,
5664
)
5765
CONSTRAINTS_REMOVED = Metric(
5866
"neo4j_query_write_metrics_constraints_removed",
5967
"Number of constraints removed in the Neo4j query.",
68+
accumulator=True,
6069
)
6170
INDEXES_ADDED = Metric(
6271
"neo4j_query_write_metrics_indexes_added",
6372
"Number of indexes added in the Neo4j query.",
73+
accumulator=True,
6474
)
6575
INDEXES_REMOVED = Metric(
6676
"neo4j_query_write_metrics_indexes_removed",
6777
"Number of indexes removed in the Neo4j query.",
78+
accumulator=True,
6879
)
6980

7081
# APOC specific metrics
7182
WAS_TERMINATED = Metric(
72-
"neo4j_query_was_terminated", "Whether the Neo4j query was terminated."
83+
"neo4j_query_was_terminated", "Whether the Neo4j query was terminated.", accumulator=True,
84+
)
85+
RETRIES = Metric(
86+
"neo4j_query_retries", "Number of retries in the Neo4j query.", accumulator=True
7387
)
74-
RETRIES = Metric("neo4j_query_retries", "Number of retries in the Neo4j query.")
7588

7689
# Error tracking
7790
ERROR_MESSAGES = Metric(
78-
"neo4j_query_error_messages", "Number of error messages in the Neo4j query."
91+
"neo4j_query_error_messages",
92+
"Number of error messages in the Neo4j query.",
93+
accumulator=True,
7994
)
8095

8196

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77

88
[tool.poetry.dependencies]
99
python = "^3.10"
10-
nodestream = "^0.14.11"
10+
nodestream = "^0.14.12"
1111
neo4j = "^5.16.0"
1212
cymple = "^0.11.0"
1313
dacite = "^1.9.2"

0 commit comments

Comments
 (0)