-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Timeline Support #12831
WIP Timeline Support #12831
Conversation
return rps.next() | ||
} | ||
|
||
func NewResponsePatternSequence(patterns []*responsePattern, shuffle bool) *responsePatternSequence { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported func NewResponsePatternSequence returns unexported type *main.responsePatternSequence, which can be annoying to use
exported function NewResponsePatternSequence should have comment or be unexported
func main() { | ||
states := &sync.Map{} | ||
|
||
var reqs uint64 = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should drop = 0 from declaration of var reqs; it is the zero value
} | ||
monitorIdString, _ := monitorId.(string) | ||
stateTrackerMtx.Lock() | ||
cssId := stateTracker.getID(monitorIdString, trackerStatus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var cssId should be cssID
} else { | ||
trackerStatus = StatusDown | ||
} | ||
monitorIdString, _ := monitorId.(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var monitorIdString should be monitorIDString
@@ -177,10 +303,24 @@ func makeAddSummary() jobs.JobWrapper { | |||
|
|||
// After last job | |||
if state.remaining == 0 { | |||
monitorId, _ := event.GetValue("monitor.id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var monitorId should be monitorID
return state | ||
} | ||
|
||
func (mst *monitorStateTracker) getID(monitorId string, currentStatus stateStatus) time.Time { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method parameter monitorId should be monitorID
if state.flapCompute(currentStatus) { | ||
fmt.Printf("STABLE FLAP\n") | ||
return state | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block
@@ -121,6 +137,116 @@ func addMonitorDuration(job jobs.Job) jobs.Job { | |||
} | |||
} | |||
|
|||
const FlappingThreshold time.Duration = time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported const FlappingThreshold should have comment or be unexported
trackerId := fmt.Sprintf("%s-%s", id, ip) | ||
|
||
stateTrackerMtx.Lock() | ||
cssId := stateTracker.getID(trackerId, trackerStatus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var cssId should be cssID
trackerStatus = StatusUp | ||
} | ||
ip, _ := event.Fields.GetValue("monitor.ip") | ||
trackerId := fmt.Sprintf("%s-%s", id, ip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var trackerId should be trackerID
return rps.next() | ||
} | ||
|
||
func NewResponsePatternSequence(patterns []*responsePattern, shuffle bool) *responsePatternSequence { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported func NewResponsePatternSequence returns unexported type *main.responsePatternSequence, which can be annoying to use
exported function NewResponsePatternSequence should have comment or be unexported
func main() { | ||
states := &sync.Map{} | ||
|
||
var reqs uint64 = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should drop = 0 from declaration of var reqs; it is the zero value
Pinging @elastic/uptime |
Add support for `next_run` and `next_run_in` fields to the monitors object in events. This allows for the computation of SLA statistics in elasticsearch.
} | ||
monitorIdString, _ := monitorId.(string) | ||
stateTrackerMtx.Lock() | ||
cssId := statusBlockTracker.getID(monitorIdString, trackerStatus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var cssId should be cssID
💔 Build FailedExpand to view the summary
Build stats
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
This pull request is now in conflicts. Could you fix it? 🙏
|
@andrewvc Should this PR stay open (no recent activity) or can it be closed? |
This pull request does not have a backport label. Could you fix it @andrewvc? 🙏
NOTE: |
Nothing to see here for now