CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-kedro

Kedro helps you build production-ready data and analytics pipelines

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-12/

Custom Kedro Hook Plugin

Build a Kedro plugin that implements custom hooks to track pipeline execution metrics.

Requirements

Create a Kedro hook plugin that monitors node execution times and saves metrics to a file. The plugin should:

  1. Track the execution time of each node in a pipeline
  2. Store execution metrics in a JSON file after the pipeline completes

The plugin must record for each node execution:

  • Node name
  • Execution duration in seconds (rounded to 3 decimal places)

The metrics should be written to execution_metrics.json in the current directory after the pipeline finishes.

Expected Behavior

When a pipeline runs with this plugin installed:

  • Each node execution is tracked with its name and duration @test
  • After pipeline completion, metrics are written to execution_metrics.json @test
  • The JSON file contains a list of objects with node_name and duration fields @test

Implementation

@generates

API

"""
A Kedro hook plugin for tracking pipeline execution metrics.
"""

class MetricsHook:
    """
    Hook implementation that tracks node execution metrics.
    Implements the required hook methods to capture timing information.
    """
    pass

Dependencies { .dependencies }

kedro { .dependency }

Provides the hooks framework and plugin system.

Install with Tessl CLI

npx tessl i tessl/pypi-kedro

tile.json