@@ -6,16 +6,16 @@ const cpuCanvas = document.getElementById("cpu");
6
6
/** @type {CSSStyleDeclaration } */
7
7
const style = getComputedStyle ( document . body ) ;
8
8
9
- /** @type {String } */
9
+ /** @type {string } */
10
10
const themeWhite = style . getPropertyValue ( "--vscode-terminal-ansiWhite" ) ;
11
- /** @type {String } */
11
+ /** @type {string } */
12
12
const themeGrey = style . getPropertyValue ( "--vscode-terminal-ansiBrightBlack" ) ;
13
- /** @type {String } */
13
+ /** @type {string } */
14
14
const themeGreen = style . getPropertyValue ( "--vscode-terminal-ansiGreen" ) ;
15
15
16
- /** @type {Map<Number, Number > } */
16
+ /** @type {Map<number, number > } */
17
17
var memory = new Map ( ) ;
18
- /** @type {Map<Number, Number > } */
18
+ /** @type {Map<number, number > } */
19
19
var cpu = new Map ( ) ;
20
20
21
21
/** Length in milliseconds to keep in logs. */
@@ -24,7 +24,7 @@ var length = 0;
24
24
/**
25
25
* Creates a string representation of time units.
26
26
* @param {number } millis Time in milliseconds.
27
- * @returns {String } A string representing time and its unit with 1 decimal place.
27
+ * @returns {string } A string representing time and its unit with 1 decimal place.
28
28
*/
29
29
function timeUnits ( millis ) {
30
30
millis = Math . floor ( millis ) ;
@@ -42,7 +42,7 @@ function timeUnits(millis) {
42
42
/**
43
43
* Creates a string representation of memory units.
44
44
* @param {number } bytes Number of bytes.
45
- * @returns {String } A string representing memory and its unit with 0 decimal places.
45
+ * @returns {string } A string representing memory and its unit with 0 decimal places.
46
46
*/
47
47
function memUnits ( bytes ) {
48
48
if ( bytes >= 1024 ** 3 ) {
@@ -59,7 +59,7 @@ function memUnits(bytes) {
59
59
/**
60
60
* Creates a string representation of CPU utilization.
61
61
* @param {number } cputime Percentage CPU utilization.
62
- * @returns {String } A string representing CPU utilization percentage with 2 decimal places.
62
+ * @returns {string } A string representing CPU utilization percentage with 2 decimal places.
63
63
*/
64
64
function cpuUnits ( cputime ) {
65
65
return Math . ceil ( cputime * 100 ) / 100 + "%" ;
@@ -94,7 +94,7 @@ function updateGraph(
94
94
let rangeX = maxX - minX ;
95
95
96
96
// Decide on tick marks (this may eventually be scalable/zoomable)
97
- // Y - memory/cpu time
97
+ // Y - memory usage /cpu time
98
98
let intervalY = rangeY / ticksY ;
99
99
// X - time
100
100
let intervalX = rangeX / ticksX ;
@@ -105,19 +105,19 @@ function updateGraph(
105
105
const marginBottom = 20 ;
106
106
107
107
// Calculate some values beforehand for readability
108
- /** Y location where the bottom of the graph should be on the canvas, in pixels. */
108
+ /** Y location where the bottom of the graph should be on the { @link canvas} , in pixels. */
109
109
let graphBottom = canvas . height - marginBottom ;
110
- /** Distance between where the top and bottom of the graph should be on the canvas, in pixels. */
110
+ /** Distance between where the top and bottom of the graph should be on the { @link canvas} , in pixels. */
111
111
let graphHeight = canvas . height - marginBottom - marginTop ;
112
- /** X location where the right edge of the graph should be on the canvas, in pixels. */
112
+ /** X location where the right edge of the graph should be on the { @link canvas} , in pixels. */
113
113
let graphRight = canvas . width - marginR ;
114
- /** Distance between where the left and right edges of the graph should be on the canvas, in pixels. */
114
+ /** Distance between where the left and right edges of the graph should be on the { @link canvas} , in pixels. */
115
115
let graphWidth = canvas . width - marginR - marginL ;
116
116
117
117
// Some functions to consistently get canvas location from graph values
118
118
/**
119
119
* @param {number } graphX An X data value from the graph.
120
- * @returns {number } The X location on the canvas where the data cooresponds to.
120
+ * @returns {number } The X location on the { @link canvas} that the data corresponds to.
121
121
*/
122
122
function canvasX ( graphX ) {
123
123
return Math . min (
@@ -130,7 +130,7 @@ function updateGraph(
130
130
}
131
131
/**
132
132
* @param {number } graphY An Y data value from the graph.
133
- * @returns {number } The Y location on the canvas where the data cooresponds to.
133
+ * @returns {number } The Y location on the { @link canvas} that the data corresponds to.
134
134
*/
135
135
function canvasY ( graphY ) {
136
136
return Math . min (
@@ -194,7 +194,7 @@ function updateGraph(
194
194
}
195
195
196
196
/**
197
- * Updates the memory graph based on the data in ` memory` map.
197
+ * Updates the memory graph based on the data in the { @link memory} map.
198
198
*/
199
199
function updateMem ( ) {
200
200
// Get bounds of graph
@@ -242,7 +242,7 @@ function updateMem() {
242
242
}
243
243
244
244
/**
245
- * Updates the CPU graph based on the data in ` cpu` map.
245
+ * Updates the CPU graph based on the data in the { @link cpu} map.
246
246
*/
247
247
function updateCpu ( ) {
248
248
let maxCpu = 0 ;
0 commit comments