Skip to content

Add metrics to heartbeat event.#7

Merged
Karmastic merged 1 commit intoalgorand:masterfrom
winder:will/heartbeat
Jun 20, 2019
Merged

Add metrics to heartbeat event.#7
Karmastic merged 1 commit intoalgorand:masterfrom
winder:will/heartbeat

Conversation

@winder
Copy link
Copy Markdown
Contributor

@winder winder commented Jun 12, 2019

The heartbeat telemetry event is sent every 10 minutes and allow a simple way to find nodes contributing telemetry data. Extend that event to include metrics.

@winder winder requested a review from Karmastic June 12, 2019 17:33
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 12, 2019

CLA assistant check
All committers have signed the CLA.

Comment thread util/metrics/counter.go

values[counter.name] = strconv.FormatFloat(sum, 'f', -1, 32)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove extra line

Copy link
Copy Markdown
Contributor

@Karmastic Karmastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit - won't block it but fixing it at some point would be good.

@Karmastic Karmastic merged commit d2da8a6 into algorand:master Jun 20, 2019
winder referenced this pull request in winder/go-algorand Jun 21, 2019
winder added a commit that referenced this pull request Jun 21, 2019
Fix nit from #7 and run 'make sanity'
stechu pushed a commit to stechu/go-algorand that referenced this pull request Sep 25, 2019
Add mulw (multiple wide) TEAL command
pzbitskiy pushed a commit to pzbitskiy/go-algorand that referenced this pull request Mar 12, 2020
@winder winder deleted the will/heartbeat branch August 11, 2020 18:10
tsachiherman pushed a commit that referenced this pull request Mar 22, 2021
algorandskiy referenced this pull request in algorandskiy/go-algorand Jan 18, 2022
…rces

Check resource deletion in balances interface
shiqizng added a commit to shiqizng/go-algorand that referenced this pull request Apr 4, 2022
btcgenz added a commit to Swarm-Cool/swm-miner that referenced this pull request Apr 7, 2025
garyrob pushed a commit to garyrob/go-hedgecoin that referenced this pull request Feb 22, 2026
## Changes to spec.md

### Issue algorand#1: HTTP Status Code Handling
Added proper status code checking in `doRequest()`:
- Read full body with `io.ReadAll` before checking status
- Handle non-2xx responses by trying to parse JSON error, otherwise return generic HTTP error

### Issue algorand#2 & algorand#3: Request Body Type Field
- Explicitly stated that the `type` field is **removed** from request bodies
- Added new section showing simplified request structs without `Type` field
- Updated request/response documentation to note this change

### Issue algorand#4: Response Body Draining
- Changed from `json.Decoder.Decode()` to `io.ReadAll()` + `json.Unmarshal()`
- This ensures full body consumption for connection reuse even on error paths

### Issue algorand#5: Error Response Handling
- Added structured error handling that distinguishes:
  - Non-2xx HTTP status: Try to parse JSON error from body, wrap as `DaemonError` or generic error
  - Connection errors: Return as-is

### Issue algorand#6: Python Daemon Error Format
- Added `_send_json_response()` and `_send_json_error()` helper methods
- All errors return JSON responses, not HTML
- Error codes map to appropriate HTTP status codes

### Issue algorand#7: SetTimeouts() Implementation
- Changed to use per-request context with timeout (`http.NewRequestWithContext`)
- Dial timeout configured in Transport, query timeout used in context

### Issue algorand#8: Implementation Steps Order
- Combined "Update Go Client" and "Update Go Test Server" into a single step
- Updated plan.md to reflect this consolidation (now 3 implementation steps instead of 4)

### Additional Improvements
- Added graceful shutdown documentation for Python daemon using `HTTPServer.shutdown()`
- Added dial timeout configuration in Transport's DialContext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants