Skip to content

Commit

Permalink
Changed output format of operating time
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanperry1 committed Jan 19, 2024
1 parent bd8d3f2 commit b7a6641
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions samples/anomaly-detection/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func run() error {
Payload: payload.OutputInnerPayload{
CommonPayload: input.Payload.Payload.CommonPayload,
MachineStatus: input.Payload.Payload.MachineStatus,
OperatingTime: input.Payload.Payload.OperatingTime,
HumidityAnomalyFactor: humEwma,
HumidityAnomaly: humAnomaly,
TemperatureAnomalyFactor: tempEwma,
Expand Down
6 changes: 3 additions & 3 deletions samples/anomaly-detection/lib/payload/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ type InputPayload struct {

type InputInnerPayload struct {
CommonPayload
MaintenanceStatus string `json:"maintenanceStatus"`
OperatingTime int `json:"operating_time"`
MachineStatus int `json:"machine_status"`
}

type Payload[T any] struct {
Expand All @@ -24,8 +25,6 @@ type CommonPayload struct {
SerialNumber string `json:"serialNumber"`
Site string `json:"site"`
SourceTimestamp string `json:"sourceTimestamp"`
OperatingTime int `json:"operatingTime"`
MachineStatus int `json:"machine_status"`
Humidity float64 `json:"humidity"`
Temperature float64 `json:"temperature"`
Vibration float64 `json:"vibration"`
Expand All @@ -37,6 +36,7 @@ type OutputPayload struct {

type OutputInnerPayload struct {
CommonPayload
OperatingTime int `json:"operatingTime"`
MachineStatus int `json:"machineStatus"`
HumidityAnomalyFactor float64 `json:"humidityAnomalyFactor"`
HumidityAnomaly bool `json:"humidityAnomaly"`
Expand Down

0 comments on commit b7a6641

Please sign in to comment.