Skip to content

Commit

Permalink
[PerfMetrics] add plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MFransen69 committed Apr 9, 2022
1 parent ad3f0b4 commit 82f286f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
8 changes: 4 additions & 4 deletions PerformanceMetrics/SyslogOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ class SysLogOuput : public PerformanceMetrics::IBrowserMetricsLogger {

uint64_t resident = 0;
if( _processmemory != nullptr ) {
_processmemory->Resident(resident);
uint32_t pid = 0;
if( _processmemory->Identifier(pid) == Core::ERROR_NONE ) {
resident = _processmemory->Resident();
uint32_t pid = _processmemory->Identifier();
if( pid != 0 ) {
metrics.StatmLine(GetProcessStatmLine(pid));
}
} else if ( _memory != nullptr ) {
Expand Down Expand Up @@ -389,7 +389,7 @@ class SysLogOuput : public PerformanceMetrics::IBrowserMetricsLogger {

uint32_t pid = 0;
if( _processmemory != nullptr ) {
_processmemory->Identifier(pid);
pid = _processmemory->Identifier();
}
output.ProcessPID = pid;

Expand Down
34 changes: 16 additions & 18 deletions WebKitBrowser/WebKitBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,35 +335,33 @@ namespace WebKitBrowser {
ProcessMemoryObserverImpl(const ProcessMemoryObserverImpl&) = delete;
ProcessMemoryObserverImpl& operator=(const ProcessMemoryObserverImpl&) = delete;

uint32_t Resident(uint64_t& resident) const override {
resident = _info.Resident();
return Core::ERROR_NONE;
uint64_t Resident() const override {
return _info.Resident();
}

uint32_t Allocated(uint64_t& allocated) const override {
allocated = _info.Allocated();
return Core::ERROR_NONE;
uint64_t Allocated() const override {
return _info.Allocated();
}

uint32_t Shared(uint64_t& shared) const override {
shared = _info.Shared();
return Core::ERROR_NONE;
uint64_t Shared() const override {
return _info.Shared();
}

uint32_t IsOperational(bool& operational) const override {
operational = _info.IsActive();
return Core::ERROR_NONE;
uint8_t Processes() const override {
return 0; // webkit and network process do now spawn mew children
}

bool IsOperational() const override {
return _info.IsActive();
}

uint32_t Identifier(uint32_t& id) const override {
uint32_t Identifier() const override {
static_assert(sizeof(Core::process_t) <= sizeof(uint32_t), "PId type size too big to fit in IProcessMemory::ID");
id = _info.Id();
return Core::ERROR_NONE;
return _info.Id();
}

uint32_t Name(string& name) const override {
name = _info.Name();
return Core::ERROR_NONE;
string Name() const override {
return _info.Name();
}

BEGIN_INTERFACE_MAP(ProcessMemoryObserverImpl)
Expand Down

0 comments on commit 82f286f

Please sign in to comment.