Skip to content

Conversation

@BonifacioCalindoro
Copy link
Contributor

@BonifacioCalindoro BonifacioCalindoro commented Aug 23, 2025

The existing examples/get_server_metrics.py version has 2 problems:

  • the iso-formatted dates need a timezone in order to work with the API
  • Object of type Metrics is not JSON serializable anymore.

So i added an explicit UTC timezone for the datetime objects, and got rid of the json.dumps() at the end of the script.

@jooola jooola changed the title Fix get_server_metrics.py example docs: fix server metrics example Aug 26, 2025
@jooola
Copy link
Member

jooola commented Aug 26, 2025

Hey, thanks for the contribution :)

The existing version has 2 problems:
- the iso-formatted dates need a timezone in order to work with the API
- Object of type Metrics is not JSON serializable anymore.
@codecov
Copy link

codecov bot commented Aug 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.57%. Comparing base (14ecce2) to head (c9d03e1).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #547   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files          64       64           
  Lines        2945     2945           
=======================================
  Hits         2844     2844           
  Misses        101      101           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jooola jooola merged commit 30b50d1 into hetznercloud:main Aug 26, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants