Skip to content

Commit 64a42f5

Browse files
stalleyjtobespc
authored andcommitted
Undo Matt's changes (#423)
1 parent b0c097d commit 64a42f5

File tree

5 files changed

+21
-71
lines changed

5 files changed

+21
-71
lines changed

src/plugins/node/env/nodeenvplugin.cpp

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -251,31 +251,20 @@ static void GetNodeInformation(uv_async_t *async, int status) {
251251
if (plugin::nodeName != "") {
252252
contentss << "runtime.name=" << plugin::nodeName << '\n';
253253
}
254-
#if defined(_WINDOWS)
255-
contentss << "heap.size.limit=" << std::to_string(plugin::heapSizeLimit) << '\n';
254+
255+
contentss << "heap.size.limit=" << plugin::heapSizeLimit << '\n';
256256
if (plugin::maxSemiSpaceSizeGuess > 0) {
257-
contentss << "max.semi.space.size=" << std::to_string(plugin::maxSemiSpaceSizeGuess) << '\n';
257+
contentss << "max.semi.space.size=" << plugin::maxSemiSpaceSizeGuess << '\n';
258258
}
259259
if (plugin::maxOldSpaceSizeGuess > 0) {
260-
contentss << "max.old.space.size=" << std::to_string(plugin::maxOldSpaceSizeGuess) << '\n';
260+
contentss << "max.old.space.size=" << plugin::maxOldSpaceSizeGuess << '\n';
261261
}
262262
if (plugin::maxHeapSizeGuess > 0) {
263-
contentss << "max.heap.size=" << std::to_string(plugin::maxHeapSizeGuess) << '\n';
263+
contentss << "max.heap.size=" << plugin::maxHeapSizeGuess << '\n';
264264
}
265-
#else
266-
contentss << "heap.size.limit=" << plugin::heapSizeLimit << '\n';
267-
if (plugin::maxSemiSpaceSizeGuess > 0) {
268-
contentss << "max.semi.space.size=" << plugin::maxSemiSpaceSizeGuess << '\n';
269-
}
270-
if (plugin::maxOldSpaceSizeGuess > 0) {
271-
contentss << "max.old.space.size=" << plugin::maxOldSpaceSizeGuess << '\n';
272-
}
273-
if (plugin::maxHeapSizeGuess > 0) {
274-
contentss << "max.heap.size=" << plugin::maxHeapSizeGuess << '\n';
275-
}
276-
#endif
277265

278-
contentss << "command.line.arguments=" << plugin::commandLineArguments << '\n';
266+
267+
contentss << "command.line.arguments=" << plugin::commandLineArguments << '\n';
279268

280269
std::string content = contentss.str();
281270
monitordata data;

src/plugins/node/gc/nodegcplugin.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,11 @@ void afterGC(GCType type, GCCallbackFlags flags) {
154154

155155
std::stringstream contentss;
156156
contentss << "NodeGCData";
157-
#if defined(_WINDOWS)
158-
contentss << "," << std::to_string(gcRealEnd);
157+
contentss << "," << gcRealEnd;
159158
contentss << "," << gcType;
160-
contentss << "," << std::to_string(hs.total_heap_size());
161-
contentss << "," << std::to_string(hs.used_heap_size());
162-
contentss << "," << std::to_string(gcDuration);
163-
#else
164-
contentss << "," << gcRealEnd;
165-
contentss << "," << gcType;
166-
contentss << "," << hs.total_heap_size();
167-
contentss << "," << hs.used_heap_size();
168-
contentss << "," << gcDuration;
169-
#endif
159+
contentss << "," << hs.total_heap_size();
160+
contentss << "," << hs.used_heap_size();
161+
contentss << "," << gcDuration;
170162
contentss << '\n';
171163

172164
std::string content = contentss.str();

src/plugins/node/heap/nodeheapplugin.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,8 @@ static void GetHeapInformation(uv_timer_s *data, int status) {
6868

6969
std::stringstream contentss;
7070
contentss << "NodeHeapData";
71-
#if defined(_WINDOWS)
72-
contentss << "," << std::to_string(hs.total_heap_size());
73-
contentss << "," << std::to_string(hs.used_heap_size());
74-
#else
75-
contentss << "," << hs.total_heap_size();
76-
contentss << "," << hs.used_heap_size();
77-
#endif
71+
contentss << "," << hs.total_heap_size();
72+
contentss << "," << hs.used_heap_size();
7873
contentss << '\n';
7974

8075
std::string content = contentss.str();

src/plugins/node/loop/nodeloopplugin.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,10 @@ static void GetLoopInformation(uv_timer_s *data, int status) {
7575

7676
std::stringstream contentss;
7777
contentss << "NodeLoopData";
78-
#if defined(_WINDOWS)
79-
contentss << "," << std::to_string(min);
80-
contentss << "," << std::to_string(max);
81-
contentss << "," << std::to_string(num);
82-
contentss << "," << std::to_string(mean);
83-
#else
84-
contentss << "," << min;
85-
contentss << "," << max;
86-
contentss << "," << num;
87-
contentss << "," << mean;
88-
#endif
78+
contentss << "," << min;
79+
contentss << "," << max;
80+
contentss << "," << num;
81+
contentss << "," << mean;
8982
contentss << '\n';
9083

9184
std::string content = contentss.str();

src/plugins/node/prof/nodeprofplugin.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,15 @@ static void ConstructNodeData(const CpuProfileNode *node, int id, int parentId,
155155

156156
result << "{" << "\"functionName\":\"" << strFunction << "\",";
157157
result << "\"url\":\"" << strScript << "\",";
158-
#if defined(_WINDOWS)
159-
result << "\"lineNumber\":" << std::to_string(line) << ",";
160-
result << "\"hitCount\":" << std::to_string(selfSamples) << ",";
161-
result << "\"id\":" << std::to_string(id) << ",";
162-
#else
163-
result << "\"lineNumber\":" << line << ",";
158+
result << "\"lineNumber\":" << line << ",";
164159
result << "\"hitCount\":" << selfSamples << ",";
165160
result << "\"id\":" << id << ",";
166-
#endif
167161
result << "\"children\":[";
168162
}
169163

170164
else{
171-
#if defined(_WINDOWS)
172-
result << "NodeProfData,Node," << std::to_string(id) << ',' << std::to_string(parentId) << ',';
173-
result << script << ',' << function << ',' << std::to_string(line) << ',' << std::to_string(selfSamples) << '\n';
174-
#else
175-
result << "NodeProfData,Node," << id << ',' << parentId << ',';
176-
result << script << ',' << function << ',' << line << ',' << selfSamples << '\n';
177-
#endif
165+
result << "NodeProfData,Node," << id << ',' << parentId << ',';
166+
result << script << ',' << function << ',' << line << ',' << selfSamples << '\n';
178167
}
179168

180169
// clean up
@@ -206,18 +195,10 @@ static char * ConstructData(const CpuProfile *profile) {
206195

207196
std::stringstream result;
208197
if (jsonEnabled){
209-
#if defined(_WINDOWS)
210-
result << "{\"date\":" << std::to_string(GetRealTime()) << ",";
211-
#else
212198
result << "{\"date\":" << GetRealTime() << ",";
213-
#endif
214199
result << "\"head\":";
215200
}
216-
#if defined(_WINDOWS)
217-
else result << "NodeProfData,Start," << std::to_string(GetRealTime()) << '\n';
218-
#else
219-
else result << "NodeProfData,Start," << GetRealTime() << '\n';
220-
#endif
201+
else result << "NodeProfData,Start," << GetRealTime() << '\n';
221202
visit(topRoot, ConstructNodeData, 0, result);
222203
if (jsonEnabled){
223204
result << "}";

0 commit comments

Comments
 (0)