Skip to content

Commit

Permalink
s/Ok/OK/ for Go standards
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Bintliff <zbintliff@gmail.com>
  • Loading branch information
zbintliff committed Feb 21, 2018
1 parent 1e07f60 commit 21fb439
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set when importing legacy settings.
- The `sensuctl user change-password` subcommand now accepts flag parameters.
- Configured and enabled etcd autocompaction.
- Add event metrics type, implementing the Sensu Metrics Format.
- Add LastOk to event type. This will be updated to reflect the last timestamp of a succesful event
- Add LastOK to event type. This will be updated to reflect the last timestamp of a succesful event

### Changed
- Refactor Check data structure to not depend on CheckConfig. This is a breaking
Expand Down
2 changes: 1 addition & 1 deletion backend/eventd/eventd.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (e *Eventd) handleMessage(msg interface{}) error {
}

event.Check.MergeWith(prevEvent.Check)
event.LastOk = prevEvent.LastOk
event.LastOK = prevEvent.LastOK
}

// Calculate percent state change for this check's history
Expand Down
2 changes: 1 addition & 1 deletion backend/eventd/eventd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestEventHandling(t *testing.T) {

// Make sure the event has been marked with the proper state
assert.Equal(t, types.EventPassingState, event.Check.State)
assert.Equal(t, badEvent.Timestamp, event.LastOk)
assert.Equal(t, badEvent.Timestamp, event.LastOK)
}

func TestEventMonitor(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion backend/eventd/flapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func state(event *types.Event) {
event.Check.State = types.EventFlappingState
} else if event.Check.Status == 0 {
event.Check.State = types.EventPassingState
event.LastOk = event.Timestamp
event.LastOK = event.Timestamp
} else {
event.Check.State = types.EventFailingState
}
Expand Down
71 changes: 36 additions & 35 deletions types/event.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions types/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ message Event {
// Hooks describes the results of multiple hooks; if event is associated to hook execution.
repeated Hook hooks = 6 [(gogoproto.nullable) = true];

// LastOk displays last time this check was ok; if event status is 0 this is set to timestamp
int64 last_ok = 7;
// LastOK displays last time this check was ok; if event status is 0 this is set to timestamp
int64 last_ok = 7 [(gogoproto.customname) = "LastOK"];
}

0 comments on commit 21fb439

Please sign in to comment.