|
@@ -1112,30 +1112,11 @@ std::vector<mate::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
|
|
|
|
|
|
for (const auto& process_metric : app_metrics_) {
|
|
|
mate::Dictionary pid_dict = mate::Dictionary::CreateEmpty(isolate);
|
|
|
- mate::Dictionary memory_dict = mate::Dictionary::CreateEmpty(isolate);
|
|
|
mate::Dictionary cpu_dict = mate::Dictionary::CreateEmpty(isolate);
|
|
|
|
|
|
pid_dict.SetHidden("simple", true);
|
|
|
- memory_dict.SetHidden("simple", true);
|
|
|
cpu_dict.SetHidden("simple", true);
|
|
|
|
|
|
- memory_dict.Set(
|
|
|
- "workingSetSize",
|
|
|
- static_cast<double>(
|
|
|
- process_metric.second->metrics->GetWorkingSetSize() >> 10));
|
|
|
- memory_dict.Set(
|
|
|
- "peakWorkingSetSize",
|
|
|
- static_cast<double>(
|
|
|
- process_metric.second->metrics->GetPeakWorkingSetSize() >> 10));
|
|
|
-
|
|
|
- size_t private_bytes, shared_bytes;
|
|
|
- if (process_metric.second->metrics->GetMemoryBytes(&private_bytes,
|
|
|
- &shared_bytes)) {
|
|
|
- memory_dict.Set("privateBytes", static_cast<double>(private_bytes >> 10));
|
|
|
- memory_dict.Set("sharedBytes", static_cast<double>(shared_bytes >> 10));
|
|
|
- }
|
|
|
-
|
|
|
- pid_dict.Set("memory", memory_dict);
|
|
|
cpu_dict.Set(
|
|
|
"percentCPUUsage",
|
|
|
process_metric.second->metrics->GetPlatformIndependentCPUUsage() /
|