Datafiles Classes¶
rrServer dailyStats¶
Job Information for each project, user and render application¶
Information include:
Memory usage
CPU usage.
Number of jobs rendering, idle, finished, …
Number of frames rendered and frames to be rendered.
_dailyStats_timeline
Class¶
- class libpyRR39_datafiles._dailyStats_timeline¶
A helper class to load _dailyStats based on date. Can keep once loaded dates in memory.
class _dailyStats_timeline functions:
Return Type
Name
Description
int
- currentUnixDayLocal()¶
Returns the current unix date in your local time zone.
- freeMem()¶
Unload any loaded stat files to free memory.
str
- getError()¶
The error message in case initFileList() or period_day_hasData() returned False.
bool
- initFileList(str folder)¶
Specify the folder of the stat files in case your machine does not have the RR_ROOT env var set. The folder is usually RoyalRender/sub/stats/server. Returns True on success.
int
- memUsageMiB()¶
Current Memory usage of this class
- period_day(int unixDay)¶
Returns the _dailyStats_data of the date specified. Returns empty data if it does not exist or cannot be loaded. (see .slotSet in data)
bool
- period_day_hasData(int unixDay)¶
Tries to load the date specified and returns True on success
_dailyStats_data
Class¶
- class libpyRR39_datafiles._dailyStats_data¶
class _dailyStats_data functions:
Return Type
Name
Description
datetime.datetime
- fileNameDate()¶
Date the stats have been written
list
- getClientGroups()¶
Returns a list of
_clientStatDay
statistics. One for each client groupstr
- getError()¶
Returns the error message in case
loadFromFile()
fails.list
- getJobsByType(int id)¶
Returns a list of
_jobStatDay
statistics. The id value can be:User stats
Project stats
Render app stats
- getJobsByTypeAndName(int id, str name)¶
It first gets the list as getJobsByType() does and then returns a
_jobStatDay
statistic by the specified name.int
- jobTypeCount()¶
Returns the number of different job stat lists. Which is 3
bool
- loadFromFile(str filename, bool failIfNoFile)¶
Loads a stat file. failIfNoFile should be True. Return success status
list
- singleStats(int id)¶
-deprecated-
int
- singleStatsCount()¶
-deprecated-
_jobStat
Class¶
- class libpyRR39_datafiles._jobStat¶
class _jobStat properties:
Type
Name
Description
float
- Cost¶
Cost of finished frame segments
int
- Ghz_minutes¶
Ghz*Minutes of finished frame segments
int
- PS_minutes¶
PS*Minutes of finished frame segments
float
- PSneeded¶
An estimate how much PS would be needed to render all unassigned segments
int
- Watt_minutes¶
Watt*Minutes of finished frame segments
int
- avFrameTime¶
Average frame time
int
- avMemUsageMB¶
Average memory usage
float
- avPSUsage¶
Average PS usage
int
- framesLeft¶
Frames left to render
int
- framesRendered¶
Frames rendered during these 15 minutes
byte
- freeA¶
int
- jobsDisabled¶
Number of jobs in disabled state
int
- jobsDone¶
Number of jobs in finished state
int
- jobsIdle¶
Number of jobs in idle state
int
- jobsRendering¶
Number of jobs in rendering state
int
- jobsWaiting¶
Number of jobs in wait state
int
- maxFrameTime¶
Maximum frame time
int
- maxMemUsageMB¶
Maximum memory usage
float
- maxPSUsage¶
Maximum PS usage
float
- renderLicNeeded¶
An estimate how many render licenses would be needed to render all unassigned segments
bool
- slotSet¶
True if this time slot contains any valid data
int
- timesFinished¶
Number of times a frame segment finished
int
- timesSended¶
Number of times a frame segment was sent
class _jobStat functions:
Return Type
Name
Description
bool
- hasValidData()¶
Was the data set and is it valid?
_jobStatDay
Class¶
- class libpyRR39_datafiles._jobStatDay¶
class _jobStatDay properties:
Type
Name
Description
str
- name¶
Name of the user, project or render app
byte
- type¶
This value can be:
User stats
Project stats
Render app stats
class _jobStatDay functions:
Return Type
Name
Description
- getTimeSlot(int index)¶
Get the statistics data at array position index. Each array item contains the stats for 15 minutes of that day:
00:00- 00:15
00:15- 00:30
00:30- 00:45
int
- statCount()¶
Deprecated
- stats(int index)¶
Deprecated
int
- timeSlotCount()¶
Returns the maximum number of possible
_jobStat
values. It always returns 96 for this RR version. (24h / 96 = 15 min)
_clientStat
Class¶
- class libpyRR39_datafiles._clientStat¶
class _clientStat properties:
Type
Name
Description
int
- disabled¶
Number of disabled clients (even if partly disabled and not partly rendering)
int
- idle¶
Number of idle clients
int
- off¶
Number of offline clients
int
- rendering¶
Number of rendering clients (even if partly rendering)
bool
- slotSet¶
True if this time slot contains any valid data
_clientStatDay
Class¶
- class libpyRR39_datafiles._clientStatDay¶
class _clientStatDay properties:
Type
Name
Description
str
- groupName¶
Name of the cleint group
class _clientStatDay functions:
Return Type
Name
Description
- getTimeSlot(int index)¶
Get the statistics data at array position index. Each array item contains the stats for 15 minutes of that day:
00:00- 00:15
00:15- 00:30
00:30- 00:45
int
- timeSlotCount()¶
Returns the maximum number of possible
_jobStat
values. It always returns 96 for this RR version. (24h / 96 = 15 min)
rrGlobalStats¶
Same information as in rrControl tab “Global Info”¶
Information includes
Clients enabled, disabled, rendering.
Jobs rendering, waiting
Frames rendered, waiting
Server CPU usage
Global information about RR is saved to three different lists Each list contains 1440 values (Please verify with dayCount(), monthCount() or yearCount()).
name |
Range |
Res. |
Description |
---|---|---|---|
day |
24h |
1m |
Get the day stats at given index. Index 0 returns the first minute of the day, the time from 00:00.01 to 00:01.00. The stats are updated and overwritten every minute. An index larger than the current minute returns the stats of yesterday. Example: It is 18:00 right now. Querying the stats of 17:00, returns the stats from 1 hour ago. Querying the stats of 19:00, returns the stats from 23h ago. |
month |
30 days |
30m |
The server adds the stats of the last 30 minutes to the last index ‘monthMax()-1’ of the list and pushes all other stat values down in the list. Therefore the index of monthMax()-1 (=1439) returns the stats of the last completed 30 minutes. e.g. if the current time is 18:15, then the last stats are from 17:30 - 18:00 |
year |
360 days |
6h |
The server adds the stats of the last 6 hours to the last index ‘yearMax()-1’ of the list and pushes all other stat values down in the list. Therefore an index of yearMax()-1 (=1439) returns the stats of the last completed quarter day. e.g. if the current time is 17:15, then the last stats in are from 06:00 - 12:00 |
_rrGlobalStatsLS
Class¶
- class libpyRR39_datafiles._rrGlobalStatsLS¶
class _rrGlobalStatsLS properties:
Type
Name
Description
int
- lastSaveDay¶
The time the last index of the day array was saved. This value is the unix system time in the current time zone divided by 60. Use
currentUnixTimeLocal()
to get the current local time.int
- lastSaveMonth¶
The time the last index of the month array was saved. This value is the unix system time in the current time zone divided by 60. Use
currentUnixTimeLocal()
to get the current local time.int
- lastSaveYear¶
The time the last index of the year array was saved. This value is the unix system time in the current time zone divided by 60. Use
currentUnixTimeLocal()
to get the current local time.class _rrGlobalStatsLS functions:
Return Type
Name
Description
int
- currentTime_Unix()¶
Returns the current system time in the local time zone in seconds. The system time is based on the default unix timestamp (seconds since 00:00, Jan 1, 1970).
int
- currentTime_Unix_UTC()¶
Returns the current system time in UTC in seconds. The system time is based on the default unix timestamp (seconds since 00:00, Jan 1, 1970).
datetime.datetime
- currentTime_datetime()¶
Returns the current date and time in the UTC (Coordinated Universal Time) as datetime object.
int
- currentUnixDayLocal()¶
Returns the current local date (no time) as int (days since 00:00, Jan 1, 1970).
- day(int index)¶
Get the day stats at given index. index 0 returns the first minute of the day, the time from 00:00.01 to 00:01.00.
The stats are updated and overwritten every minute. An index larger than the current minute returns the stats of yesterday. Example: It is 18:00 right now. Querying the stats of 17:00, returns the stats from 1 hour ago. Querying the stats of 19:00, will return the stats from 23h ago. .. note:: This is only true as long as the rrServer is running and continues to save stats. Otherwise check
lastSaveDay
.int
- dayMax()¶
Max number of stat values in the array. It returns 1440 for the current version.
str
- getError()¶
Returns the error message in case the loadFromFile() fails.
datetime.datetime
- lastSaveDay_asDatetime()¶
lastSaveDay as python datetime.
int
- lastSaveDay_asUnixTime()¶
lastSaveDay as unix time in seconds ‘since the epoch’. Local timezone
datetime.datetime
- lastSaveMonth_asDatetime()¶
lastSaveMonth as python datetime.
int
- lastSaveMonth_asUnixTime()¶
lastSaveMonth as unix time in seconds ‘since the epoch’. Local timezone
datetime.datetime
- lastSaveYear_asDatetime()¶
lastSaveYear as python datetime.
int
- lastSaveYear_asUnixTime()¶
lastSaveYear as unix time in seconds ‘since the epoch’. Local timezone
bool
- loadFromFile(str FileName)¶
Loads the stats from file FileName. Returns success status.
- month(int index)¶
The server adds the stats of the last 30 minutes to the last index ‘monthMax()-1’ of the array and pushes all other stat values down in the array. Therefore an index of
monthMax()
- 1 = 1439 returns the stats of the last completed 30 minutes. e.g. if the current time is 18:15, then the last stats are from 17:30 - 18:00 .. note:: This is only true as long as the rrServer is running and continues to save stats.OtherwiselastSaveMonth
.int
- monthMax()¶
Max number of stat values in the array. It returns 1440 for the current version.
- period_auto_day(int unixDay, int slot)¶
Automatically chooses ‘month’ or ‘year’ stats based on timerange set with period_setTimeRange().
int
- period_auto_daySlotCount()¶
Number of slots per day for function period_auto_day()
- period_auto_item(int index)¶
Automatically chooses ‘month’ or ‘year’ stats based on timerange set with period_setTimeRange().
int
- period_auto_itemCount()¶
Automatically chooses ‘month’ or ‘year’ stats based on timerange set with period_setTimeRange().
- period_month_day(int unixDay, int slot)¶
Returns stats at day ‘unixDay’. Use slot to loop through all slots of the day. Optional: Use period_setTimeRange to return empty settings if outside time range.
int
- period_month_daySlotCount()¶
Number of slots per day for function period_month_day()
- period_month_item(int index)¶
Get stat item at index 0 to period_month_itemCount()-1. Useful if you just want to loop a time range without being interested in the specific day.
int
- period_month_itemCount()¶
Number of stat items in your time range
- period_setTimeRange(datetime.datetime startTime, datetime.datetime endTime)¶
Required to set the time range for the period…item() function. Optional for period…day() functions if you want to start in the middle of a day. Time as local time (not UTC)
- period_year_day(int unixDay, int slot)¶
Returns stats at day ‘unixDay’. Use slot to loop through all slots of the day. Optional: Use period_setTimeRange to return empty settings if outside time range.
int
- period_year_daySlotCount()¶
Number of slots per day for function period_year_day()
- period_year_item(int index)¶
Get stat item at index 0 to period_year_itemCount()-1. Useful if you just want to loop a time range without being interested in the specific day.
int
- period_year_itemCount()¶
Number of stat items in your time range
int
- secDiff_Day()¶
Returns the time between two slots of the day array.
int
- secDiff_Month()¶
Returns the time between two slots of the month array.
int
- secDiff_Year()¶
Returns the time between two slots of the year array.
- year(int index)¶
The server adds the stats of the last 6 hours to the last index ‘yearMax()-1’ of the array and pushes all other stat values down in the array. Therefore an index of
yearMax()
- 1 = 1439 returns the stats of the last completed quarter day. e.g. if the current time is 17:15, then the last stats in are from 06:00 - 12:00 .. note:: This is only true as long as the rrServer is running and continues to save stats.Otherwise check lastSaveYear.int
- yearMax()¶
Max number of stat values in the array. It returns 1440 for the current version.
_rrGlobalStats_item
Class¶
- class libpyRR39_datafiles._rrGlobalStats_item¶
class _rrGlobalStats_item properties:
Type
Name
Description
int
- clients_avTemperature¶
Average temperature of the first HDD of all rrClients
int
- clients_disabled¶
Number of disabled clients
int
- clients_free¶
Number of free clients
float
- clients_needed¶
An estimate how many clients would be needed to start all unassigned frame segments.
int
- clients_rendering¶
Number of clients rendering
int
- frameTime¶
Average frame time of all jobs
int
- frameTime_3D¶
Average frame time
int
- frameTime_Archive¶
Average frame time
int
- frameTime_Comp¶
Average frame time
int
- frameTime_ExecuteFrames¶
Average frame time
int
- frameTime_FileExport¶
Average frame time
int
- framesLeft¶
Summed frames to be rendered from all jobs
int
- framesLeft_3D¶
Summed frames to be rendered
int
- framesLeft_Archive¶
Summed frames to be rendered
int
- framesLeft_Comp¶
Summed frames to be rendered
int
- framesLeft_ExecuteFrames¶
Summed frames to be rendered
int
- framesLeft_FileExport¶
Summed frames to be rendered
float
- framesPerMin¶
Average number of frames that have been rendered within a minute. Multiply by the time segment to get the number of frames. Real-world example: I drove 100km/h, so I drove 50km in 30 minutes.
float
- framesPerMin_3D¶
Same as
framesPerMin()
, but 3D-render jobs onlyfloat
- framesPerMin_Archive¶
Same as
framesPerMin()
, but Archive/Standalone jobs onlyfloat
- framesPerMin_Comp¶
Same as
framesPerMin()
, but Comp jobs onlyfloat
- framesPerMin_ExecuteFrames¶
Same as
framesPerMin()
, but Execute jobs onlyfloat
- framesPerMin_FileExport¶
Same as
framesPerMin()
, but File Export jobs onlybool
- freeA¶
int
- jobs_rendering¶
Number of jobs rendering
int
- jobs_total¶
Total number of jobs
int
- jobs_unfinished¶
Number of unfinished jobs
float
- serverCoreUsageMachine¶
CPU usage of the machine as cores
float
- serverCoreUsageProcess¶
CPU usage of the rrServer app as cores
int
- serverMemUsage_JobBuffer¶
Memory usage for all job data
int
- serverMemUsage_Machine¶
Memory usage of the rrServer machine.
int
- serverMemUsage_Process¶
Memory usage of the rrServer application.
int
- serverMemUsage_TCPData¶
Memory usage of the 2nd rrServers TCP socket buffer
int
- serverMemUsage_TCPDataCompressed¶
Max memory for a TCP socket buffer after compression
int
- serverMemUsage_TCPSocket¶
Memory usage of the 1st rrServers TCP socket buffer
int
- serverTemperature¶
Temperature of the first HDD in the rrServer machine
bool
- slot_used¶
Is this data valid? If not, then this data is crap or from any other day/time.
rrClientStats¶
render clients stats, like CPU and memory usage¶
Example, use _clientStats_data to load clients render stats and save them to .csv files:
1#
2# This scripts loads the statistics files of all clients.
3#
4# It reports:
5# - The average CPU usage of the OS for each day
6# - The average CPU usage of all Jobs for each day
7# - The total number of frames rendered for each day
8#
9# And saves them as .csv file, which you can load into Excel.
10#
11# You need to execute this python script with rrPythonconsole
12#
13
14from rr_python_utils.load_rrdata import rrData
15import os
16
17
18#Note: Please check your license via rrControl/help menu of you have access to the class rrTable
19client_table = rrGlobal._rrTable()
20clientjob_table = rrGlobal._rrTable()
21
22for table in client_table, clientjob_table:
23 table.setHeader(0, "Date")
24
25
26#_StatsRenderTime
27stat_folder = rrGlobal.rrRootPath() + "sub/stats/clients"
28stat_files = [f for f in os.listdir(stat_folder) if os.path.isfile(os.path.join(stat_folder, f))]
29
30print(f"{stat_folder}: {len(stat_files)} files found.")
31
32loaded_stats = 0
33client_stats = rrData._clientStats_data()
34
35for stat_file in stat_files:
36 if ".stdb" not in stat_file:
37 continue
38
39 if not client_stats.loadFromFile(os.path.join(stat_folder, stat_file)):
40 print(stat_file, "| Error: unable to load stats file!", client_stats.getError())
41 continue
42
43 loaded_stats += 1
44
45 client_name = stat_file[:-5]
46 days_loaded = 0
47 num_days = 1
48
49 for d in range(client_stats.daysMax() - num_days, client_stats.daysMax()):
50 stat_day = client_stats.days(d)
51 if (not stat_day.daySet or stat_day.day==0):
52 continue
53
54 days_loaded = days_loaded +1
55 cpu_amount_OS = 0
56 cpu_amount_job = 0
57 stat_count= 0
58
59 for h in range(0, stat_day.dataMax()):
60 stat_data = stat_day.data(h)
61 if (not stat_data.hasData()):
62 continue
63
64 cpu_amount_OS += stat_data.cpuTotal
65 cpu_amount_job += stat_data.jobThread(0).cpuRender
66 stat_count = stat_count + 1
67
68 if stat_count > 0:
69 cpu_amount_OS = cpu_amount_OS / stat_count
70 cpu_amount_job = cpu_amount_job / stat_count
71
72 if cpu_amount_OS > 0:
73 client_table.setIntByNameNDate(client_name, stat_day.day * 24*60*60 , int(cpu_amount_OS))
74 if (cpu_amount_job>0):
75 clientjob_table.setIntByNameNDate(client_name, stat_day.day * 24*60*60 , int(cpu_amount_job))
76
77 frame_count = 0
78 for h in range(0, stat_day.dataHourlyMax()):
79 hour_data = stat_day.dataHourly(h)
80 frame_count += hour_data.jobThread(0).framesDone
81
82 print(hour_data.jobThread(0).framesDone, f"frames done at the {h}th hour")
83
84 if frame_count>0:
85 clientjob_table.setIntByNameNDate(client_name, stat_day.day*24*60*60 , int(frame_count) )
86
87 print(stat_file, "| days:,", f"{days_loaded} / {client_stats.daysMax()}");
88
89print(stat_folder, ":", str(loaded_stats), "files loaded.")
90
91client_table.sortRowsByDate()
92clientjob_table.sortRowsByDate()
93
94exportFolder = os.path.join(rrGlobal.rrRootPath(), "inhouse")
95
96if not client_table.saveAsCsv(os.path.join(exportFolder, "_clientstats_cpuUsageOS.csv"), False):
97 print ("Error: Unable to save clients table!", client_table.fileError())
98
99if not clientjob_table.saveAsCsv(os.path.join(exportFolder, "_clientstats_cpuUsageJob.csv"), False):
100 print ("Error: Unable to save client jobs table!", clientjob_table.fileError())
101
102print("Saved to folder", exportFolder)
103print("\n\n--- DONE ---\n\n")
_clientStats_all
Class¶
- class libpyRR39_datafiles._clientStats_all¶
A helper class to load _dailyStats based on date. Can keep once loaded dates in memory.
class _clientStats_all functions:
Return Type
Name
Description
int
- clientCount()¶
Number of client stats files found.
int
- currentUnixDayLocal()¶
Returns the current unix date in your local time zone.
int
- findName(str name)¶
Returns the index of client with name. Returns -1 if client name was not found.
- freeMem()¶
Unload any loaded stat files to free memory.
- getData(int index)¶
Get _clientStats_data at index.
- getDataByName(str name)¶
Get _clientStats_data by client name.
- getDataByName_period_day(str name, int unixDay)¶
Get _clientStats_data by client name on unixDay.
bool
- getDataByName_period_day_hasData(str name, int unixDay)¶
Returns true if the _clientStats_data of the client has data on unixDay.
bool
- getData_error(int index)¶
Returns true if getData() failed.
- getData_period_day(int name, int unixDay)¶
Get _clientStats_data on unixDay.
bool
- getData_period_day_hasData(int name, int unixDay)¶
Returns true if the _clientStats_data has data on unixDay.
str
- getError()¶
The error message in case initFileList() or
getDataByName_period_day_hasData()
returned False.str
- getName(int index)¶
Returns the client name at index.
bool
- initFileList(str folder)¶
Specify the folder of the stat files in case your machine does not have the RR_ROOT env var set. The folder is usually RoyalRender/sub/stats/clients. Returns True on success.
int
- memUsageMiB()¶
Current Memory usage of this class
- setDelayedLoad_FileAge(int fileage)¶
If a client is currently writing the stat file, we should wait 3 seconds before loading it. We use the delta between the filedate and the current time to assume that the file is written. As there is often a difference in time between fileserver and your machine, you can modify the time delta in seconds.
_clientStats_data
Class¶
- class libpyRR39_datafiles._clientStats_data¶
class _clientStats_data properties:
Type
Name
Description
int
- StructureID¶
class _clientStats_data functions:
Return Type
Name
Description
- days(int index)¶
-deprecated-
int
- daysCount()¶
The maximum number of days in this array (400).
int
- daysMax()¶
-deprecated-
- getDayByIdx(int index)¶
Get the data of a day. index (daysCount() - 1) is the last day written into the stats file. IF the client is currently running, it is the present day.` index (daysCount() - 2) is the day before present day.
Check days(i).daySet and days(i).day to verify that you got some data and that it is the correct day.
str
- getError()¶
Returns the error message in case the loadFromFile() fails.
bool
- loadFromFile(str FileName)¶
Loads the stats from file FileName
- period_day(int unixDay)¶
Returns the _dailyStats_data of the date specified. Returns empty data if it does not exist or cannot be loaded. (see .daySet in data)
bool
- period_day_hasData(int unixDay)¶
Tries to find the date specified and returns True if the data on that day was set
_clientStats_day
Class¶
- class libpyRR39_datafiles._clientStats_day¶
class _clientStats_day properties:
Type
Name
Description
int
- day¶
The current day in the default unix timestamp (days since Jan 1, 1970). As DAYs witout seconds. See dayAsTime()
bool
- daySet¶
Wether this day contains any useful data (e.g. if the client was not online that day, daySet is false)
class _clientStats_day functions:
Return Type
Name
Description
- data(int index)¶
This data is collected every 20 seconds. Index 0 are the first 20 seconds of the day, Index 1 the 20 - 40 seconds of the day, …
- dataHourly(int index)¶
index 0 is the first hour of the day ( 00:00 - 01:00 )
int
- dataHourlyMax()¶
The maximum number of values in the hourly array (24)
int
- dataMax()¶
The maximum number of values in the data array. (4320 for the current version, one data item every 20 seconds)
datetime.datetime
- dayAsTime()¶
day as datetime object with seconds in unix timestamp (since Jan 1, 1970)
_clientStats_day_data_hourly_jobthread
Class¶
- class libpyRR39_datafiles._clientStats_day_data_hourly_jobthread¶
class _clientStats_day_data_hourly_jobthread properties:
Type
Name
Description
int
- framesDone¶
Frames done in this hour
byte
- jobAborted¶
Number of times a job was aborted
byte
- jobCrashed¶
Number of times a job crashes
byte
- jobSuccessful¶
Number of times a job rendered successfully. Invalid if hasData() returns False
class _clientStats_day_data_hourly_jobthread functions:
Return Type
Name
Description
bool
- hasData()¶
Returns True if data is valid (client and jobthread was running and at that time)
_clientStats_day_data_jobthread
Class¶
- class libpyRR39_datafiles._clientStats_day_data_jobthread¶
class _clientStats_day_data_jobthread properties:
Type
Name
Description
byte
- clientStatus¶
_ClientStatusThread.clientStatus
of the clientfloat
- cpuRender¶
CPU usage of this job.
byte
- jobRenderType¶
Render type of the job. See enum
rrJob._renderType
.int
- memRender10MB¶
deprecated
class _clientStats_day_data_jobthread functions:
Return Type
Name
Description
int
- memRenderMB()¶
Memory usage of render job in MiB.
bool
- threadWasActive()¶
Deprecated
bool
- threadWasRendering()¶
Deprecated
bool
- wasActive()¶
Returns True if this threads was active (existed). Note that
_clientStats_day_data_30s:jobThread_Count
uses this function already. So it should not be required to use this function at all.bool
- wasDisabled()¶
Returns True if the thread was disabled.
bool
- wasIdle()¶
Returns True if the thread was idle and waiting for jobs.
bool
- wasRendering()¶
Returns True if a job was rendering/just finished.
_clientStats_day_data_hourly
Class¶
- class libpyRR39_datafiles._clientStats_day_data_hourly¶
class _clientStats_day_data_hourly functions:
Return Type
Name
Description
- jobThread(int index)¶
Returns the data of a job thread
int
- jobThreadCount()¶
The number of job threads the client was running in this time slot.
int
- jobThreadMax()¶
-Deprecated- ( equals count()-1 )
_clientStats_day_data_30s
Class¶
- class libpyRR39_datafiles._clientStats_day_data_30s¶
class _clientStats_day_data_30s properties:
Type
Name
Description
float
- cpuTotal¶
CPU usage as percentage of the system.
float
- gpuTotal¶
GPU usage as percentage of the system.
int
- memTotal10MB¶
Total memory usage in MiB, divided by 10.
int
- networkInMB¶
Total MiB of data received from the network.
int
- networkInSpeedMaxMB¶
Maximum MiB/s.
int
- networkOutMB¶
Total MiB of data send into the network..
bool
- userLoggedIn¶
Was a user logged in?
class _clientStats_day_data_30s functions:
Return Type
Name
Description
bool
- allThreadsDisabled()¶
Returns True if all job threads have been disabled.
bool
- anyThreadIdle()¶
Returns True if one of the threads was idle and waiting for a job.
bool
- anyThreadRendering()¶
Returns True if one of the threads was rendering.
float
- cpuRender_allThreads()¶
Summed cpuRender of all job threads.
bool
- hasData()¶
Returns True if the client was online.
- jobThread(int index)¶
Returns the data of a job thread
int
- jobThreadCount()¶
The number of job threads the client was running in this time slot.
int
- jobThreadMax()¶
-deprecated- ( equals count()-1 )
int
- memRender10MB_allThreads()¶
Maximum memRender10MB of all job threads.
frameStatJob¶
Same data as the “frames rendered” table in rrControl¶
Frame information includes:
Render time
Memory (5 times per frame)
CPU usage (5 times per frame)
_frameStatJob
Class¶
- class libpyRR39_datafiles._frameStatJob¶
class _frameStatJob functions:
Return Type
Name
Description
- frame(int index)¶
Get the stats of frame with given index. The first frame has index number 0. It is not the frame number in the scene file
int
- frameCount()¶
Number of frames for this job.
int
- frameMax()¶
Number of frames for this job.
str
- getError()¶
Returns the error message in case
loadFromFile()
fails.bool
- loadFromFile(str FileName)¶
Loads the stats from file FileName
_frameStat
Class¶
- class libpyRR39_datafiles._frameStat¶
class _frameStat properties:
Type
Name
Description
byte
- averageValue¶
Sometimes the client is not able to get exact values per frames. In this case it collects the data of the whole frame segmentand averages the values. The frame segment contains of averageValue frames.
str
- client¶
Name of the client
int
- frameNrJob¶
The frame number of the job.
datetime.datetime
- logFileStart¶
The time when the render logfile was started. It is the same time as in the filename.
int
- logFileStartFrame¶
The first frame of the render log. It is the same frame number as in the filename.
bool
- newKSOChunk¶
True for the first frame of a KSO chunk
bool
- newSceneLoaded¶
True for the first frame after loading a new scene
int
- renderTime5Sec¶
The render time of the frame in seconds, divided by 5.
bool
- userLoggedIn¶
True if a user was logged in when rendering the frame
class _frameStat functions:
Return Type
Name
Description
- part(int self)¶
Stats are collected multiple times while a frame is rendered. If a frame takes for example 10 minutes to render, then each of the 5 part represents 2 minute of the render.
int
- partMax()¶
Max number of parts for each frame (5)
_frameStat_part
Class¶
- class libpyRR39_datafiles._frameStat_part¶
class _frameStat_part properties:
Type
Name
Description
float
- jobCPU¶
CPU usage of the job
struct _Mb_hndrt16
- jobMemoryMB¶
Memory usage of job
float
- nonJobCPU¶
Other CPU usage of the machine
byte
- renderThreads¶
Number of job threads rendering on the client at this moment
StatsRenderTime¶
Average frame render time of the last 100 finished jobs of each layer name of each project¶
Every time a job is finished, it adds its average frame time to the list. The list is separated by layers and projects. (For example the the last 100 jobs of render layer “Ambient Occlusion” of project “FancyDrink-Commercial”)
_StatsRenderTime
Class¶
- class libpyRR39_datafiles._StatsRenderTime¶
class _StatsRenderTime properties:
Type
Name
Description
datetime.datetime
- lastSaved¶
The last time this stat was saved
int
- prjCount¶
Get/Set the number of projects
class _StatsRenderTime functions:
Return Type
Name
Description
str
- getError()¶
Returns the error message in case the loadFile() or saveFile() fails.
- getProject(int index)¶
Get
_StatsRenderTime_project
at indexbool
- loadFile(str FileName)¶
Loads the stats from file FileName.
bool
- saveFile(str FileName)¶
Save the stats to file FileName.
_StatsRenderTime_project
Class¶
- class libpyRR39_datafiles._StatsRenderTime_project¶
class _StatsRenderTime_project properties:
Type
Name
Description
datetime.datetime
- lastUsed¶
The last time a job was added to this list.
str
- name¶
Name of the project
class _StatsRenderTime_project functions:
Return Type
Name
Description
bool
- containsRenderType(int renderType)¶
Returns True if there is data for this render type. For renderType please see enum
rrJob._renderType
- getLayer(int renderType, int index)¶
Get
_StatsRenderTime_layer
at index. For renderType please see enumrrJob._renderType
int
- layerCount(int renderType)¶
Returns the number of layers in this list. For renderType please see enum
rrJob._renderType
_StatsRenderTime_layer
Class¶
- class libpyRR39_datafiles._StatsRenderTime_layer¶
class _StatsRenderTime_layer properties:
Type
Name
Description
byte
- jobsAdded¶
Number of jobs that have been added. This is NOT the number of jobs in this list.
str
- name¶
Name of the layer
class _StatsRenderTime_layer functions:
Return Type
Name
Description
float
- averageClientPS(int index)¶
Get the average client power rendering in PS at index as float.
int
- coreUsageMax(int index)¶
Get the max core usage at index.
int
- count()¶
Returns the number of data entries in all lists. The latest job is always at position 0.
float
- frameTime_kPS(int index)¶
Get the kiloPS*seconds used for a frame.
int
- frameTime_sec(int index)¶
Get the frame time at index. The frame time is in PS*seconds.
float
- memUsageMaxGB(int index)¶
Get the max memory usage at index as float.
int
- timeSubmitToFramesDone_minutes(int index)¶
Get the time from submission to the first time all frames had been processed (does not include the re-render of broken frames)
server_clientInfo¶
Some network information collected by the rrServer about the clients.¶
The last IPs and the last WOL command attempts.
_server_clientInfo
Class¶
- class libpyRR39_datafiles._server_clientInfo¶
class _server_clientInfo functions:
Return Type
Name
Description
int
- count()¶
Returns the number of clients in the list.
str
- errorStr()¶
Returns the error message in case
loadFromFile()
fails.datetime.datetime
- fileTime()¶
- info(int index)¶
Get the _Client_Info_save at index. .. note:: The index does not have to match the client order in the current client list in RR.
bool
- loadFromFile(str FileName)¶
Loads the infromation from file FileName. The current filename is RR/sub/stats/clientIPstats82.db
_Client_Info_save
Class¶
- class libpyRR39_datafiles._Client_Info_save¶
class _Client_Info_save properties:
Type
Name
Description
byte
- WOLTryCount¶
Number of times the WOL command was executed without success… note:: The last WOL command could still be in progressand is therefore not successful yet.
datetime.datetime
- lastConnect¶
The last time the rrClient reported a status.
datetime.datetime
- lastWOLTry¶
Last time a WOL command was send to the machine.
str
- saveNameCopy¶
Name of the rrClient
str
- saveVersionCopy¶
Version of the rrClient
class _Client_Info_save functions:
Return Type
Name
Description
datetime.datetime
- lastIPDate(int index)¶
Get the time the rrClient reported this new IP.
- lastIPs(int index)¶
Get the IPs used by the rrClient. index 0 is the latest IP. The IP is stored if the rrClient had a different IP during its latest status report.
- lastWOLs(int index)¶
Get information about the last WOL commands send to the machine. index 0 is the latest one.
int
- maxIPCount()¶
The maximum number of possible IPs for lastIPs and lastIPDate. This is NOT the current count of valid values stored. You have to check if the returned values are valid.
int
- maxWOLCount()¶
The maximum number of possible
_Client_WOLInfo()
forlastWOLs
. This is NOT the current count of valid values stored. You have to check if the returned values are valid.
_Client_WOLInfo
Class¶
- class libpyRR39_datafiles._Client_WOLInfo¶
class _Client_WOLInfo properties:
Type
Name
Description
byte
- bootTime¶
Seconds it took the machine from the WOL command to the rrClient being online.
datetime.datetime
- dateTime¶
Date and time of the WOL command.
bool
- success¶
Was the WOL command successfull?
_IP
Class¶
AppLicenses¶
data from rrConfig’s “Render Licenses” tab¶
_AppLicenses_v8
Class¶
- class libpyRR39_datafiles._AppLicenses_v8¶
Loads the render license count settings as set in rrConfig tab Render Lic.
class _AppLicenses_v8 functions:
Return Type
Name
Description
int
- getCount()¶
Number of render apps with license settings contained in
_AppLicenses_v8
.str
- getError()¶
Returns the error message if load/save returned FALSE.
- getLicense(int index)¶
Get license count settings at index.
bool
- loadFromFile(str filename)¶
Loads the render license config file ‘filename’. Returns True on success.
bool
- saveToFile(str filename)¶
Saves the render license config file ‘filename’. Returns True on success.
bool
- setLicense(int arg2, _AppLicenses_v8_licItem arg3)¶
Sets license count settings at index
_AppLicenses_v8_licItem
Class¶
- class libpyRR39_datafiles._AppLicenses_v8_licItem¶
License count settings for each RenderApp. The settings are partitioned in regions identified by index numbers
The regions are:
0: Default 1: Workstation 2: RenderFarm 3: Cloud
class _AppLicenses_v8_licItem functions:
Return Type
Name
Description
- SetRenderAppName(str name)¶
Sets the name of the render app. E.g. Maya, Nuke, Arnold
float
- getCost(int region)¶
Costs that are used for RR to calculate the costs of a job.
bool
- getIsTypeSet(int region)¶
If a region is not set, then RR uses the count in ‘Default’.
bool
- getIsUnlimited(int region)¶
If the region has unlimited licenses, the lic count is ignored.
int
- getLicCount(int region)¶
Number of licenses
str
- getPluginName()¶
Plugin name of this license. E.g. Yeti, Sapphire
str
- getRenderAppName()¶
Name of the render app. E.g. Maya, Nuke, Arnold
int
- getVersion()¶
Render licenses can be set differently for different versions of the render app. This returns the version this license count applies to.
- setCost(int self, float cost)¶
Sets the figure used to calculate the cost of a job
- setIsTypeSet(int self, bool region)¶
Sets license type (region)
- setIsUnlimited(int self, bool isUnlimited)¶
Sets if the region has unlimeted licenses
- setLicCount(int self, int count)¶
Sets the number of licenses
- setPluginName(str name)¶
Sets the plugin name of this license. E.g. Yeti, Sapphire
- setVersion(int version)¶
Sets the version this license count applies to
ClientGroup¶
List of client groups assigned in rrConfig¶
_ClientGroup
Class¶
- class libpyRR39_datafiles._ClientGroup
class _ClientGroup functions:
Return Type
Name
Description
- addClient(str name)¶
Add client name to the group
str
- allMemberGlobalIndices()¶
Returns global indices of all members of this group as a comma separated string
- clear()¶
Remove all clients from the group
int
- count()¶
Number of Clients in group
str
- getClientName(int index)¶
Get client name at list index
str
- getName()¶
Get the name of the group
bool
- isMember_byGlobalIndex(int global-idx)¶
RR keeps a global list of all clients. This function checks if a client at index global-idx in the global list is a member of this group.
- removeClient(str name)¶
Remove client with given name from the group
- removeClientbyID(int index)¶
Remove client at given index from the group
- setName(str name)¶
Set the name of the group
_ClientGroupList
Class¶
- class libpyRR39_datafiles._ClientGroupList
Similar to
libpyRR39._ClientGroupList
, but loads the settings from the config files rather than from a tcp connection. Contains the client groups set in rrConfig.Example, list all groups and their render clients:
from rr_python_utils.load_rrlib import rrLib import rr_python_utils.connection as rr_connect tcp = rr_connect.server_connect() group_list = tcp.clientGetGroups() for i in range(group_list.count): group = group_list.clientGroup(i) num_clients = group.count() print(f"Group {group.getName()} contains {num_clients} clients") for j in range(num_clients): print( group.getClientName(j))
class _ClientGroupList properties:
Type
Name
Description
int
- count¶
Get/set the number of groups
datetime.datetime
- settingsFileDate¶
Date/Time of the group settings file loaded/saved.
class _ClientGroupList functions:
Return Type
Name
Description
_ClientGroup
- clientGroup(int index)¶
Get client group at given index
- clientGroupSet(int index, _ClientGroup group)¶
Replace client group at index with group.
int
- clientGroupsMax()¶
Returns the maximum number of possible groups in this RR version
str
- getError()¶
Returns the error message in case the loadFromFile() or SaveToFile() fails.
str
- groupsOfClient(str clientName)¶
Returns a comma separated list of groups of which the client is a member of
bool
- loadFromFile(str FileNAme)¶
Loads the stats from file FileName. Not available in
libpyRR39._ClientGroupList
.bool
- saveToFile(str FileName)¶
Saves the stats into file FileName. Not available in
libpyRR39._ClientGroupList
.
History DB¶
The History DB of Royal Render. Same as you see in rrHistoryDB.¶
_historyProjectLoader
Class¶
- class libpyRR39_datafiles._historyProjectLoader¶
Loads the history databases.
class _historyProjectLoader functions:
Return Type
Name
Description
str
- errorString()¶
Same as getError()
str
- getError()¶
Error message in case project or project list cannot be loaded
str
- getInfo()¶
Information of the load progress
- jobAt(int idx)¶
Load job at index.
int
- jobCount()¶
Number of jobs of project.
- jobSetFilter(str user, str project, str app, str rendererPlugin, int age_hours, str includes, bool includeInvert, int filterMask)¶
Filter jobs in project.
- jobSetFilter4(str user, str project, str app, int renderType, str rendererPlugin, int age_hours, str includes, bool includeInvert, int filterMask)¶
Filter jobs in project. For renderType can please see enum
rrJob._renderType
.bool
- loadProject(int idx)¶
Load project at index.
bool
- loadProjectList(str dbFolder)¶
Load a list of all projects located in dbfolder (Should be set to RR/sub/history_db). Returns true on success
- period_setTimeMode(int mode)¶
Changes how the time range of the report should be applied to filter jobs. 0= No job is removed. 1= The jobs send time has to be in the reports time range. 2= The jobs finished time has to be in the reports time range. If the job did not finish yet, it is removed. 3= The jobs send finished time have to be in the reports time range. 4= The time of the jobs last change/updatehas to be in the reports time range.
int
- projectCount()¶
Number of projects found.
str
- projectName(int idx)¶
Name of project at index.
_jobsHistoryDB_Runtime
Class¶
- class libpyRR39_datafiles._jobsHistoryDB_Runtime¶
class _jobsHistoryDB_Runtime properties:
Type
Name
Description
byte
- AAsamplesPercentage¶
Anti-Aliasing Samples override in percent
str
- AOVchannel¶
AOV Channel name.
int
- ID¶
ID of the job.
str
- camera¶
Camera.
byte
- color¶
Color.
str
- companyProjectName¶
Company Project.
str
- customJobType¶
Custom Job type set for the job at submission
str
- customSHotName¶
Shot.
str
- customSceneName¶
Custom Scene Name.
str
- customSeQName¶
Sequence.
str
- customVersionName¶
Version.
datetime.datetime
- dateFinished¶
(Deprecated)
datetime.datetime
- dateSend¶
(Deprecated)
byte
- errorCount¶
Number of errors. Used for See
getError()
byte
- errorCountServer¶
Number of rrServer errors.
int
- framesTotal¶
Total number of frames.
int
- framesTotalNonMulti¶
Total number of frames without taking tiles into account.
int
- framesTotal_FrameSetOnly¶
Total frames in the frameset.
str
- imageDir¶
Image directory.
str
- imageExtension¶
Image Extension.
str
- imageFileName¶
Imagefile Name.
str
- imageFileNameVariables¶
Image File Name with variables for the render app.
byte
- imageFramePadding¶
Image Frame Padding.
int
- imageHeight¶
Height of the image.
bool
- imageIsDataFile¶
Output image was a data file.
byte
- imageMulti¶
Number of image tiles.
bool
- imageSingleOutputFile¶
Returns true if image output was a single file (e.g. .avi).
int
- imageWidth¶
Width of the image.
float
- infoAverageClientPS¶
Average processor speed of clients that rendered on the job
float
- infoAverageClients¶
Average number of clients rendering.
int
- infoAverageFrameTime¶
Average frame time.
int
- infoClients_maxMemoryUsageMB¶
Max memory usage during any render
int
- infoCoreUsageMax¶
Max Peak core usage
float
- infoCpuUsageAverageMax¶
Averaged system CPU usage of a frame - minimum of all frames. (never set returns 100.0)
float
- infoCpuUsageAverageMin¶
Averaged system CPU usage of a frame - maximum of all frames
datetime.datetime
- infoDateFinished¶
Time the job finished.
datetime.datetime
- infoDateSubmitted¶
Date Send.
int
- infoFrameTrafficInMax¶
Total input traffic during a frame - maximum of all frames
int
- infoFrameTrafficInMin¶
Total input traffic during a frame - minimum of all frames (never set returns 0xFFFF)
float
- infoRenderTimeSum_Ghz_h¶
Summed Ghz*h of the job.
int
- infoRenderTimeSum_PS¶
Summed PS*sec of the job.
int
- infoRenderTimeSum_PS_disobeyReset¶
Summed PS*sec of the job. A job reset does not reset this counter.
int
- infoRenderTimeSum_WattSec¶
Deprecated
int
- infoRenderTimeSum_WattSec_disobeyReset¶
Summed Watt*s of the job (Custom counter, can be anything beside Watt as well).
int
- infoRenderTimeSum_seconds¶
Deprecated
int
- infoRenderTimeSum_seconds_disobeyReset¶
Total time the job was rendering. Sums each client seperately. A job reset does not reset this counter.
float
- infoRenderTime_Cost¶
Deprecated
float
- infoRenderTime_Cost_Ghz_disobeyReset¶
Deprecated. Cost of the job based on the Ghz of the clients. Should not be used any more
float
- infoRenderTime_Cost_PS_disobeyReset¶
Cost of the job based on the PS of the clients. (PS*h*price)
float
- infoRenderTime_Cost_disobeyReset¶
Deprecated
int
- infoRenderTime_seconds¶
Total time job was rendering, no matter how many clients have been active at that time.
int
- infoTotalAborted¶
Total times the job was aborted.
int
- infoTotalCrashed¶
Total times the job crashed/had an error.
int
- infoTotalSend¶
Total times the job was send.
int
- infoTotal_FramesReturned_disobeyReset¶
Total number of frames rendered. Keeps the value if job was reset.
str
- layer¶
Layer.
int
- logCount¶
Number of log entries. See
getLog()
byte
- priority¶
Priority used.
byte
- rrJobOS¶
OS the scene was created on.
str
- sceneDatabaseDir¶
Scen Database.
str
- sceneName¶
Scene Name.
byte
- sceneOS¶
OS the current paths are converted to right now.
str
- sceneState¶
Scene State.
str
- sceneTake¶
Scene Take.
int
- seqEnd¶
Sequence End.
int
- seqFileOffset¶
Sequence File Offset.
str
- seqFrameSet¶
Sequence Frame Set.
int
- seqStart¶
Sequence Start.
int
- seqStep¶
Sequence Step.
byte
- seqSubFrames¶
Number of sub-frames used by render app.
str
- shotgunID¶
Shotgun/FTrack ID.
_90_RenderAppBasic_history
- soft¶
Render Application.
str
- submitMachine¶
Machine that submitted the job.
str
- userName¶
User who submitted the job.
class _jobsHistoryDB_Runtime functions:
Return Type
Name
Description
str
- ID2str()¶
The ID of the job as human readable string (short, usually unique).
str
- ID2strFull()¶
The ID of the job as human readable string (long, unique).
str
- IDstr()¶
The ID of the job as human readable string (short, usually unique).
int
- fn2F(float FileFrameNumber, int MultiFrameID)¶
Convert the file frame number into the internal job frame index (starting at 0). MultiFrameID is used for tiled frames.
- getClient(int index)¶
Get the client entry at index.
- getError(int index)¶
Get the error entry at index. There are max errorCount errors in the current job.
- getLog(int index)¶
Get the log entry at index. There are max logCount log entries in the current job.
_RenderAppBasic_history
Class¶
- class libpyRR39_datafiles._RenderAppBasic_history¶
class _RenderAppBasic_history properties:
Type
Name
Description
byte
- executeType¶
Sets if this is an execute job and if, which type of execute job
str
- name¶
Name of the render application (Maya, Nuke)
byte
- renderType¶
Render type. See enum
rrJob._renderType
for values.str
- rendererName¶
Name of the renderer(Vray, Arnold)
str
- rendererVersion¶
Version of the renderer
str
- variantName¶
Custom
int
- version¶
Version of the render application
class _RenderAppBasic_history functions:
Return Type
Name
Description
str
- versionMinorDisplay(bool removePoint, int digits)¶
Returns the minor version of the render app
_History_Error
Class¶
- class libpyRR39_datafiles._History_Error¶
class _History_Error properties:
Type
Name
Description
byte
- what¶
ID of the error.
datetime.datetime
- when¶
Date + time when the error happened
int
- whichMachine¶
Which machine had the error. If positive, then it is the index of the rrClient in RR. Negative values are:
rrWhoMachineServer -1
rrWhoMachineControl -2
rrWhoMachineWebsite -3
rrWhoMachineUnknown -4
rrWhoMachineRemote -5
rrWhoJobAuth -6
rrWhoClient -7
rrWhoCloudManager -8
int
- who¶
deprecated-
class _History_Error functions:
Return Type
Name
Description
str
- errorString()¶
Error message
_History_Log
Class¶
- class libpyRR39_datafiles._History_Log¶
class _History_Log properties:
Type
Name
Description
byte
- clRendering¶
Number of clients rendering at the time it was logged
int
- fMissing¶
Frames missing at the time it was logged
byte
- seqStep¶
interval between rendered frames
byte
- step¶
Step frame of log info (if it applies to that log information)
byte
- what¶
The ID of the log message
datetime.datetime
- when¶
Date+Time it happened
int
- whichMachine¶
Which machine had the error. If positive, then it is the index of the rrClient in RR. Negative values are:
rrWhoMachineServer -1
rrWhoMachineControl -2
rrWhoMachineWebsite -3
rrWhoMachineUnknown -4
rrWhoMachineRemote -5
rrWhoJobAuth -6
rrWhoClient -7
rrWhoCloudManager -8
int
- who¶
deprecated -
class _History_Log functions:
Return Type
Name
Description
str
- logString()¶
Log message
int
- seqEnd()¶
End frame of log info (if it applies to that log information)
int
- seqStart()¶
Start frame of log info (if it applies to that log information)
_jHistoryClient
Class¶
- class libpyRR39_datafiles._jHistoryClient¶
class _jHistoryClient properties:
Type
Name
Description
bool
- assigned¶
Was the client assined?
byte
- times_aborted¶
Number of times aborted
byte
- times_crashed¶
Number of times crashed
byte
- times_sended¶
Number of times send
int
- totalTimeRendered¶
Seconds rendered on the job