(statistics)
API Calls that perform operations with Plex Media Server Statistics
- get_statistics - Get Media Statistics
- get_resources_statistics - Get Resources Statistics
- get_bandwidth_statistics - Get Bandwidth Statistics
This will return the media statistics for the server
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.statistics.get_statistics(timespan=4)
if ! res.object.nil?
# handle response
end
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
timespan |
T.nilable(::Integer) | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
T.nilable(::PlexRubySDK::Operations::GetStatisticsResponse)
This will return the resources for the server
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.statistics.get_resources_statistics(timespan=4)
if ! res.object.nil?
# handle response
end
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
timespan |
T.nilable(::Integer) | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
T.nilable(::PlexRubySDK::Operations::GetResourcesStatisticsResponse)
This will return the bandwidth statistics for the server
require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
client_id: "3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name: "Plex for Roku",
client_version: "2.4.1",
platform: "Roku",
device_nickname: "Roku 3",
)
s.config_security(
::PlexRubySDK::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
)
)
res = s.statistics.get_bandwidth_statistics(timespan=4)
if ! res.object.nil?
# handle response
end
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
timespan |
T.nilable(::Integer) | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
T.nilable(::PlexRubySDK::Operations::GetBandwidthStatisticsResponse)