MCPcopy
hub / github.com/remotely-save/remotely-save / toString

Method toString

src/profiler.ts:100–139  ·  view source on GitHub ↗
(idx?: number)

Source from the content-addressed store, hash-verified

98 }
99
100 toString(idx?: number) {
101 if (idx !== undefined) {
102 let i = idx;
103 if (idx < 0) {
104 i = this.breakPoints.length + idx;
105 }
106 const label = this.breakPoints?.[i]["label"];
107 const indent = this.breakPoints?.[i]["indent"];
108 let millsec = 0;
109 if (i >= 1) {
110 millsec =
111 Math.round(
112 (this.breakPoints?.[i]["fakeTimeMilli"] -
113 this.breakPoints?.[i - 1]["fakeTimeMilli"]) *
114 10
115 ) / 10.0;
116 }
117 let res = `${" ".repeat(indent)}[${label}]: ${millsec}ms`;
118 if (this.breakPoints[i].hasOwnProperty("size")) {
119 const size = this.breakPoints[i].size as number;
120 res += `, size=${size}`;
121 }
122 return res;
123 }
124
125 if (this.breakPoints.length === 0) {
126 return "nothing in profiler";
127 }
128
129 let res = `[startTime]: ${unixTimeToStr(this.startTime)}`;
130 for (let i = 0; i < this.breakPoints.length; ++i) {
131 if (i === 0) {
132 res += `\n[${this.breakPoints[i]["label"]}]: start`;
133 } else {
134 res += `\n${this.toString(i)}`;
135 }
136 }
137
138 return res;
139 }
140
141 async save(
142 db: InternalDBs,

Callers 15

constructorMethod · 0.95
insertMethod · 0.95
insertSizeMethod · 0.95
saveMethod · 0.95
getAuthUrlAndVerifierFunction · 0.80
messyConfigToNormalFunction · 0.80
arrayBufferToBase64Function · 0.80
arrayBufferToHexFunction · 0.80
sendAuthReqFunction · 0.80
sendRefreshTokenReqFunction · 0.80

Calls 1

unixTimeToStrFunction · 0.90

Tested by

no test coverage detected