UNPKG

dt-app

Version:

The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.

40 lines (39 loc) 1.79 kB
import { BuildFeatureType } from '../build/bundler/definitions'; /** * Initializes the build metrics state and records build start for all features. * Call at dev server start. */ export declare function initBuildMetrics(): void; /** * Records the start time of a build for a given feature type. * The first completed build for each feature will be tagged as "initial", * all subsequent builds as "rebuild". * * If no build has completed yet and a start time is already pending * (i.e., the initial build start was recorded at dev server start), * the existing start time is preserved. * * @param feature The BuildFeatureType being built * @param offsetMs Optional offset in milliseconds. If provided, the start time will be set to (now - offsetMs). */ export declare function recordBuildStart(feature: BuildFeatureType, offsetMs?: number): void; /** * Records the end time of a build for a given feature type. * Automatically determines the build type: if no build has been completed yet * for this feature, it is tagged as "initial"; otherwise as "rebuild". * @param feature The BuildFeatureType being built */ export declare function recordBuildEnd(feature: BuildFeatureType): void; /** * Reports all collected build and rebuild metrics as bizevents. * All build times are reported in seconds, rounded to 3 decimal places. * Initial builds are reported separately from rebuild statistics. * Rebuild statistics (min, max, avg, median and count) exclude the initial build. */ export declare function reportBuildMetrics(): void; /** * Converts a duration in milliseconds to seconds, rounded to 3 decimal places. * @param ms Duration in milliseconds * @returns Duration in seconds, rounded to 3 decimals */ export declare function msToSecRounded(ms: number): number;