-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from evo-company/cache-graphql-ast-parsing
add lru_cache for parsing graphql ast
- Loading branch information
Showing
7 changed files
with
145 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ User's Guide | |
graphql | ||
protobuf | ||
federation | ||
telemetry | ||
reference/index | ||
changelog/index | ||
development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Telemetry | ||
========= | ||
|
||
Hiku exposes several prometheus metrics. | ||
|
||
Graph execution time metrics | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Shows the time spent in the graph execution for each Field or Link. | ||
|
||
You can enable graph execution time metrics like this: | ||
|
||
.. code-block:: python | ||
from hiku.telemetry import GraphMetrics | ||
from hiku.graph import Graph, Field, Root | ||
GRAPH = Graph([ | ||
Root([ | ||
Field('value', String, value_func), | ||
]), | ||
]) | ||
metrics = GraphMetrics('mobile', metric=mobile_graph_metrics) | ||
GRAPH = metrics.visit(GRAPH) | ||
Where: | ||
- *mobile* - is a graph label (in case you have multiple graphs in your app) | ||
- *metric* - is your custom Summary metric. If not provided, the default Summary('graph_field_time') is used | ||
|
||
Default metric: | ||
|
||
.. code-block:: python | ||
Summary( | ||
'graph_field_time', | ||
'Graph field time (seconds)', | ||
['graph', 'node', 'field'], | ||
) | ||
Query cache metrics | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
It is possible to enable query cache. That means that the same query will be parsed only once. | ||
|
||
When query cache is enabled, the following metrics are exposed: | ||
|
||
.. code-block:: python | ||
Gauge('hiku_query_cache_hits', 'Query cache hits') | ||
Gauge('hiku_query_cache_misses', 'Query cache misses') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters