-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add Plex dashboard bandwidth and resources #636
Conversation
Nice job! About the testing, would it be possible to just add some \data in tests/payloads.py so we have something to test against? |
So I didn't need to mock bandwidth, but I had to mock the resources. I don't know why the test server can't read CPU/RAM usage. Passing tests are here. (Note that I modified the CI to only run the server tests in this example.) |
Description
Adds support for the bandwidth and resources data on the Plex dashboard.
New objects:
server.SystemAccount
is an account associated with the server. (Updated existing object)server.SystemDevice
is a device associated with the server.server.StatisticsBandwidth
is the bandwidth data for a single account / device / timestamp combination.server.StatisticsResources
is the resource data for a single timestamp.New methods:
PlexServer.systemAccounts()
returns a list of accounts associated with the Plex server. (Updated existing method)PlexServer.systemDevices()
returns a list of devices associated with the Plex server.PlexServer.bandwidth()
will return a list of the dashboard bandwidth data. Thetimespan
parameter will bin the bandwidth data and**kwargs
can be used to filter the bandwidth data.PlexServer.resources()
will return a list of the dashboard CPU and RAM usage data. Only live data (1 second intervals) is available.Other changes:
MyPlexAccount.id
casted to anint
instead of astr
.Example:
Partially addresses #356
TODO: Add some tests. I don't know if bandwidth tests will work since the test server won't have any history. Maybe just check that the dashboard returns something using the live
seconds
interval.Type of change
Please delete options that are not relevant.
Checklist: