@oaklean/profiler-core
Version:
Part of the @oaklean suite. It provides all basic functions to work with the `.oak` file format. It allows parsing the `.oak` file format as well as tools for analyzing the measurement values. It also provides all necessary capabilities required for prec
134 lines (133 loc) • 5.65 kB
TypeScript
import { z as zod } from 'zod';
import { UnifiedPath } from '../system/UnifiedPath';
import { IPowerMetricsSensorInterfaceOptions, IPerfSensorInterfaceOptions, IWindowsSensorInterfaceOptions, ProjectIdentifier_string, MicroSeconds_number, IProfilerConfig, IProfilerConfigFileRepresentation, RegistryOptions, ExportOptions, ProjectOptions, RuntimeOptions, SensorInterfaceType, DeepPartial } from '../types';
export interface IProfilerConfigIntermediate extends IProfilerConfigFileRepresentation {
filePath: UnifiedPath;
}
export declare class ProfilerConfig implements IProfilerConfig {
filePath: UnifiedPath;
extends?: string;
registryOptions: RegistryOptions;
exportOptions: ExportOptions;
projectOptions: ProjectOptions;
runtimeOptions: RuntimeOptions;
constructor(filePath: UnifiedPath, config: IProfilerConfig);
static getDefaultConfig(): ProfilerConfig;
static defaultConfigAsIntermediate(): {
exportOptions: {
outDir: string;
outHistoryDir: string;
rootDir: string;
exportV8Profile: boolean;
exportReport: boolean;
exportSensorInterfaceData: boolean;
};
registryOptions: {
url: string;
};
projectOptions: {
identifier: string;
};
runtimeOptions: {
seeds: {
'Math.random'?: string | undefined;
};
v8: {
cpu: {
sampleInterval: number;
};
};
sensorInterface?: {
type: SensorInterfaceType.powermetrics;
options: {
outputFilePath: string;
sampleInterval: number;
};
} | {
type: SensorInterfaceType.perf;
options: {
outputFilePath: string;
sampleInterval: number;
};
} | {
type: SensorInterfaceType.windows;
options: {
outputFilePath: string;
sampleInterval: number;
};
} | undefined;
};
extends?: string | undefined;
filePath: UnifiedPath;
};
static verifyConfig(config: DeepPartial<IProfilerConfig> | undefined): config is IProfilerConfig;
static printZodError(err: zod.ZodError): void;
getAnonymizedRuntimeOptions(): RuntimeOptions;
getV8CPUSamplingInterval(): MicroSeconds_number;
getRegistryUploadUrl(): string;
uploadEnabled(): boolean;
getProjectIdentifier(): ProjectIdentifier_string;
getRootDir(): UnifiedPath;
getOutDir(): UnifiedPath;
getOutHistoryDir(): UnifiedPath;
getSensorInterfaceType(): SensorInterfaceType | undefined;
static getSensorInterfaceType(json: IProfilerConfigFileRepresentation): SensorInterfaceType | undefined;
getSensorInterfaceOptions(): IPowerMetricsSensorInterfaceOptions | IPerfSensorInterfaceOptions | IWindowsSensorInterfaceOptions | undefined;
shouldExportV8Profile(): boolean;
shouldExportReport(): boolean;
shouldExportSensorInterfaceData(): boolean;
getSeedForMathRandom(): string | undefined;
static configAsExtended(config: IProfilerConfigIntermediate, pathDiff: UnifiedPath): IProfilerConfigFileRepresentation;
/**
* Fills unspecified values of the config with values of the given config to extend from
*
* example usage:
* - every config that gets resolved inherits values of the default config (baseConfig)
* to ensure that unspecified values are filled with the default value. This happens via:
* ProfilerConfig.implement(config, baseConfig):
*
* - if a config contains the extends keyword like this:
* {
* "extends": "<config that gets extended>"
* }
* the config gets extended via:
* ProfilerConfig.implement(config, <config mentioned in extends>):
*
* it also adjusts the inherited path values values to make them relative to the config
*
*
* @param config to inherit from
*/
static implement(config: IProfilerConfigIntermediate, configToExtend: IProfilerConfigIntermediate): void;
static intermediateFromJSON(json: string | IProfilerConfigFileRepresentation): IProfilerConfigIntermediate;
toJSON(): IProfilerConfig;
static stringifyConfig(config: IProfilerConfigFileRepresentation, options?: {
existingFileContent?: string;
addDefaultComments?: boolean;
}): string;
storeToFile(filePath: UnifiedPath, options?: {
addDefaultComments?: boolean;
}): void;
static storeIntermediateToFile(filePath: UnifiedPath, config: IProfilerConfigFileRepresentation, options?: {
addDefaultComments?: boolean;
}): void;
static loadFromFile(filePath: UnifiedPath): IProfilerConfigIntermediate | undefined;
static resolveFromFile(filePath: UnifiedPath | undefined): ProfilerConfig;
static autoResolveFromPath(startDir: UnifiedPath): ProfilerConfig;
static autoResolve(): ProfilerConfig;
static createMainConfig(options?: {
projectOptions?: {
identifier: ProjectIdentifier_string;
};
}): Promise<ProfilerConfig>;
/**
* Function to initialize a local config file that extends the main config file
*
* @param options
* @returns
*/
static createLocalConfig(options: {
selectedSensorInterface?: SensorInterfaceType;
sensorInterfaceSampleInterval?: MicroSeconds_number;
}): IProfilerConfigFileRepresentation;
}