google / weather-tools

Tools to make weather data accessible and useful.
https://weather-tools.readthedocs.io/
Apache License 2.0
209 stars 39 forks source link

Add metrics to weather_mv ee. #465

Closed aniketsinghrawat closed 1 month ago

aniketsinghrawat commented 1 month ago

This PR adds support to get the element_processing_time metrics to beam.

We are actually calculating how much time it takes for an element to be processed during each stage, this information is passed with the element in the PCollection itself.

This is done in three parts:

AddTimer DoFn: Add this DoFn above the stage you want to calculate the metrics from. timeit decorator: After the AddTimer stage, add this decorator to the process functions for all subsequent stages. AddMetrics DoFn: Finally after the last stage, add this DoFn that adds the actual metrics.