Package io.github.mfvanek.pg.model.table
Class TableWithBloat
java.lang.Object
io.github.mfvanek.pg.model.table.Table
io.github.mfvanek.pg.model.table.TableWithBloat
- All Implemented Interfaces:
BloatAware
,TableBloatAware
,TableNameAware
,TableSizeAware
,Comparable<Table>
Represents database table with information about bloat.
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets bloat percentage (in the range from 0 to 100 inclusive).long
Gets bloat amount in bytes.protected String
static TableWithBloat
Constructs aTableWithBloat
object.toString()
Methods inherited from class io.github.mfvanek.pg.model.table.Table
compareTo, equals, getTableName, getTableSizeInBytes, hashCode, of
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mfvanek.pg.model.table.TableNameAware
getTableName
Methods inherited from interface io.github.mfvanek.pg.model.table.TableSizeAware
getTableSizeInBytes
-
Method Details
-
getBloatSizeInBytes
public long getBloatSizeInBytes()Gets bloat amount in bytes.- Specified by:
getBloatSizeInBytes
in interfaceBloatAware
- Returns:
- bloat amount
-
getBloatPercentage
public int getBloatPercentage()Gets bloat percentage (in the range from 0 to 100 inclusive).- Specified by:
getBloatPercentage
in interfaceBloatAware
- Returns:
- bloat percentage
-
innerToString
- Overrides:
innerToString
in classTable
-
toString
-
of
public static TableWithBloat of(@Nonnull String tableName, long tableSizeInBytes, long bloatSizeInBytes, int bloatPercentage) Constructs aTableWithBloat
object.- Parameters:
tableName
- table name; should be non blank.tableSizeInBytes
- table size in bytes; should be positive or zero.bloatSizeInBytes
- bloat amount in bytes; should be positive or zero.bloatPercentage
- bloat percentage in the range from 0 to 100 inclusive.- Returns:
TableWithBloat
-