/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ /** * Processes raw ADO build data into aggregated metrics for build performance dashboards. */ import type { AdoBuildRecord, AdoTimeline, BuildPerfMode, BuildSummary, DurationTrendPoint, ProcessedBuild, ProcessedDataOutput, StageDurationTrend, StagePerformance, TaskDurationTrend } from "./types.js"; /** * Parse an ADO timestamp string into a Date object. */ export declare function parseAdoTime(timestamp: string | undefined | null): Date | null; /** * Calculate duration in minutes between two timestamps. */ export declare function calcDurationMins(startTime: string | undefined, finishTime: string | undefined): number | null; /** * Extract source display text from a build record. * Returns PR number for PR builds, short commit hash otherwise. */ export declare function getSourceText(build: AdoBuildRecord): string; /** * Build source URL (GitHub PR or commit). * * @param build - The build record. * @param githubRepo - GitHub repo slug (e.g. "microsoft/FluidFramework"). Defaults to "microsoft/FluidFramework". */ export declare function getSourceUrl(build: AdoBuildRecord, githubRepo?: string): string | null; /** * Build ADO build URL. * * @param build - The build record. * @param project - The ADO project name. * @param org - The ADO organization name. Defaults to "fluidframework". */ export declare function getBuildUrl(build: AdoBuildRecord, project: string, org?: string): string; /** * Filter builds for public mode (PR builds targeting main). * Internal mode returns all builds (they are already filtered by the query). */ export declare function filterBuilds(builds: AdoBuildRecord[], mode: BuildPerfMode): AdoBuildRecord[]; /** * Process a raw build record into the display format. */ export declare function processBuild(build: AdoBuildRecord, project: string, org?: string, githubRepo?: string): ProcessedBuild; /** * Calculate summary statistics from processed builds. */ export declare function calcSummary(builds: ProcessedBuild[]): BuildSummary; /** * Calculate percentage change over a period using calendar days. * Compares the average duration of the last N calendar days vs the previous period. */ export declare function calcPeriodChange(durationTrend: DurationTrendPoint[], days: number): number; /** * Calculate duration trend (min, average, max per day). */ export declare function calcDurationTrend(builds: ProcessedBuild[]): DurationTrendPoint[]; /** * Process timeline data to extract stage and task metrics. */ export declare function processTimelines(timelines: Record): { stagePerformance: StagePerformance[]; stageTaskBreakdown: Record; }; /** * Calculate stage duration trend over time (for stacked bar chart). */ export declare function calcStageDurationTrend(builds: AdoBuildRecord[], timelines: Record): StageDurationTrend; /** * Calculate task duration trend over time (for stacked bar chart). * Returns top 10 tasks by average duration. */ export declare function calcTaskDurationTrend(builds: AdoBuildRecord[], timelines: Record): TaskDurationTrend; /** * Main processing function. Transforms raw ADO build and timeline data * into aggregated dashboard metrics. */ export declare function processRawData(builds: AdoBuildRecord[], timelines: Record, mode: BuildPerfMode, generatedAt?: string, org?: string, githubRepo?: string): ProcessedDataOutput; //# sourceMappingURL=processData.d.ts.map