ServerHealthMetric class abstract
Represents a snapshot of a specific health metric. An entry is written every minute for each server. All health data can be accessed through Serverpod Insights.
- Inheritance
-
- Object
- SerializableEntity
- TableRow
- ServerHealthMetric
Constructors
- ServerHealthMetric({int? id, required String name, required String serverId, required DateTime timestamp, required bool isHealthy, required double value, required int granularity})
-
factory
-
ServerHealthMetric.fromJson(Map<
String, dynamic> jsonSerialization, SerializationManager serializationManager) -
factory
Properties
- granularity ↔ int
-
The granularity of this timestamp, null represents 1 minute, other valid
values are 60 minutes and 1440 minutes (one day).
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ int?
-
The id column of the row. Can be null if this row is not yet stored in
the database.
getter/setter pairinherited
- isHealthy ↔ bool
-
True if the metric is healthy.
getter/setter pair
- name ↔ String
-
The name of the metric.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverId ↔ String
-
The server associated with this metric.
getter/setter pair
- table → Table
-
The table that this row belongs to.
no setteroverride
- tableName → String
-
The name of the table that contains this row.
no setterinherited
- timestamp ↔ DateTime
-
The time when the connections was checked, granularity is one minute.
getter/setter pair
- value ↔ double
-
The value of the metric.
getter/setter pair
Methods
-
allToJson(
) → Map< String, dynamic> -
Returns a serialized JSON structure of the model which also includes
fields used by the database.
override
-
copyWith(
{int? id, String? name, String? serverId, DateTime? timestamp, bool? isHealthy, double? value, int? granularity}) → ServerHealthMetric -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setColumn(
String columnName, dynamic value) → void -
Sets the value of a column by its name. Used in communication with the
database.
override
-
toJson(
) → Map< String, dynamic> -
Returns a serialized JSON structure of the model, ready to be sent
through the API. This does not include fields that are marked as
database only.
override
-
toJsonForDatabase(
) → Map< String, dynamic> -
Will create a serialization of with the fields that are stored in the
database only.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- t → ServerHealthMetricTable
-
final
Static Methods
-
count(
Session session, {WhereExpressionBuilder< ServerHealthMetricTable> ? where, int? limit, bool useCache = true, Transaction? transaction}) → Future<int> -
delete(
Session session, {required WhereExpressionBuilder< ServerHealthMetricTable> where, Transaction? transaction}) → Future<int> -
deleteRow(
Session session, ServerHealthMetric row, {Transaction? transaction}) → Future< bool> -
find(
Session session, {WhereExpressionBuilder< ServerHealthMetricTable> ? where, int? limit, int? offset, Column? orderBy, List<Order> ? orderByList, bool orderDescending = false, bool useCache = true, Transaction? transaction}) → Future<List< ServerHealthMetric> > -
findById(
Session session, int id) → Future< ServerHealthMetric?> -
findSingleRow(
Session session, {WhereExpressionBuilder< ServerHealthMetricTable> ? where, int? offset, Column? orderBy, bool orderDescending = false, bool useCache = true, Transaction? transaction}) → Future<ServerHealthMetric?> -
include(
) → ServerHealthMetricInclude -
includeList(
{WhereExpressionBuilder< ServerHealthMetricTable> ? where, int? limit, int? offset, OrderByBuilder<ServerHealthMetricTable> ? orderBy, bool orderDescending = false, OrderByListBuilder<ServerHealthMetricTable> ? orderByList, ServerHealthMetricInclude? include}) → ServerHealthMetricIncludeList -
insert(
Session session, ServerHealthMetric row, {Transaction? transaction}) → Future< void> -
update(
Session session, ServerHealthMetric row, {Transaction? transaction}) → Future< bool>
Constants
- db → const ServerHealthMetricRepository