UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

40 lines (39 loc) 1.76 kB
import type { MergeableRecord } from './objects'; export declare const enum SummarizerType { Benchmark = "benchmark", Statistics = "statistics" } export interface CommonSummarizerConfiguration extends MergeableRecord { logger: (message: string) => void; } export interface SummarizedMeasurement<T = number> { min: T; max: T; median: T; /** total may be useless for some measurements, especially if they are weighted before (it is just the sum...)*/ total: T; /** average */ mean: number; /** standard deviation */ std: number; } export declare abstract class Summarizer<Output, Configuration extends CommonSummarizerConfiguration> { protected readonly config: Configuration; protected readonly log: CommonSummarizerConfiguration['logger']; protected constructor(config: Configuration); /** * First phase of the summary, can be used to extract all data of interest from the individual * benchmark or statistic results. This can write temporary files based on the configuration. * * @param useTypeClassification - Whether to split the analysis based on the detected type (e.g. 'test', 'example', ...) */ abstract preparationPhase(useTypeClassification: boolean): Promise<void>; /** * Second phase of the summary, can be used to combine the data from the first phase * and produce some kind of "ultimate results". */ abstract summarizePhase(): Promise<Output>; } export declare function summarizedMeasurement2Csv(a: SummarizedMeasurement): string; export declare function summarizedMeasurement2CsvHeader(prefix?: string): string; export declare function summarizeMeasurement(data: number[], totalNumberOfDataPoints?: number): SummarizedMeasurement;