Skip to content

Commit

Permalink
[GeothermalResearchInstitute] Add history metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcoona committed Sep 16, 2019
1 parent 4f90b70 commit 2a2cca3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public override Task<HeartbeatResponse> Heartbeat(HeartbeatRequest request, Serv

// TODO(zhangshuai.ustc): Update actual states.
// TODO(zhangshuai.ustc): Record metrics.
// TODO(zhangshuai.ustc): Deal with history metrics.
this.metricsMap.AddOrUpdate(request.Device.Id, _ => request.Device.Metrics, (_, __) => request.Device.Metrics);
this.bjdireContext.SaveChanges();

Expand All @@ -218,6 +219,7 @@ public override Task<HeartbeatResponse> Heartbeat(HeartbeatRequest request, Serv
desiredStates = new DeviceDesiredStates();
}

// TODO(zhangshuai.ustc): Deal with history metrics.
return Task.FromResult(new HeartbeatResponse
{
Device = new Device
Expand Down
2 changes: 2 additions & 0 deletions GeothermalResearchInstitute/proto/bjdire/v1/device.proto
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ message UpdateDeviceRequest {

message HeartbeatRequest {
Device device = 1;
repeated DeviceMetrics history_metrics = 2;
}

message HeartbeatResponse {
Device device = 1;
google.protobuf.Timestamp history_metrics_since = 2;
}

service DeviceService {
Expand Down

0 comments on commit 2a2cca3

Please sign in to comment.