m/p/api: rename Node.HeartbeatTimestamp
Node.HeartbeatTimestamp was renamed to Node.TimeSinceHeartbeat to
better reflect the nature of its contents.
Change-Id: Icef000cf7493a06f7b3aabfc2aba57b380433887
Reviewed-on: https://review.monogon.dev/c/monogon/+/765
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/core/curator/impl_leader_management.go b/metropolis/node/core/curator/impl_leader_management.go
index bc65e42..fd593c3 100644
--- a/metropolis/node/core/curator/impl_leader_management.go
+++ b/metropolis/node/core/curator/impl_leader_management.go
@@ -218,9 +218,7 @@
// TODO(mateusz@monogon.tech): update the API to use protobuf Duration
// message, in order to facilitate filter expressions like
// 'node.HeartbeatTimestamp > duration("30s")'.
- // TODO(mateusz@monogon.tech): change HeartbeatTimestamp proto field
- // name to TimeSinceHeartbeat, since it's not really a timestamp.
- HeartbeatTimestamp: lhb.Nanoseconds(),
+ TimeSinceHeartbeat: lhb.Nanoseconds(),
Health: health,
}
diff --git a/metropolis/proto/api/management.proto b/metropolis/proto/api/management.proto
index ba20cee..b48e2b1 100644
--- a/metropolis/proto/api/management.proto
+++ b/metropolis/proto/api/management.proto
@@ -137,10 +137,10 @@
HEARTBEAT_TIMEOUT = 3;
}
Health health = 5;
- // heartbeat_timestamp is the duration since the last of the node's
- // heartbeats was received, expressed in nanoseconds. It equals zero if no
- // heartbeats were received.
- int64 heartbeat_timestamp = 6;
+ // time_since_heartbeat is the duration since the last of the node's
+ // heartbeats was received, expressed in nanoseconds. It is only valid with
+ // the health status of either HEALTHY or HEARTBEAT_TIMEOUT.
+ int64 time_since_heartbeat = 6;
}
message ApproveNodeRequest {