Skip to content

Conversation

@atav928
Copy link

@atav928 atav928 commented Sep 8, 2025

Add GetSensorUsageHourly

Added GetSensorUsageHourly to _sensor_usage.py endpoint; tested it in production, and works by providing either hourly or weekly billing usage depending on how billing is calculated. This is part of CrowdStrike documentation and also shows in the billing dashboard how these values are pulled. This helps calculate the Cloud (reserved hourly) usage. The endpoint that is not documented, but works along with getting weekly billing information is: "/billing-dashboards-usage/aggregates/hourly-average/v1"

  • Enhancement
  • Updated unit tests

Unit test coverage

pytest tests/test_sensor_usage.py -v
============================================================ test session starts ============================================================
cachedir: .pytest_cache
rootdir: /GitHub/falconpy
configfile: pyproject.toml
plugins: cov-6.3.0
collected 1 item                                                                                                                            

tests/test_sensor_usage.py::TestSensorUsage::test_all_code_paths PASSED                                                               [100%]

============================================================= 1 passed in 1.97s =============================================================

Bandit analysis

[main]	INFO	running on Python 3.13.3
Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01
Run started:2025-11-05 19:15:54.058193

Test results:
	No issues identified.

Code scanned:
	Total lines of code: 98726
	Total lines skipped (#nosec): 0

Run metrics:
	Total issues (by severity):
		Undefined: 0
		Low: 0
		Medium: 0
		High: 0
	Total issues (by confidence):
		Undefined: 0
		Low: 0
		Medium: 0
		High: 0
Files skipped (0):

Added features and functionality

  • If your PR adds features or functionality, what should be included in the next release notes?
    Added support for pulling hourly billing data from billing-dashboard-usage endpoint on top of the weekly-average values.

@jshcodes jshcodes changed the base branch from main to dev September 11, 2025 00:12
@jshcodes jshcodes assigned jshcodes and atav928 and unassigned jshcodes Sep 11, 2025
@jshcodes jshcodes added the sensor usage Sensor usage issues and questions label Sep 11, 2025
…oud based; added it to test sensor; tested it in production and works since the endpoint does work and provides hourly usage billing that is used for Cloud (reserved hourly) usage
@jshcodes
Copy link
Member

jshcodes commented Nov 5, 2025

Merging into dev for additional unit testing and confirmation.

Copy link
Member

@jshcodes jshcodes left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!!! 🙇

@jshcodes jshcodes merged commit cdacbf4 into CrowdStrike:dev Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sensor usage Sensor usage issues and questions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants