Files
plexruby/docs/sdks/statistics/README.md

6.0 KiB
Raw Blame History

Statistics

(statistics)

Overview

API Calls that perform operations with Plex Media Server Statistics

Available Operations

get_statistics

This will return the media statistics for the server

Example Usage

require 'plex_ruby_sdk'


s = ::PlexRubySDK::PlexAPI.new
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

Parameters

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

Response

T.nilable(::PlexRubySDK::Operations::GetStatisticsResponse)

get_resources_statistics

This will return the resources for the server

Example Usage

require 'plex_ruby_sdk'


s = ::PlexRubySDK::PlexAPI.new
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

Parameters

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

Response

T.nilable(::PlexRubySDK::Operations::GetResourcesStatisticsResponse)

get_bandwidth_statistics

This will return the bandwidth statistics for the server

Example Usage

require 'plex_ruby_sdk'


s = ::PlexRubySDK::PlexAPI.new
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

Parameters

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

Response

T.nilable(::PlexRubySDK::Operations::GetBandwidthStatisticsResponse)