@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
69 lines (68 loc) • 5.03 kB
TypeScript
import { CPUNode } from './CPUNode';
import { Report } from '../model/Report';
import { ProjectReport } from '../model/ProjectReport';
import { ModuleReport } from '../model/ModuleReport';
import { UnifiedPath } from '../system/UnifiedPath';
import { ICpuProfileRaw } from '../../lib/vscode-js-profile-core/src/cpu/types';
import { BaseAdapter } from '../adapters/transformer/BaseAdapter';
import { MetricsDataCollection } from '../model/interfaces/MetricsDataCollection';
import { ModelMap } from '../model/ModelMap';
import { ProgramStructureTree } from '../model/ProgramStructureTree';
import { SourceMap } from '../model/SourceMap';
import { SourceNodeMetaData } from '../model/SourceNodeMetaData';
import { NodeModule } from '../model/NodeModule';
import { UnifiedPath_string, SourceNodeID_number, SourceNodeMetaDataType, SourceNodeIdentifier_string, IPureCPUTime, IPureCPUEnergyConsumption, IPureRAMEnergyConsumption } from '../types';
type AccountedTracker = {
map: Map<string, string[]>;
internMap: Map<string, boolean>;
externMap: Map<string, boolean>;
langInternalMap: Map<string, boolean>;
};
type CallIdentifier = {
reportID: number;
sourceNodeID: SourceNodeID_number;
};
type LastNodeCallInfo = {
report: Report;
sourceNode: SourceNodeMetaData<SourceNodeMetaDataType.SourceNode>;
};
export declare class InsertCPUProfileHelper {
static callIdentifierToString(identifier: CallIdentifier): string;
static initAccountedIfNecessary(accounted: AccountedTracker, callIdentifierString: string, kind: 'intern' | 'extern' | 'langInternal'): boolean;
static removeFromAccounted(accounted: AccountedTracker, callIdentifier: CallIdentifier): void;
static markAsAccounted(accounted: AccountedTracker, self: CallIdentifier, parent: CallIdentifier): boolean;
static sensorValuesForVisitedNode(cpuTime: IPureCPUTime, cpuEnergyConsumption: IPureCPUEnergyConsumption, ramEnergyConsumption: IPureRAMEnergyConsumption, visited: boolean): {
cpuTime: IPureCPUTime;
cpuEnergyConsumption: IPureCPUEnergyConsumption;
ramEnergyConsumption: IPureRAMEnergyConsumption;
};
static accountToLangInternal(cpuNode: CPUNode, reportToCredit: Report, lastNodeCallInfo: LastNodeCallInfo | undefined, accounted: AccountedTracker): Promise<{
firstTimeVisitedSourceNode_CallIdentifier: CallIdentifier | undefined;
parentSourceNode_CallIdentifier: CallIdentifier | undefined;
}>;
static accountOwnCodeGetsExecutedByExternal(cpuNode: CPUNode, originalReport: Report, functionIdentifier: SourceNodeIdentifier_string, relativeOriginalSourcePath: UnifiedPath | undefined, lastNodeCallInfo: LastNodeCallInfo, accounted: AccountedTracker): Promise<{
newReportToCredit: Report;
newLastInternSourceNode: SourceNodeMetaData<SourceNodeMetaDataType.SourceNode>;
firstTimeVisitedSourceNode_CallIdentifier: CallIdentifier | undefined;
parentSourceNode_CallIdentifier: CallIdentifier;
}>;
static accountToIntern(reportToCredit: Report, cpuNode: CPUNode, functionIdentifier: SourceNodeIdentifier_string, relativeOriginalSourcePath: UnifiedPath | undefined, lastNodeCallInfo: LastNodeCallInfo | undefined, awaiterStack: SourceNodeMetaData<SourceNodeMetaDataType.SourceNode>[], accounted: AccountedTracker): Promise<{
isAwaiterSourceNode: boolean;
firstTimeVisitedSourceNode_CallIdentifier: CallIdentifier | undefined;
parentSourceNode_CallIdentifier: CallIdentifier | undefined;
newLastInternSourceNode: SourceNodeMetaData<SourceNodeMetaDataType.SourceNode>;
}>;
static accountToExtern(reportToCredit: Report, cpuNode: CPUNode, nodeModule: NodeModule, functionIdentifier: SourceNodeIdentifier_string, relativeOriginalSourcePath: UnifiedPath | undefined, lastNodeCallInfo: LastNodeCallInfo | undefined, accounted: AccountedTracker): Promise<{
parentSourceNode_CallIdentifier: CallIdentifier | undefined;
firstTimeVisitedSourceNode_CallIdentifier: CallIdentifier | undefined;
newLastInternSourceNode: SourceNodeMetaData<SourceNodeMetaDataType.SourceNode>;
newReportToCredit: ModuleReport;
}>;
static resolveFunctionIdentifier(rootDir: UnifiedPath, cpuNode: CPUNode, programStructureTreePerFile: ModelMap<UnifiedPath_string, ProgramStructureTree>, programStructureTreePerOriginalFile: ModelMap<UnifiedPath_string, ProgramStructureTree>, transformerAdapterToUse: BaseAdapter, getSourceMapOfFile: (filePath: UnifiedPath) => SourceMap | undefined, getSourceMapFromSourceCode: (filePath: UnifiedPath, sourceCode: string) => SourceMap | undefined): Promise<{
functionIdentifier: SourceNodeIdentifier_string;
relativeOriginalSourcePath: UnifiedPath | undefined;
functionIdentifierPresentInOriginalFile: boolean;
}>;
static insertCPUProfile(reportToApply: ProjectReport, rootDir: UnifiedPath, profile: ICpuProfileRaw, transformerAdapter?: BaseAdapter, metricsDataCollection?: MetricsDataCollection): Promise<void>;
}
export {};