Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
dart::PageSpaceGarbageCollectionHistory Class Reference

#include <pages.h>

Public Member Functions

 PageSpaceGarbageCollectionHistory ()
 
 ~PageSpaceGarbageCollectionHistory ()
 
void AddGarbageCollectionTime (int64_t start, int64_t end)
 
int GarbageCollectionTimeFraction ()
 
bool IsEmpty () const
 

Detailed Description

Definition at line 32 of file pages.h.

Constructor & Destructor Documentation

◆ PageSpaceGarbageCollectionHistory()

dart::PageSpaceGarbageCollectionHistory::PageSpaceGarbageCollectionHistory ( )
inline

Definition at line 34 of file pages.h.

34{}

◆ ~PageSpaceGarbageCollectionHistory()

dart::PageSpaceGarbageCollectionHistory::~PageSpaceGarbageCollectionHistory ( )
inline

Definition at line 35 of file pages.h.

35{}

Member Function Documentation

◆ AddGarbageCollectionTime()

void dart::PageSpaceGarbageCollectionHistory::AddGarbageCollectionTime ( int64_t  start,
int64_t  end 
)

Definition at line 1587 of file pages.cc.

1588 {
1589 Entry entry;
1590 entry.start = start;
1591 entry.end = end;
1592 history_.Add(entry);
1593}
void Add(const T &t)
Definition ring_buffer.h:19
glong glong end

◆ GarbageCollectionTimeFraction()

int dart::PageSpaceGarbageCollectionHistory::GarbageCollectionTimeFraction ( )

Definition at line 1595 of file pages.cc.

1595 {
1596 int64_t gc_time = 0;
1597 int64_t total_time = 0;
1598 for (int i = 0; i < history_.Size() - 1; i++) {
1599 Entry current = history_.Get(i);
1600 Entry previous = history_.Get(i + 1);
1601 gc_time += current.end - current.start;
1602 total_time += current.end - previous.end;
1603 }
1604 if (total_time == 0) {
1605 return 0;
1606 } else {
1607 ASSERT(total_time >= gc_time);
1608 int result = static_cast<int>(
1609 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100);
1610 return result;
1611 }
1612}
const T & Get(int i) const
Definition ring_buffer.h:22
int64_t Size() const
Definition ring_buffer.h:28
#define ASSERT(E)
GAsyncResult * result

◆ IsEmpty()

bool dart::PageSpaceGarbageCollectionHistory::IsEmpty ( ) const
inline

Definition at line 41 of file pages.h.

41{ return history_.Size() == 0; }

The documentation for this class was generated from the following files: