Skip to content

Commit

Permalink
Merge pull request #93 from BalticAmadeus/develop
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
PauliusKu authored Oct 2, 2023
2 parents 60113b0 + 70cc041 commit efb9577
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 19 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 1.0.1 (2023-10-02)

### Added

- can open .out files
- processing of coverage data section

## Initial releases 1.0.0

### Added

- Load and view .prof profiler file
- View Module details.
- View Calling module details.
- View Called module details.
- View Line Summary.
- Treeview.
- Flamegraph.
- Ability to sort out procedure names by text.
- Ability to sort out by constructor and destructor.
- Profiler Start/Stop Snippets.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@ An extension for Progress Openedge Profiler.

This open source project is in active development. Our goal is to simplify the access to Progress Openedge Profiler when using VS Code as a development environment.

## Opening instructions

There are 3 option how to open view:

- In file explorer right click profiler file and select "Show Profiler"
- In open profiler file right click and select "Show Profiler"
- In open profiler file click this icon ![image](https://github.com/BalticAmadeus/ProPeek/assets/78811378/85a47e21-5e96-4c15-b5e9-6f2c59eb3afe) on the top right corner

![proPeek Demo](resources/images/propeek-open.webp)

## Features

- Load and view .prof profiler file
- Load and view _.prof_ and _.out_ profiler file
- View Module details.
- View Calling module details.
- View Called module details.
Expand Down
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pro-peek",
"displayName": "ProPeek",
"description": "Profiler app for OpenEdge ABL",
"version": "1.0.0",
"version": "1.0.1",
"publisher": "BalticAmadeus",
"engines": {
"vscode": "^1.78.0"
Expand All @@ -12,6 +12,13 @@
"Other",
"Visualization"
],
"keywords": [
"OpenEdge",
"Progress",
"Profiler",
"Performance",
"ABL"
],
"icon": "resources/PP_col.png",
"repository": {
"type": "git",
Expand Down Expand Up @@ -41,20 +48,20 @@
{
"command": "vsc-profiler.profiler",
"title": "Show Profiler",
"when": "resourceExtname == .prof",
"when": "resourceExtname == .prof || resourceExtname == .out",
"icon": "$(open-preview)"
}
],
"menus": {
"editor/context": [
{
"command": "vsc-profiler.profiler",
"when": "resourceExtname == .prof"
"when": "resourceExtname == .prof || resourceExtname == .out"
}
],
"editor/title": [
{
"when": "resourceExtname == .prof",
"when": "resourceExtname == .prof || resourceExtname == .out",
"command": "vsc-profiler.profiler",
"group": "navigation"
}
Expand All @@ -63,7 +70,7 @@
{
"command": "vsc-profiler.profiler",
"group": "navigation",
"when": "resourceExtname == .prof"
"when": "resourceExtname == .prof || resourceExtname == .out"
}
]
}
Expand Down
Binary file added resources/images/propeek-open.webp
Binary file not shown.
41 changes: 28 additions & 13 deletions src/services/parser/profilerRawData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ export interface ProfilerRawData {
CallTreeData : CallTreeData[]
}

export enum ProfilerSection {
Description = 0,
Module = 1,
CallGraph = 2,
LineSummary = 3,
Tracing = 4,
Coverage = 5,
CallTree = 6
}

/**
* Parse profiler file data into ProfilerRawData object
*/
export function parseProfilerData (fullContents : string) : ProfilerRawData {

const separator : string = ".";
let rawData = {} as ProfilerRawData;
let separatorCounter : number = 0;
let section : ProfilerSection = 0;
let lastLine : string;

rawData.ModuleData = [];
rawData.CallGraphData = [];
Expand All @@ -31,40 +42,44 @@ export function parseProfilerData (fullContents : string) : ProfilerRawData {

fullContents.split(/\r?\n/).forEach(line => {
if (line === separator) {
separatorCounter = separatorCounter + 1;
//coverage section can contain multiple separator lines, and only ends with two separators
if (section !== ProfilerSection.Coverage || lastLine === separator) {
section = section + 1;
}
} else {
rawData = parseRawDataLine(separatorCounter, line, rawData);
rawData = parseRawDataLine(section, line, rawData);
}
lastLine = line;
});

return rawData;
}

/**
* Parse raw data line into one of the section objects, depending on separatorCounter
* Parse raw data line into one of the section objects
*/
export function parseRawDataLine ( separatorCounter : number, line : string, rawData : ProfilerRawData ) : ProfilerRawData {
export function parseRawDataLine ( section : ProfilerSection, line : string, rawData : ProfilerRawData ) : ProfilerRawData {

switch (separatorCounter) {
case 0:
switch (section) {
case ProfilerSection.Description:
rawData.DescriptionData = parseDescriptionLine(line);
break;
case 1:
case ProfilerSection.Module:
rawData.ModuleData.push( parseModuleLine(line, rawData.DescriptionData.Version) );
break;
case 2:
case ProfilerSection.CallGraph:
rawData.CallGraphData.push( parseCallGraphLine(line) );
break;
case 3:
case ProfilerSection.LineSummary:
rawData.LineSummaryData.push( parseLineSummaryLine(line) );
break;
case 4:
case ProfilerSection.Tracing:
rawData.TracingData.push( parseTracingLine(line) );
break;
case 5:
case ProfilerSection.Coverage:
// Coverage Data Section - not used
break;
case 6:
case ProfilerSection.CallTree:
rawData.CallTreeData.push( parseCallTreeLine(line) );
break;
}
Expand Down

0 comments on commit efb9577

Please sign in to comment.