Skip to content
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

Closed
wants to merge 31 commits into from
Closed

WIP Timeline Support #12831

wants to merge 31 commits into from

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Jul 9, 2019

Nothing to see here for now

@andrewvc andrewvc added the in progress Pull request is currently in progress. label Jul 9, 2019
@andrewvc andrewvc requested a review from a team as a code owner July 9, 2019 13:49
@andrewvc andrewvc self-assigned this Jul 9, 2019
return rps.next()
}

func NewResponsePatternSequence(patterns []*responsePattern, shuffle bool) *responsePatternSequence {

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

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)

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)

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")

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 {

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 {

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

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)

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)

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 {

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

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

@andrewvc andrewvc added Team:obs-ds-hosted-services Label for the Observability Hosted Services team [zube]: In Progress Heartbeat labels Jul 9, 2019
@elasticmachine
Copy link
Collaborator

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)

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

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #12831 updated]

  • Start Time: 2020-08-11T16:31:21.418+0000

  • Duration: 12 min 49 sec

Steps errors

Expand to view the steps failures

  • Name: Make check
    • Description: make check

    • Duration: 4 min 44 sec

    • Start Time: 2020-08-11T16:38:26.174+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-08-11T16:42:19.535Z] Failed in branch Elastic Agent x-pack Windows
[2020-08-11T16:42:19.544Z] Failed in branch Elastic Agent Mac OS X
[2020-08-11T16:42:19.553Z] Failed in branch Filebeat oss
[2020-08-11T16:42:19.562Z] Failed in branch Filebeat x-pack
[2020-08-11T16:42:19.571Z] Failed in branch Filebeat Mac OS X
[2020-08-11T16:42:19.579Z] Failed in branch Filebeat x-pack Mac OS X
[2020-08-11T16:42:19.588Z] Failed in branch Filebeat Windows
[2020-08-11T16:42:19.597Z] Failed in branch Filebeat x-pack Windows
[2020-08-11T16:42:19.605Z] Failed in branch Auditbeat oss Linux
[2020-08-11T16:42:19.614Z] Failed in branch Auditbeat crosscompile
[2020-08-11T16:42:19.624Z] Failed in branch Auditbeat oss Mac OS X
[2020-08-11T16:42:19.634Z] Failed in branch Auditbeat oss Windows
[2020-08-11T16:42:19.644Z] Failed in branch Auditbeat x-pack
[2020-08-11T16:42:19.654Z] Failed in branch Auditbeat x-pack Mac OS X
[2020-08-11T16:42:19.664Z] Failed in branch Auditbeat x-pack Windows
[2020-08-11T16:42:19.675Z] Failed in branch Libbeat x-pack
[2020-08-11T16:42:19.686Z] Failed in branch Metricbeat OSS Unit tests
[2020-08-11T16:42:19.697Z] Failed in branch Metricbeat OSS Go Integration tests
[2020-08-11T16:42:19.706Z] Failed in branch Metricbeat OSS Python Integration tests
[2020-08-11T16:42:19.715Z] Failed in branch Metricbeat crosscompile
[2020-08-11T16:42:19.725Z] Failed in branch Metricbeat Mac OS X
[2020-08-11T16:42:19.734Z] Failed in branch Metricbeat x-pack Mac OS X
[2020-08-11T16:42:19.744Z] Failed in branch Metricbeat Windows
[2020-08-11T16:42:19.753Z] Failed in branch Metricbeat x-pack Windows
[2020-08-11T16:42:19.762Z] Failed in branch Winlogbeat Windows x-pack
[2020-08-11T16:42:19.772Z] Failed in branch Kubernetes
[2020-08-11T16:42:20.435Z] Stage "Heartbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:20.445Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:20.456Z] Stage "Metricbeat x-pack" skipped due to earlier failure(s)
[2020-08-11T16:42:20.473Z] Stage "Packetbeat OSS" skipped due to earlier failure(s)
[2020-08-11T16:42:20.482Z] Stage "Winlogbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:20.491Z] Stage "Functionbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:20.500Z] Stage "Generators" skipped due to earlier failure(s)
[2020-08-11T16:42:20.912Z] Failed in branch dockerlogbeat
[2020-08-11T16:42:20.921Z] Failed in branch Journalbeat
[2020-08-11T16:42:21.388Z] Stage "Heartbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:21.397Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:21.407Z] Stage "Packetbeat OSS" skipped due to earlier failure(s)
[2020-08-11T16:42:21.416Z] Stage "Functionbeat" skipped due to earlier failure(s)
[2020-08-11T16:42:21.425Z] Stage "Generators" skipped due to earlier failure(s)
[2020-08-11T16:42:21.529Z] Failed in branch Metricbeat x-pack
[2020-08-11T16:42:21.538Z] Failed in branch Winlogbeat
[2020-08-11T16:42:22.022Z] Failed in branch Heartbeat
[2020-08-11T16:42:22.030Z] Failed in branch Libbeat
[2020-08-11T16:42:22.039Z] Failed in branch Packetbeat OSS
[2020-08-11T16:42:22.047Z] Failed in branch Functionbeat
[2020-08-11T16:42:22.048Z] Stage "Generators" skipped due to earlier failure(s)
[2020-08-11T16:42:22.250Z] Failed in branch Generators
[2020-08-11T16:42:27.609Z] [INFO] unstashV2: JOB_GCS_BUCKET is set. bucket param got precedency instead.
[2020-08-11T16:42:27.647Z] [INFO] unstashV2: JOB_GCS_CREDENTIALS is set. credentialsId param got precedency instead.
[2020-08-11T16:42:27.725Z] [Google Cloud Storage Plugin] Found 1 files to download from pattern: gs://beats-ci-temp/Beats/beats/PR-12831-2/source/source.tgz
[2020-08-11T16:42:27.745Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-12831-2/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-12831/source.tgz
[2020-08-11T16:42:38.748Z] + tar --version
[2020-08-11T16:42:39.069Z] + tar -xpf source.tgz
[2020-08-11T16:42:49.438Z] + rm source.tgz
[2020-08-11T16:42:49.462Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-12831/src/github.com/elastic/beats
[2020-08-11T16:42:49.508Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-12831/src/github.com/elastic/beats/Lint
[2020-08-11T16:42:50.020Z] + cat
[2020-08-11T16:42:50.020Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-08-11T16:42:50.020Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-08-11T16:42:56.657Z] runbld>>> runbld started
[2020-08-11T16:42:56.657Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-08-11T16:42:58.574Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-08-11T16:42:58.575Z] runbld>>> Matches in the system config:
[2020-08-11T16:42:58.575Z] runbld>>> - Matched ^elastic\+beats
[2020-08-11T16:42:58.575Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-08-11T16:42:59.959Z] runbld>>> Debug logging enabled.
[2020-08-11T16:42:59.959Z] runbld>>> Storing result
[2020-08-11T16:42:59.959Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-08-11T16:42:59.959Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200811164259-85113F16
[2020-08-11T16:42:59.959Z] runbld>>> Adding system facts.
[2020-08-11T16:43:00.903Z] runbld>>> Adding vcs info for the latest commit:  220c2c7f74c90c342baa82ee22dcb3493f5a0dc2
[2020-08-11T16:43:00.903Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-08-11T16:43:00.903Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-08-11T16:43:00.903Z] Processing JUnit reports with runbld...
[2020-08-11T16:43:00.903Z] + echo 'Processing JUnit reports with runbld...'
[2020-08-11T16:43:01.477Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-08-11T16:43:01.477Z] runbld>>> DURATION: 18ms
[2020-08-11T16:43:01.477Z] runbld>>> STDOUT: 40 bytes
[2020-08-11T16:43:01.477Z] runbld>>> STDERR: 49 bytes
[2020-08-11T16:43:01.477Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-08-11T16:43:01.477Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-12831
[2020-08-11T16:43:02.420Z] runbld>>> Storing build metadata: 
[2020-08-11T16:43:02.420Z] runbld>>> Adding test report.
[2020-08-11T16:43:02.420Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-12831/src/github.com/elastic/beats
[2020-08-11T16:43:02.992Z] runbld>>> Found 0 test output files
[2020-08-11T16:43:02.992Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 0 Skipped: 0
[2020-08-11T16:43:03.254Z] runbld>>> Storing result
[2020-08-11T16:43:03.516Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-08-11T16:43:03.516Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200811164259-85113F16
[2020-08-11T16:43:03.516Z] runbld>>> Email notification disabled by environment variable.
[2020-08-11T16:43:03.516Z] runbld>>> Slack notification disabled by environment variable.
[2020-08-11T16:43:09.404Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-12831
[2020-08-11T16:43:09.683Z] [INFO] getVaultSecret: Getting secrets
[2020-08-11T16:43:09.775Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-08-11T16:43:10.828Z] + chmod 755 generate-build-data.sh
[2020-08-11T16:43:10.828Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-12831/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-12831/runs/2 FAILURE 709139
[2020-08-11T16:43:10.828Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-12831/runs/2/steps/?limit=10000 -o steps-info.json
[2020-08-11T16:43:11.378Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-12831/runs/2/tests/?status=FAILED -o tests-errors.json
[2020-08-11T16:43:11.378Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-12831/runs/2/log/ -o pipeline-log.txt

@mergify
Copy link
Contributor

mergify bot commented Apr 7, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b intervals upstream/intervals
git merge upstream/master
git push upstream intervals

@ruflin
Copy link
Contributor

ruflin commented Sep 1, 2021

@andrewvc Should this PR stay open (no recent activity) or can it be closed?

@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2021

This pull request does not have a backport label. Could you fix it @andrewvc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Sep 22, 2021
@andrewvc andrewvc closed this Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify Heartbeat in progress Pull request is currently in progress. Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants