HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_WorkItemStats.h
Go to the documentation of this file.
1 /*
2 * PROPRIETARY INFORMATION. This software is proprietary to
3 * Side Effects Software Inc., and is not to be reproduced,
4 * transmitted, or disclosed in any way without written permission.
5 *
6 * COMMENTS:
7 */
8 
9 #ifndef __PDG_WORKITEMSTATS_H__
10 #define __PDG_WORKITEMSTATS_H__
11 
12 #include "PDG_API.h"
13 
14 #include <UT/UT_StringHolder.h>
15 #include <SYS/SYS_Types.h>
16 
17 /*
18  * Helper struct for storing basic work item stats, like cook times and
19  * output file size
20  */
22 {
23 public:
24  /// Enumeration of stats stored in this object
25  enum StatType
26  {
27  /// The time at which the work item was submitted to the PDG
28  /// scheduler queue
30 
31  /// The time at which the work item was passed to the
32  /// onSchedule call for the active scheduler
34 
35  /// The time at which the work item began cooking. For scheduled
36  /// items, this is set when the startCook message is recevied, not
37  /// when the item is scheduled.
39 
40  /// The time at which the work item completed cooking.
42 
43  /// The total file size of all outputs on the work item
45 
46  /// The number of tracked stats
47  eStatCount
48  };
49 
50 public:
51  /// Constructs and zero-initializes the stat object
53 
54  /// Resets all stats on the work item
55  void reset();
56 
57  /// Returns the current value of the specified stat type
58  fpreal getStat(StatType stat) const;
59 
60  /// Sets the value of the specified stat type
61  fpreal setStat(StatType stat, fpreal value);
62 
63  /// Sets the value of the specified stat to the current time
64  fpreal setTimeStat(StatType stat);
65 
66  /// Returns the cook duration for the work item. e.g. the time spent
67  /// between starting and stopping cooking
68  fpreal cookDuration() const;
69 
70  /// Sets the service client used to cook the work item
71  void setServiceClient(const UT_StringHolder& client)
72  { myServiceClient = client; }
73 
74  /// Returns the service client name used to cook this work item, or empty
75  /// string if the work item didn't cook using services
77  { return myServiceClient; }
78 
79 private:
80  fpreal myStats[eStatCount];
81  UT_StringHolder myServiceClient;
82 };
83 
84 #endif
#define PDG_API
Definition: PDG_API.h:23
const UT_StringHolder & serviceClient() const
GLboolean reset
Definition: glad.h:5138
The time at which the work item completed cooking.
StatType
Enumeration of stats stored in this object.
The total file size of all outputs on the work item.
fpreal64 fpreal
Definition: SYS_Types.h:277
void setServiceClient(const UT_StringHolder &client)
Sets the service client used to cook the work item.
Definition: core.h:1131