zerot
    Preparing search index...

    Class ContractPerformanceMonitor

    Provides performance monitoring utilities for contract execution. It measures the execution time and success/failure rates of contract methods.

    Index

    Constructors

    Methods

    • Generates a performance report summarizing the metrics collected for each contract.

      Returns string

      A JSON string representing the performance report, sorted by average time in descending order.

    • Measures the execution time of a given function (typically a contract method). It updates internal metrics based on the success or failure of the function's execution.

      Type Parameters

      • T

        The return type of the function being measured.

      Parameters

      • contractName: string

        The name of the contract method being measured.

      • fn: () => T | Promise<T>

        The function to measure.

      Returns T | Promise<T>

      The result of the executed function.